From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 34FD2BA45 for ; Sun, 5 Apr 2026 15:10:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775401815; cv=none; b=pFHVfseL+vz9aW8r07oKMlS2DyaWjvMOaG0C4rE6Fh/jhU2VaPp6ggjnlHT6mRAs2MBBsA10mvRm3ef5K1qPShawEGZ5wVGPbbjuNki7I0PorZlE6/D+qszjTVnglVkLVI81d3ki708wOeoHFZ2/VbWJt4SNuhSYR93+L5NnE84= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775401815; c=relaxed/simple; bh=AO7t3eq2h9HLO9AEL+MfVjFXZwX4q1lQFe/Hr9mNEus=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=boz1u6/sU+Bz4H1OXSYMfe4KusuYW4U8iwkmJA/vD5egbLBd7T2ww2AP7w78fPm0rkaMLaPU837S7nT/3ZBQ5CldoENpTPlU0Ekv2og2loFRn/Jg0Nfqiv1rB2s7HNuSerHluWxAan4I/O3U++kn6xk93/S02rQDEFpVrXNwFZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=dG3CdhBU; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dG3CdhBU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775401813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vsaS9IGbPBOadtTuoNXtEYqCamSNxDlw5DNXAa/aswY=; b=dG3CdhBUq1iRovQmCqN9lEucK+ly1Y+DfmsOzV3VYUCTVyoyM1TxjaqOapXUD1IF2KKlk7 vjssZyFGtHmYsp0lnWJ+fCo/8hctz7zFWa3ANZBsAapILgYXEQXp7H0X2ANsy8Mzfrh5dt HBA4dsaao3425T8GyUa3tQZL8+etaFw= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-199-2Knc8mGKOvqEraU82IWx0w-1; Sun, 05 Apr 2026 11:10:11 -0400 X-MC-Unique: 2Knc8mGKOvqEraU82IWx0w-1 X-Mimecast-MFC-AGG-ID: 2Knc8mGKOvqEraU82IWx0w_1775401810 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3029D180035C; Sun, 5 Apr 2026 15:10:10 +0000 (UTC) Received: from fedora (unknown [10.44.32.11]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id AB8D919560A6; Sun, 5 Apr 2026 15:10:07 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 5 Apr 2026 17:10:09 +0200 (CEST) Date: Sun, 5 Apr 2026 17:10:05 +0200 From: Oleg Nesterov To: syzbot Cc: io-uring@vger.kernel.org, kees@kernel.org, linux-kernel@vger.kernel.org, luto@amacapital.net, syzkaller-bugs@googlegroups.com, wad@chromium.org Subject: Re: [syzbot] [kernel] WARNING in __secure_computing Message-ID: References: <69d27441.050a0220.2dbe29.0028.GAE@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69d27441.050a0220.2dbe29.0028.GAE@google.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 04/05, syzbot wrote: > > Hello, > > syzbot has tested the proposed patch but the reproducer is still triggering an issue: > lost connection to test machine I can't believe it ;) > console output: https://syzkaller.appspot.com/x/log.txt?x=17a6cdda580000 qemu-system-x86_64: hw/ide/core.c:934: ide_dma_cb: Assertion `prep_size >= 0 && prep_size <= n * 512' failed. Connection to localhost closed by remote host. certainly unrelated. Please retest. #syz test diff --git a/fs/signalfd.c b/fs/signalfd.c index dff53745e352..107a83336657 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -48,17 +48,30 @@ static int signalfd_release(struct inode *inode, struct file *file) return 0; } +static void mk_sigmask(struct signalfd_ctx *ctx, sigset_t *sigmask) +{ + struct k_sigaction *k = current->sighand->action; + int n; + + *sigmask = ctx->sigmask; + for (n = 1; n <= _NSIG; ++n, ++k) { + if (k->sa.sa_flags & SA_IMMUTABLE) + sigaddset(sigmask, n); + } +} + static __poll_t signalfd_poll(struct file *file, poll_table *wait) { struct signalfd_ctx *ctx = file->private_data; __poll_t events = 0; + sigset_t sigmask; poll_wait(file, ¤t->sighand->signalfd_wqh, wait); spin_lock_irq(¤t->sighand->siglock); - if (next_signal(¤t->pending, &ctx->sigmask) || - next_signal(¤t->signal->shared_pending, - &ctx->sigmask)) + mk_sigmask(ctx, &sigmask); + if (next_signal(¤t->pending, &sigmask) || + next_signal(¤t->signal->shared_pending, &sigmask)) events |= EPOLLIN; spin_unlock_irq(¤t->sighand->siglock); @@ -155,11 +168,13 @@ static ssize_t signalfd_dequeue(struct signalfd_ctx *ctx, kernel_siginfo_t *info int nonblock) { enum pid_type type; - ssize_t ret; DECLARE_WAITQUEUE(wait, current); + sigset_t sigmask; + ssize_t ret; spin_lock_irq(¤t->sighand->siglock); - ret = dequeue_signal(&ctx->sigmask, info, &type); + mk_sigmask(ctx, &sigmask); + ret = dequeue_signal(&sigmask, info, &type); switch (ret) { case 0: if (!nonblock) @@ -174,7 +189,7 @@ static ssize_t signalfd_dequeue(struct signalfd_ctx *ctx, kernel_siginfo_t *info add_wait_queue(¤t->sighand->signalfd_wqh, &wait); for (;;) { set_current_state(TASK_INTERRUPTIBLE); - ret = dequeue_signal(&ctx->sigmask, info, &type); + ret = dequeue_signal(&sigmask, info, &type); if (ret != 0) break; if (signal_pending(current)) { @@ -184,6 +199,7 @@ static ssize_t signalfd_dequeue(struct signalfd_ctx *ctx, kernel_siginfo_t *info spin_unlock_irq(¤t->sighand->siglock); schedule(); spin_lock_irq(¤t->sighand->siglock); + mk_sigmask(ctx, &sigmask); } spin_unlock_irq(¤t->sighand->siglock);