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=1796221389; b=wRB7FioA574MQywdpGkMX7ZQUmXdoiU9B965b9kZcA9yvrTbHx8fnNQVXmZAE8Lu3Q5C scOygZBJXGApVaUGdEwi6AflSIM9AaSFLjbjR6lJ4rKej5zETZrh5iEB6H1/JAKWPMhGi rZh0qcBG2W/3aQE6vYy15DZu37WtemR7o3aIdDWw/m+yNZL+I6I41raJL3a7eIJmiy8hH tKyfErB6Gvuq1UZYvMDebnEedV/u4Wg3nP/1nc18aYkZWDU0Dz6IY+0+TEcwZSDbw4p6R kLOhehiYHWh4H9KyCWcsPwt7Yzgi1wgfS6RsP4dw+MRTB92oreMqwlbw0MaMRK9bsDw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796221389; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=GBmgUULiPF5/EVOxEB43G+J6sEtImcbaXhqXkibrRJA=; b=mCNcBuhoKo28YWGKbE95fAzsoKcdhZdFggQeShUr+oQyOm/DFOcwI47heSq/0LALBtD9 fO5zrn1X5eCHrbbH+iirSYwCN8kiJuDpVawXc6u+0RIJ7QCWmFE498V2YsAaGgKASRoTg xGX5jENXWlKDyEuB5ZRcWuggTswV5UpEGeHyJ9HIEU9eUAhbubQAcm8VcgkgxCQTj9FRN 42OXpcgDKt65RtjCWS0jW4aAaD0Qk0hHxrCbQbGKNB3Prrts7+bxDAOyQm4sjeBtFrU7z Ppi1yYk1vlW0UfvG1IfViP2HBkFMUQHz8dzKdVxSrgIAOLKri/Jvh3ec36bNA2KLLRA== 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=im5fCbMP; 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 4FAEB606A327 for ; Wed, 2 Dec 2026 14:23:09 +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=im5fCbMP Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50F391F00897; Wed, 2 Dec 2026 14:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796221388; bh=GBmgUULiPF5/EVOxEB43G+J6sEtImcbaXhqXkibrRJA=; h=Subject:To:Cc:From:Date; b=im5fCbMPVQZoupwh8wEeA4gJ+F2oZbzq1R2dtn2NGBsMhCwF+jlJoyXkXdJDLdEZq M2mJrRPsoGAzvpYXvB5MXDkphizYYxBCYWs0L9Rdhtwer3rd6qop1elVsXsxOl3Sq9 bmIlfShtde7JdeyPounJHJeOdzoPNpT0qtg8V0vc= Subject: FAILED: patch "[PATCH] selinux: check MAP_SHARED_VALIDATE mappings as shared" failed to apply to 6.1-stable tree To: stephen.smalley.work@gmail.com,paul@paul-moore.com Cc: From: Date: Wed, 02 Dec 2026 14:44:58 +0100 Message-ID: <2026120258-blog-astrology-e2ad@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=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-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.1.y git checkout FETCH_HEAD git cherry-pick -x beb0ae6bcd7505e2e61babe5d98a8dd3b3f03c7f # git commit -s git send-email --to '' --in-reply-to '2026120258-blog-astrology-e2ad@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From beb0ae6bcd7505e2e61babe5d98a8dd3b3f03c7f Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Fri, 6 Nov 2026 13:29:13 -0500 Subject: [PATCH] selinux: check MAP_SHARED_VALIDATE mappings as shared selinux_mmap_file() only recognizes MAP_SHARED as a shared mapping, but MAP_SHARED_VALIDATE is also a shared mapping type. The mmap flags reach this hook before the mm code processes the mapping type. Consequently, a writable MAP_SHARED_VALIDATE mapping was failing to check the file write permission at mmap time, and a writable executable file mapping was wrongly checking process execmem permission as if it were private. Cc: stable@vger.kernel.org Link: https://github.com/SELinuxProject/selinux-kernel/issues/78 Fixes: 1c9725974074 ("mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags") Signed-off-by: Stephen Smalley Signed-off-by: Paul Moore diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 9950f89dfaa2..6c4c64d6e904 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -4179,8 +4179,11 @@ static int selinux_mmap_file(struct file *file, unsigned long reqprot __always_unused, unsigned long prot, unsigned long flags) { + const unsigned long map_type = (flags & MAP_TYPE); + return selinux_mmap_file_common(file, prot, - (flags & MAP_TYPE) == MAP_SHARED, + (map_type == MAP_SHARED || + map_type == MAP_SHARED_VALIDATE), false); }