[PATCH v10 3/4] liveupdate: add LIVEUPDATE_SESSION_GET_NAME ioctl

Luca Boccassi luca.boccassi at gmail.com
Wed Apr 29 14:23:07 PDT 2026


On Wed, 29 Apr 2026 at 15:35, Pratyush Yadav <pratyush at kernel.org> wrote:
>
> On Fri, Apr 24 2026, luca.boccassi at gmail.com wrote:
>
> > From: Luca Boccassi <luca.boccassi at gmail.com>
> >
> > Userspace when requesting a session via the ioctl specifies a name and
> > gets a FD, but then there is no ioctl to go back the other way and get
> > the name given a LUO session FD. This is problematic especially when
> > there is a userspace orchestrator that wants to check what FDs it is
> > handling for clients without having to do manual string scraping of
> > procfs, or without procfs at all.
> >
> > Add a ioctl to simply get the name from an FD.
> >
> > Signed-off-by: Luca Boccassi <luca.boccassi at gmail.com>
> > Reviewed-by: Pasha Tatashin <pasha.tatashin at soleen.com>
> > Acked-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
> > ---
> >  include/uapi/linux/liveupdate.h | 21 +++++++++++++++++++++
> >  kernel/liveupdate/luo_session.c | 13 +++++++++++++
> >  2 files changed, 34 insertions(+)
> >
> > diff --git a/include/uapi/linux/liveupdate.h b/include/uapi/linux/liveupdate.h
> > index 30bc66ee9436..3a9ff53b02e0 100644
> > --- a/include/uapi/linux/liveupdate.h
> > +++ b/include/uapi/linux/liveupdate.h
> > @@ -59,6 +59,7 @@ enum {
> >       LIVEUPDATE_CMD_SESSION_PRESERVE_FD = LIVEUPDATE_CMD_SESSION_BASE,
> >       LIVEUPDATE_CMD_SESSION_RETRIEVE_FD = 0x41,
> >       LIVEUPDATE_CMD_SESSION_FINISH = 0x42,
> > +     LIVEUPDATE_CMD_SESSION_GET_NAME = 0x43,
> >  };
> >
> >  /**
> > @@ -213,4 +214,24 @@ struct liveupdate_session_finish {
> >  #define LIVEUPDATE_SESSION_FINISH                                    \
> >       _IO(LIVEUPDATE_IOCTL_TYPE, LIVEUPDATE_CMD_SESSION_FINISH)
> >
> > +/**
> > + * struct liveupdate_session_get_name - ioctl(LIVEUPDATE_SESSION_GET_NAME)
> > + * @size:  Input; sizeof(struct liveupdate_session_get_name)
> > + * @reserved: Input; Must be zero. Reserved for future use.
>
> You need to enforce this in luo_session_get_name(). Otherwise some
> userspace might try to get clever and stash some data here. Then if we
> ever put something else here it will break that userspace.
>
> With this fixed,
>
> Reviewed-by: Pratyush Yadav <pratyush at kernel.org>

Sure, fixed in v11



More information about the kexec mailing list