[PATCH] liveupdate: validate session type before performing operation

Mike Rapoport rppt at kernel.org
Tue May 26 01:09:24 PDT 2026


From: Mike Rapoport (Microsoft) <rppt at kernel.org>

On Tue, 19 May 2026 14:24:26 +0200, Pratyush Yadav wrote:
> The sessions ioctls are not applicable to all session types. PRESERVE_FD
> is only applicable to outgoing sessions. RETRIEVE_FD and FINISH are only
> valid for incoming session. Calling a incoming ioctl on an outgoing
> session is invalid and can cause file handlers to run into unexpected
> errors.
> 
> For example, a user can create a (outgoing) session, preserve a memfd,
> and then immediately do a retrieve without doing a kexec in between.
> This would result in memfd's retrieve handler to run. The handlers
> expects to be called from a post-kexec context, and will try to do a
> kho_restore_vmalloc() or kho_restore_folio() to try and restore memory.
> 
> [...]

Applied to fixes branch of liveupdate/linux.git tree, thanks!

[1/1] liveupdate: validate session type before performing operation
      commit: da7f658ccc8da60d836051a7af1c53e643f4bd11

tree: https://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux
branch: fixes

--
Sincerely yours,
Mike.




More information about the kexec mailing list