From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from r3-22.sinamail.sina.com.cn (r3-22.sinamail.sina.com.cn [202.108.3.22]) (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 8B3CB1FD4 for ; Thu, 26 Feb 2026 02:19:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.108.3.22 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772072369; cv=none; b=lHObXquT628JQpqAavjXpDOEf76EmgkvvWDTfy1M4z3dwkHXXxxDIm3dnBMsVQ1i9Ku4w/aQL9ooTc8RBo0qhyKwr6BqCWVwtJzy8eR3Ca5r9tVoXXbb2Y4YDa0yLp6T9QUz2j6CKQbCp6+9hz1whgg8Txg4ZlEK1tudha51Upg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772072369; c=relaxed/simple; bh=Sx7WZ2Ro1zoUQH4WL18wQBU5P6QbgRVoZ5jIukBEfgE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GqQ+ZJPi1LHM/lqDi5MfpQFqkLgF8BTRi0lSdbYa9LFeaj4jnmROJBR2cq93TLRBptCCjtQI8zySMO9Ux4NSnCfIxP1fal354LVz5RNEh2f816VQr+7W4GMkHwtHrD7dgTMIbKNA1yyTdBJxM3v2tkqn0tWFyM05hYmbwLElDik= 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=lxxkD/P8; arc=none smtp.client-ip=202.108.3.22 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="lxxkD/P8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1772072365; bh=P9E+Mx0nWK0SU93Eu3TNkvgm7zvRiLC1EOcAhOZm/XI=; h=From:Subject:Date:Message-ID; b=lxxkD/P8uQybEmrlvmTGDTmSfmuChhhe/P1bYJmpu1ZBEaSqJTTGKTQShGBxGAZao eInEQkYsvF6WlcUd8WytbpaiNzwZWKawhGTmp8/dbuTiGIKU6SmgD57avF13kU8T58 6utqQuWBfN5xe9LdcE8JnZKOwCdfYogHEa9GtCb0= X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([114.249.62.144]) by sina.com (10.54.253.33) with ESMTP id 699FADA70000237B; Thu, 26 Feb 2026 10:19:21 +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: 2247226685560 X-SMAIL-UIID: FE1186E799014A7884FDEEFD5B7ADFD3-20260226-101921-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 10:19:11 +0800 Message-ID: <20260226021912.503-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 @@ -391,7 +391,8 @@ static bool schedule_task_work(struct ts ctx->task = NULL; atomic_dec(&shared_ctx->num_preparing); - atomic_dec(&shared_ctx->num_unfinished); + if (atomic_dec_return(&shared_ctx->num_unfinished) == 0) + complete_all(&shared_ctx->all_finished); } } @@ -441,7 +442,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 +503,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 +513,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 +542,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); --