From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 46386382295 for ; Wed, 4 Mar 2026 07:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772610305; cv=none; b=Rnzyq9gHVHSVErO/IQj9JEFotkCwmpjBfnA0MN81Xfh9dhEWyAviGCoMtw8DRh6+/vg6HQad5+DuYC0AuYfLf80QQLRuOqm/5v9VgarxsPZuZKLwgMvN0yxM5ifXiHvGxuNg01/okTTV4o81SBtrpJjsViDVz3/6ZxxnTStIwy8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772610305; c=relaxed/simple; bh=Bl7YSDtmmKcJFmJ3E29bRrcaVds7w3c5c0tPYWcUazU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N1xY7EA+8VYtzB9U6W73ALhn78UqX1qqTFfirQ3paRwi4zltXcoETR/C9u1TvCwX07jw7CzD5yJq5ExLBUrFdsNx4LjVgUGHxNHh3ZQOkfPx6ZAlXVKl88oQaBqfVHMWyGHTdF1ySSQEFv/vOb2BVCfHhf236s8GXyRIyT3F5RQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hwfDiiTs; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hwfDiiTs" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-439baf33150so2102039f8f.0 for ; Tue, 03 Mar 2026 23:45:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772610302; x=1773215102; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=y6R4KpRzY0pdh8BZXIGvyv7ewrhWYqro8EcQRduV4G0=; b=hwfDiiTsQLm5HzfXfnC5F0WpM7NDxTzhA6fNLc1iWFOFuqAUwZ42GKmoNJuDNBuVXw ZyxyOUTSXAUznnGZiogm71ACNvD+UznnIpRoyO9TTmIDLlED3wsyfoVL92dxRCxtgPpo Wo0BEIuAoqfpFS+wgcrQc3OPX/bimciTb+TpRxUOGFF6GzdO51pMUpMOsw0eQg10wDje LwPGDhKEsRrQ6kQ73Z/e4nQx06VB6c/Xqqj1tFuIHtes2kce9EgMtVFWitYqWFkPUsnB KJ+Ge3ZUoKWSunuI/eTkfo+Q/Z4BvAOvrGVc+d5qEyDnUEHupeu4ZGHVd+FUwKNLUsm9 0BUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772610302; x=1773215102; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y6R4KpRzY0pdh8BZXIGvyv7ewrhWYqro8EcQRduV4G0=; b=uJNV7SSryD6nIW7dN0Vk7I3FTpY9opq84sDNTo+CSlKlxYENzU+nrkBSFaliut7/bx 90q7xN7SKymh56T0NL56mfA3c2AbrtBFjrgNtJEjw0JfAvlUTa5fZUbRlU5F4DW0gNLC SeIvSk0gDCOu44kjXcG1lbJVUBN3MkEFTqA3BGVqGtXBT6u2livgtbQWVHhLWd4T2EXd FOFpep504X4RyTBfc7l8aqYc6JcEzEFBihZyDsllOcT58qzcSF7T4eTvdZEs9r5PJ3Nx 9xL82Pwmi46qJuISY/q0MVt5jxfyrITN1yaI8cS9/Xb8M14wdUovxMaSTyoVhHgJTi1Z xpPQ== X-Forwarded-Encrypted: i=1; AJvYcCW5d8B1HVNfqLzOp1GEeQ9nJwXgoiVA432RcHjBeFVUtqjC7wCR/LP1+Afpj/TyPy255wjAS2MoTrMG00w=@vger.kernel.org X-Gm-Message-State: AOJu0YzmyMSW2qBQTIIPbVp8QWPJe2WlxqhRh5JG0El3MxmXFULMCCd7 KpokvHnBr1MkgZM4uL5aQpiE/lQSWMnKY2lQcAUw8gtRuhpC+QW2L9xd X-Gm-Gg: ATEYQzx5znGsn21WST6YZ2okN8az/0zO+9C5YJj/WmbVb3U5CaIroeXiKYHhMC3MHuk JPxDyRL5UCqDHz4DYr78cvUwJO5qtquTM2SwCc24Wn01RSQe3ruK3qpZ0e6TjNO3/xzOmpgEYSa Loof/vuzy+nEYs8MHhRnSqKWnQ+pFeZXjZ6PRTfyfHAX6s52P5cCkIP6+qg3IkvMjvF9Aa39b1k NtJ+5wqbJwZYN7Fd8DFO0s4+e1Ic/xRfMF1NBmVpj3d6vcRqdsfZrEMvgoOcEyWHGI/23bvrnpP nrduU+enafCTfbKJ4QuPv6NOvG3HJsSHcHLIjSlfYSkPbS4zcHE1sIiyJcIBj95Kg8xQz54MzH6 pfn2UBtFgRL7MU3TWYKx/E+HCAjSVydMx2ElrxHRV/j7uEZgGoDjM57pf/zw+v90l6yqHi1xYp7 5njD9KYPttuVeJGC6bjzFH5tR36idExQcgvNSYKfqDTbKmVSam X-Received: by 2002:a05:6000:200d:b0:439:8c72:1d8f with SMTP id ffacd0b85a97d-439c8a3d018mr1602542f8f.2.1772610302355; Tue, 03 Mar 2026 23:45:02 -0800 (PST) Received: from localhost (ip87-106-108-193.pbiaas.com. [87.106.108.193]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439c2f8c0e7sm8157690f8f.29.2026.03.03.23.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2026 23:45:01 -0800 (PST) Date: Wed, 4 Mar 2026 08:44:57 +0100 From: =?iso-8859-1?Q?G=FCnther?= Noack To: Ding Yihan Cc: Tingmao Wang , Justin Suess , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Paul Moore , Jann Horn , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+7ea2f5e9dfd468201817@syzkaller.appspotmail.com Subject: Re: [PATCH v3 1/2] landlock: Serialize TSYNC thread restriction Message-ID: <20260304.c0c2ccadbde6@gnoack.org> References: <20260226015903.3158620-1-dingyihan@uniontech.com> <20260226015903.3158620-2-dingyihan@uniontech.com> <20260303.2e4c89f9fdfe@gnoack.org> <20260303.94e335a9bdaa@gnoack.org> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Mar 04, 2026 at 10:46:39AM +0800, Ding Yihan wrote: > Hi all, >  > Thank you Justin for catching the test failure and the thorough > investigation! And thanks Günther and Tingmao for diving into the > syscall restart mechanics. >  > I've evaluated both the `while` loop approach with `task_work_run()` > and the `restart_syscall()` approach. I strongly lean towards using > `restart_syscall()` as suggested by Tingmao. >  > As Günther pointed out earlier, executing `task_work_run()` directly > deep inside the syscall context can be risky. Task works often assume > they are running at the kernel-user boundary with a specific state. > Using `restart_syscall()` safely bounces us to that boundary, processes > the works cleanly, and restarts the syscall via standard mechanisms. Agreed. I also like the restart_syscall() solution for its simplicity and use of a standard mechanism. (This code path is very unlikely (and probably unintended by the userspace programmer), so we need to protect against deadlock, but it's not a performance critical path by far. By using the more standard restart_syscall(), we have to worry about fewer corner cases (e.g. what assumptions are made by task_works about the context they get executed in). I think this robustness trumps performance tuning in this case.) > After some selftests,I will prepare the v4 patch series using `restart_syscall()`. > I will also ensure all comments are properly wrapped to 80 columns as requested > by Mickaël, and make sure to include the proper Reported-by and > Suggested-by tags for everyone's excellent input here. >  > Expect the v4 series shortly. Thanks again for the great collaboration! Thanks, I'm looking forward to the revised patch. I agree with this plan. :) –Günther