mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: syzbot <syzbot+7ea2f5e9dfd468201817@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: Re: [syzbot] [kernel?] INFO: task hung in restrict_one_thread_callback
Date: Fri, 20 Feb 2026 22:27:25 -0800	[thread overview]
Message-ID: <6999504d.a70a0220.2c38d7.0154.GAE@google.com> (raw)
In-Reply-To: <69984159.050a0220.21cd75.01bb.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [syzbot] [kernel?] INFO: task hung in restrict_one_thread_callback
Author: dingyihan@uniontech.com

#syz test

diff --git a/security/landlock/tsync.c b/security/landlock/tsync.c
index 0d2b9c646030..4a6b9d99e594 100644
--- a/security/landlock/tsync.c
+++ b/security/landlock/tsync.c
@@ -447,6 +447,19 @@ int landlock_restrict_sibling_threads(const struct cred *old_cred,
        shared_ctx.new_cred = new_cred;
        shared_ctx.set_no_new_privs = task_no_new_privs(current);
 
+       /*
+        * We must serialize concurrent TSYNC requests within the same thread group.
+        * However, we cannot use a blocking mutex_lock() here. If Thread A holds
+        * the lock and queues task_work on Thread B, and Thread B calls TSYNC and
+        * blocks on the lock, Thread B will never return to user-mode to execute
+        * Thread A's task_work, resulting in a deadlock.
+        *
+        * Using mutex_trylock() allows us to fail gracefully, returning
+        * -ERESTARTNOINTR to process pending task_work and retry the syscall.
+        */
+       if (!mutex_trylock(&current->signal->cred_guard_mutex))
+               return -ERESTARTNOINTR;
+
        /*
         * We schedule a pseudo-signal task_work for each of the calling task's
         * sibling threads.  In the task work, each thread:
@@ -557,5 +570,7 @@ int landlock_restrict_sibling_threads(const struct cred *old_cred,
 
        tsync_works_release(&works);
 
+       mutex_unlock(&current->signal->cred_guard_mutex);
+
        return atomic_read(&shared_ctx.preparation_error);
 }

  reply	other threads:[~2026-02-21  6:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20 11:11 syzbot
2026-02-21  6:27 ` syzbot [this message]
2026-02-23 13:40 ` Frederic Weisbecker
2026-02-23 15:15   ` Günther Noack
2026-02-24  0:10 ` Hillf Danton
2026-02-24  3:05   ` syzbot
2026-02-24 10:00   ` Günther Noack
2026-02-24  3:17 ` Forwarded: " syzbot
2026-02-24  4:25 ` syzbot
2026-02-24 14:43 ` syzbot
2026-02-25  5:10 ` Hillf Danton
2026-02-25  5:48   ` [syzbot] [lsm] [kernel] " syzbot
2026-02-25 10:22 ` [syzbot] [kernel?] " Hillf Danton
2026-02-25 10:51   ` [syzbot] [lsm] [kernel] " syzbot
2026-02-25 12:21 ` [syzbot] [kernel?] " Hillf Danton
2026-02-25 14:15   ` [syzbot] [lsm] [kernel] " syzbot
2026-02-25 22:32 ` [syzbot] [kernel?] " Hillf Danton
2026-02-26  0:13   ` [syzbot] [lsm] [kernel] " syzbot
2026-02-26  2:19 ` [syzbot] [kernel?] " Hillf Danton
2026-02-26  2:44   ` [syzbot] [lsm] [kernel] " syzbot
2026-02-26 10:04 ` [syzbot] [kernel?] " Hillf Danton
2026-02-26 10:50   ` [syzbot] [lsm] [kernel] " syzbot
2026-02-27  0:03 ` [syzbot] [kernel?] " Hillf Danton
2026-02-27  1:49   ` [syzbot] [lsm] [kernel] " syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6999504d.a70a0220.2c38d7.0154.GAE@google.com \
    --to=syzbot+7ea2f5e9dfd468201817@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome