Skip to content

Commit e947433

Browse files
blucarppt
authored andcommitted
liveupdate: reject LIVEUPDATE_IOCTL_CREATE_SESSION with invalid name length
A session name must not be an empty string, and must not exceed the maximum size define in the uapi header, including null termination. Fixes: 0153094 ("liveupdate: luo_session: add sessions support") Cc: stable@vger.kernel.org Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com> Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com> Reviewed-by: Pratyush Yadav <pratyush@kernel.org> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Link: https://lore.kernel.org/r/20260429212221.814107-2-luca.boccassi@gmail.com Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
1 parent 1ab207e commit e947433

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

kernel/liveupdate/luo_session.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,13 @@ static int luo_session_getfile(struct luo_session *session, struct file **filep)
382382

383383
int luo_session_create(const char *name, struct file **filep)
384384
{
385+
size_t len = strnlen(name, LIVEUPDATE_SESSION_NAME_LENGTH);
385386
struct luo_session *session;
386387
int err;
387388

389+
if (len == 0 || len > LIVEUPDATE_SESSION_NAME_LENGTH - 1)
390+
return -EINVAL;
391+
388392
session = luo_session_alloc(name);
389393
if (IS_ERR(session))
390394
return PTR_ERR(session);

0 commit comments

Comments
 (0)