From nobody Mon Jun 8 06:38:18 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FA9E1DF27D for ; Wed, 3 Jun 2026 02:10:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780452609; cv=none; b=kbZxjeHp5M9hdXQD+AF1TOr+hSWYHl8SDxyP9J9quZMWe61pSMtpQc7bRmyuDgHi6mdGi/UnjTMu3ln4aW6RziFiItCZKaICIcmR5csRnmT8YlFUBJs7gY+bsqO90Ms0a3a+iOvwUsBzlqJtO2+ewtdRoqC7Ey94246VPNJev2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780452609; c=relaxed/simple; bh=0xB5p3qlmNyXhILx1KHc3mcvKLJJLjMiI1XN0BMH8oo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=FBtgLxunMAv/fUL6w+QJRgFcmjpgTf3wul1YWQzpxJK2yfDvIoN6dsxes2FFLuNg1UR7ygj5HAlPiM3qudiLMuTSFdoF+dUx9KRJIKGri++OPG2TIR3nhEHOqNwQaeIJ2QZBzjWxqL92ozNMLX+lraI3UTfxAATiA94/6cSaGpA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 4fc1f66e5ef111f1aa26b74ffac11d73-20260603 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:2580960e-d6b9-421b-af10-c5f608cc17d4,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:e7bac3a,CLOUDID:0e098efc8a83ea3f186b20409809d028,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|136|850|865|898,TC:nil,Content:0|15| 50,EDM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0 ,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 4fc1f66e5ef111f1aa26b74ffac11d73-20260603 X-User: xieyi@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1332926440; Wed, 03 Jun 2026 10:09:54 +0800 From: Yi Xie To: Christian Brauner , Al Viro Cc: linux-kernel@vger.kernel.org, Yi Xie Subject: [PATCH] mqueue: reject mq_notify with signo 0 Date: Wed, 3 Jun 2026 10:09:36 +0800 Message-Id: <20260603020936.54508-1-xieyi@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" valid_signal(0) is true; __do_notify() skips signo 0 anyway. Signed-off-by: Yi Xie --- 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; =20 - /* do_mq_notify() accepts sigev_signo =3D=3D 0, why?? */ if (!info->notify.sigev_signo) break; =20 @@ -1281,9 +1280,9 @@ static int do_mq_notify(mqd_t mqdes, const struct sig= event *notification) notification->sigev_notify !=3D SIGEV_THREAD)) return -EINVAL; if (notification->sigev_notify =3D=3D SIGEV_SIGNAL && - !valid_signal(notification->sigev_signo)) { + (!notification->sigev_signo || + !valid_signal(notification->sigev_signo))) return -EINVAL; - } if (notification->sigev_notify =3D=3D SIGEV_THREAD) { long timeo; =20 --=20 2.25.1