From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp153-162.sina.com.cn (smtp153-162.sina.com.cn [61.135.153.162]) (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 0859E2EDD6B for ; Wed, 25 Feb 2026 22:33:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=61.135.153.162 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772058834; cv=none; b=TPfCcCmmpfHMglFVNEglZ05IxOvvUyMsa74xrP/EviTD4HkC708ft6zaXXTutOrqwZ9FGzpSbY7YMVDfKuyQShcozvLnJTX+yn6s0o8PJUlJJvug+XBsCo0TlbIPscaww+sD+kagr32kCrZCfjOfbDQE4Y20EsVFGvZiYKX21bg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772058834; c=relaxed/simple; bh=kKPMD6pgdMYTrrer8hRHhD70yUudBb9ivImuJeslHWA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mQBXvOINBh+KzGhYsw3Guz95krbJjInObj8BXCSefVyDauiYIf2786CMdQb2xAKQLqJ5TSad9msaTkb5HFhgZtdHxjxSOqkj9MxbMhGNUaRmwYtF+1MaMpwPuz7IKudeGDi/+5gvDd8IW/ySb598IKwq6oNzMVxJQ50A/02TbD0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b=p16DrYpX; arc=none smtp.client-ip=61.135.153.162 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b="p16DrYpX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1772058827; bh=Ve17I4+RW46rMLCjHkdy6H2vraQtmRbzFzVYve8g+i4=; h=From:Subject:Date:Message-ID; b=p16DrYpXDluUMSQbkuo2mXpfjlKOd0BFVYZzq/U3oF1eEZxNwVZ7vBRrnlYBb80cP c53Sr4V0egKKg4ud5cfmHDplNOQW8dGDQa0OTGWh7Ludvjrf5F/+Fl8/LPMmCIhGzs nEEnIOLQegZi8gaQ9PcGam10dDtBGLVHOl9CL+Uo= X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([114.249.62.144]) by sina.com (10.54.253.31) with ESMTP id 699F78A100003D55; Wed, 26 Feb 2026 06:33:06 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 9322806816243 X-SMAIL-UIID: F4411DF238BA4B71B1BF7570FF4DE429-20260226-063306-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [kernel?] INFO: task hung in restrict_one_thread_callback Date: Thu, 26 Feb 2026 06:32:57 +0800 Message-ID: <20260225223258.482-1-hdanton@sina.com> In-Reply-To: <69984159.050a0220.21cd75.01bb.GAE@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Fri, Feb 20, 2026 at 03:11:21AM -0800 > Hello, > > syzbot found the following issue on: > > HEAD commit: 635c467cc14e Add linux-next specific files for 20260213 > git tree: linux-next > console output: https://syzkaller.appspot.com/x/log.txt?x=1452f6e6580000 > kernel config: https://syzkaller.appspot.com/x/.config?x=61690c38d1398936 > dashboard link: https://syzkaller.appspot.com/bug?extid=7ea2f5e9dfd468201817 > compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16e41c02580000 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15813652580000 #syz test upstream master --- x/security/landlock/tsync.c +++ y/security/landlock/tsync.c @@ -441,7 +441,7 @@ int landlock_restrict_sibling_threads(co atomic_set(&shared_ctx.preparation_error, 0); init_completion(&shared_ctx.all_prepared); init_completion(&shared_ctx.ready_to_commit); - atomic_set(&shared_ctx.num_unfinished, 1); + atomic_set(&shared_ctx.num_unfinished, 0); init_completion(&shared_ctx.all_finished); shared_ctx.old_cred = old_cred; shared_ctx.new_cred = new_cred; @@ -502,11 +502,8 @@ int landlock_restrict_sibling_threads(co * of for_each_thread(). We can reset it on each loop iteration because * all previous loop iterations are done with it already. * - * num_preparing is initialized to 1 so that the counter can not go to 0 - * and mark the completion as done before all task works are registered. - * We decrement it at the end of the loop body. */ - atomic_set(&shared_ctx.num_preparing, 1); + atomic_set(&shared_ctx.num_preparing, 0); reinit_completion(&shared_ctx.all_prepared); /* @@ -515,11 +512,7 @@ int landlock_restrict_sibling_threads(co */ found_more_threads = schedule_task_work(&works, &shared_ctx); - /* - * Decrement num_preparing for current, to undo that we initialized it - * to 1 a few lines above. - */ - if (atomic_dec_return(&shared_ctx.num_preparing) > 0) { + if (atomic_read(&shared_ctx.num_preparing) > 0) { if (wait_for_completion_interruptible( &shared_ctx.all_prepared)) { /* In case of interruption, we need to retry the system call. */ @@ -548,11 +541,7 @@ int landlock_restrict_sibling_threads(co */ complete_all(&shared_ctx.ready_to_commit); - /* - * Decrement num_unfinished for current, to undo that we initialized it to 1 - * at the beginning. - */ - if (atomic_dec_return(&shared_ctx.num_unfinished) > 0) + if (atomic_read(&shared_ctx.num_unfinished) > 0) wait_for_completion(&shared_ctx.all_finished); tsync_works_release(&works); --