From nobody Tue Apr 7 04:14:22 2026 Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8C30351C1C for ; Mon, 16 Mar 2026 08:21:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.70 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773649271; cv=none; b=cl2mxx/FLiiA0u3NrEVl2PrxARSvDC9P3y2k5GAGJlfPIsTJxpvdRqge6i+oe8jyblqRoSY19qxwU8/vkH7r7wOth5t98b8VnVHCkiIjGouou2tSuxdRhbG+P9/YMPJDhq+K/71mjQjdQxXoLFm/nk3M17wesw2O2Dht8TneFEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773649271; c=relaxed/simple; bh=1GZRDVVuJsRbQiaXKXOTugWr88HrRfL2la07z57Ifk0=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=UyS/wxFYNOZGDWbTW03+LL+2C8zIcg5/7/Rh669g5tySOpr8D56S6bukRhIw9FMQOLYcR0BvAfIQZYHRDtyBd4un46dbHLsHScW1cwxEcJb4/3PLS9NPfqOo13gKxvZq4bk4Tmn6GfELn5nnrn2ugY8ULVQnhdyXBH4M+XphrqU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.210.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-ot1-f70.google.com with SMTP id 46e09a7af769-7d74cd7b1e3so18846855a34.1 for ; Mon, 16 Mar 2026 01:21:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773649269; x=1774254069; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JHBzF8hIf7s/PSeZOGTYsI+b8aLEthA+7fcKFIb40es=; b=DnR0sjpL+23yxEUd6/AJor/wNlIir6ELkedGRDgf+FroRpo3c3XGmuUdXFFrjOjOp9 bAGkYwEsWtrr00gvmQrr0Y2AXWPGjpqqGWGdaenahqGO7zsCALlAIBQkZmjFVChcM4p7 Pmflm5xwlwzR2A9O4wUa27KY57TYOC6Rt8ZkY5eyDHENEGw7BbPuK9ZjcRUPxqa8kZXr ExmmbP/45cucCJKTq/8/tSOxlwYIYMnJb/DNRpBMf8pUqAXAKGjVdTQowYlXFR2fo7dE 7aHKKGdGJcOOvFMCtv8ckxTQDyY9a6pC8DCe+jxhr8rB7CeVrnYy8oLh2zzJNiArQeqX OuTg== X-Gm-Message-State: AOJu0Yxo9DwFXqEE3lYW71iaDGJhXDcusliAVom9pm/qCro0uK6LXGXf pcEcHHoIyRZiIN6i6wkIeC0ECRskPYpDBdoSVEwJEjjLOaDmf/vVcwoqrJ9EoBE7Q0kRvJLDzUY QyZfrTT3o+r0QKSl28yEjdrPYMXV8IJPw3l9PIGrHGH4/0WUvUK66fl2Rak8= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:c2d3:10b0:67b:ddec:e4c1 with SMTP id 006d021491bc7-67bddece683mr4764797eaf.69.1773649268800; Mon, 16 Mar 2026 01:21:08 -0700 (PDT) Date: Mon, 16 Mar 2026 01:21:08 -0700 In-Reply-To: <69a313aa.050a0220.3a55be.0042.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69b7bd74.050a0220.248e02.010f.GAE@google.com> Subject: Forwarded: [PATCH] kernel/fork: validate exit_signal in kernel_clone() From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] kernel/fork: validate exit_signal in kernel_clone() Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.gi= t master When a child process exits, it sends exit_signal to its parent via do_notify_parent(). The clone() syscall constructs exit_signal as: (lower_32_bits(clone_flags) & CSIGNAL) CSIGNAL is 0xff, so values in the range 65-255 are possible. However, valid_signal() only accepts signals up to _NSIG (64 on x86_64), causing a WARN_ON in do_notify_parent() when the process exits: WARNING: kernel/signal.c:2174 do_notify_parent+0xc7e/0xd70 The syzkaller reproducer triggers this by calling clone() with flags=3D0x80, resulting in exit_signal =3D (0x80 & CSIGNAL) =3D 128, which exceeds _NSIG and is not a valid signal. The v1 of this patch added the check only in the clone() syscall handler, which is incomplete. kernel_clone() has other callers such as sys_ia32_clone() which would remain unprotected. Move the check to kernel_clone() to cover all callers. clone3() already validates exit_signal in copy_clone_args_from_user(). The comment above kernel_clone() states that callers are expected to validate exit_signal, but several callers never did. Adding the check to kernel_clone() enforces this for all callers centrally. Reported-by: syzbot+bbe6b99feefc3a0842de@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3Dbbe6b99feefc3a0842de Signed-off-by: Deepanshu Kartikey --- kernel/fork.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/fork.c b/kernel/fork.c index 947a8dbce06a..89d7eb67baf5 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -2687,6 +2687,8 @@ pid_t kernel_clone(struct kernel_clone_args *args) (args->pidfd =3D=3D args->parent_tid)) return -EINVAL; =20 + if (!valid_signal(args->exit_signal)) + return -EINVAL; /* * Determine whether and which event to report to ptracer. When * called from kernel_thread or CLONE_UNTRACED is explicitly --=20 2.43.0