From d7337cad4dbe6caf9535d3539daed353dd425dc1 Mon Sep 17 00:00:00 2001 From: mingzhu wang Date: Tue, 9 Jun 2026 02:15:00 +0000 Subject: [PATCH 1/2] kernel: exit: fix coding style missing spaces Add spaces around bitwise AND and shift operators in sys_exit() to comply with the Linux kernel coding style. Signed-off-by: mingzhu wang Link: https://patch.msgid.link/20260609021436.1739-1-mingzhu.wang@transsion.com Signed-off-by: Christian Brauner (Amutable) --- kernel/exit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/exit.c b/kernel/exit.c index 1056422bc101..7ac52196d819 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1111,7 +1111,7 @@ void __noreturn make_task_dead(int signr) SYSCALL_DEFINE1(exit, int, error_code) { - do_exit((error_code&0xff)<<8); + do_exit((error_code & 0xff) << 8); } /* From 1184f5e8200902cae3e098ac68d8600ecdf6fe28 Mon Sep 17 00:00:00 2001 From: Yi Xie Date: Wed, 3 Jun 2026 10:09:36 +0800 Subject: [PATCH 2/2] mqueue: reject mq_notify with signo 0 valid_signal(0) is true; __do_notify() skips signo 0 anyway. Signed-off-by: Yi Xie Link: https://patch.msgid.link/20260603020936.54508-1-xieyi@kylinos.cn Signed-off-by: Christian Brauner (Amutable) --- ipc/mqueue.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 4798b375972b..fa0b02c68cf1 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -790,7 +790,6 @@ static void __do_notify(struct mqueue_inode_info *info) struct kernel_siginfo sig_i; struct task_struct *task; - /* do_mq_notify() accepts sigev_signo == 0, why?? */ if (!info->notify.sigev_signo) break; @@ -1281,9 +1280,9 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification) notification->sigev_notify != SIGEV_THREAD)) return -EINVAL; if (notification->sigev_notify == SIGEV_SIGNAL && - !valid_signal(notification->sigev_signo)) { + (!notification->sigev_signo || + !valid_signal(notification->sigev_signo))) return -EINVAL; - } if (notification->sigev_notify == SIGEV_THREAD) { long timeo;