From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796221174; b=jFeKg701fPZOKQrGnzNmlx2mqbcI6iCGIQ8syNRc8KnPtT/cIr8SvjBxjbxYhqAnX/ZN qUfBg3ALhb8yyDLjQpUD6N8RLCWvpE6sRfxieVaLWGkFpxAgDsYY9/3iOiVvKawtcbWh7 V4cELqJ6PzqevWjCTz6SzcPkYPwQnuQpHDapamsvgjY7jKFY1IzclYxdYxa7zqa92aH8k cojojRz09/oFV8nbdNQE2QkZelVRQupVip4gwwuy3q//4eBC88eH/6t9Pj55+WAqqPqk5 QA9OmHhMHIhBb0IhBcSjWV4/yKsjJKV4G1KW7mkMg/T1fDOf4zLaQV3igy0e0scjBDA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796221174; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=dV9n33BTo2vtEv0PEA6/kra4HsNtLxD6kY8UTG4WP8c=; b=ot1WeaCWQ38dTeTSv3CFc8s1LFOiea/3VzTRJCmpQjUTIbV0YaoFl/5P7GRgo69/yTTl fpvb8Cz161oLNMJ2vrLjZB3Fan95UExy77wDumyTk4+bLJqg79Fmol7BH6rKNlJ1+nvvc cdbazx0gw0l5YAKgT5LIuuZA2BfN82iVs4skkkNi5ms+riZIsOi1BLAch7h13lfTjc5mt k529DnfPyKU3MVdWmgbMJF3DrkPcwqhOEpmALIBZo2+pSfnPLxBZv/RGTGI2XRZG2kqEP dj8qU9YIgPg8YVZJhCixrp6cJUJJqLpuxJQRYeRMHhWDARMwMA1aRZliYLx0Re8ewhA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=X3aSyGmJ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F2C6606A31A for ; Wed, 2 Dec 2026 14:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=X3aSyGmJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7205B1F00896; Wed, 2 Dec 2026 14:19:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796221174; bh=dV9n33BTo2vtEv0PEA6/kra4HsNtLxD6kY8UTG4WP8c=; h=Subject:To:Cc:From:Date; b=X3aSyGmJVbuZUZuQ6bY6NDl3RE5qT8Pzl+RXjqlsjCO60jc4rmrj6y6jMLhmCxvqe 9HmWDPvueFM5z/oOcPf+k+k7XrtdWTg+OruEna3mDng2c3uoIkVK5IZeGiHPkb5W4l nPexCidEdRuf4ij7uL02TNcYWXx5H67vXMZKkar4= Subject: FAILED: patch "[PATCH] landlock: Fix layer composition of LANDLOCK_ACCESS_FS_REFER" failed to apply to 6.12-stable tree To: gnoack3000@gmail.com,me@dw1.io,mic@digikod.net Cc: From: Date: Wed, 02 Dec 2026 14:12:48 +0100 Message-ID: <2026120247-unbitten-unfair-1357@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y git checkout FETCH_HEAD git cherry-pick -x 0ad8ea7fa7dc0f0d0e45f7ed4933d5433dac4291 # git commit -s git send-email --to '' --in-reply-to '2026120247-unbitten-unfair-1357@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 0ad8ea7fa7dc0f0d0e45f7ed4933d5433dac4291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Noack?= Date: Fri, 13 Nov 2026 21:23:23 +0100 Subject: [PATCH] landlock: Fix layer composition of LANDLOCK_ACCESS_FS_REFER MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In landlock_get_fs_access_mask(), only add the LANDLOCK_ACCESS_FS_REFER right if any filesystem access rights are handled at all. This prevents us from accidentally treating non-filesystem layers as if they handled LANDLOCK_ACCESS_FS_REFER. landlock_get_fs_access_mask() is used when initializing the layer masks for doing access right checks, so this bug meant that we unintentionally denied "refer" (e.g., link, rename) operations in layered cases, where the same operation would have been accepted if only either one of the two layers had been enforced. If the rulesets individually allow an operation, the composition of these rulesets should also allow it. The bug only manifests as soon as one other layer handles filesystem access rights. Otherwise, Landlock filesystem path walk is guarded by an early exit for the case that no filesystem-enforcing layer exists. Reported-by: Dwi Siswanto Closes: https://github.com/landlock-lsm/linux/issues/67 Closes: https://github.com/landlock-lsm/go-landlock/issues/66 Fixes: fff69fb03dde ("landlock: Support network rules with TCP bind and connect") Cc: stable@vger.kernel.org Signed-off-by: Günther Noack Link: https://patch.msgid.link/20261113-b4-landlock-refer-nonfs-layer-v3-1-02d7e42bcdfd@gmail.com Signed-off-by: Mickaël Salaün diff --git a/security/landlock/domain.h b/security/landlock/domain.h index 935e18b12b3c..d9ebf4857fce 100644 --- a/security/landlock/domain.h +++ b/security/landlock/domain.h @@ -262,9 +262,16 @@ static inline access_mask_t landlock_get_fs_access_mask(const struct landlock_domain *const domain, const u16 layer_level) { - /* Handles all initially denied by default access rights. */ - return domain->layers[layer_level].handled.fs | - _LANDLOCK_ACCESS_FS_INITIALLY_DENIED; + access_mask_t handled = domain->layers[layer_level].handled.fs; + + /* + * Handles all initially denied by default access rights, but only for + * layers handling filesystem accesses. + */ + if (handled) + handled |= _LANDLOCK_ACCESS_FS_INITIALLY_DENIED; + + return handled; } static inline access_mask_t diff --git a/security/landlock/errata/abi-4.h b/security/landlock/errata/abi-4.h index fe11ec7d7ddf..9784ca645073 100644 --- a/security/landlock/errata/abi-4.h +++ b/security/landlock/errata/abi-4.h @@ -20,3 +20,24 @@ * that rely on these protocols while using Landlock network restrictions. */ LANDLOCK_ERRATUM(1) + +/** + * DOC: erratum_5 + * + * Erratum 5: Denial of ``LANDLOCK_ACCESS_FS_REFER`` in layered domains + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This fix addresses an issue where ``LANDLOCK_ACCESS_FS_REFER`` was implicitly + * handled in domain layers that handle no filesystem access rights. + * + * With this fix, a reparenting operation is allowed in a layered Landlock + * domain if and only if each layer, enforced on its own, would allow it. + * + * Impact: + * + * In kernels without this fix, if a domain combined a layer that handles + * filesystem access rights with a layer that doesn't, the resulting layered + * domain would deny all ``LANDLOCK_ACCESS_FS_REFER`` operations, even when the + * filesystem layer granted these operations with a rule. + */ +LANDLOCK_ERRATUM(5)