From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout04.his.huawei.com (canpmsgout04.his.huawei.com [113.46.200.219]) (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 D18C93DF008; Fri, 26 Jun 2026 07:22:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.219 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782458544; cv=none; b=n6vZWUsa6zZN6J+d/877Q/RcG+JFjNXaIY6F24B1nzlO1ocPux8S7lCm56Ir6RpM8C+TqPFq1BsfV84bd5uIWFNnRGxM/iJI1WG8raqyB6Gy5SL3W0CJl/T3BFdHEYOxcN8bIe7056/gvz5SPJDu9xaUjFPCmRqv2fAZloV6QHU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782458544; c=relaxed/simple; bh=3bUDTGUuBPkouAcaf6j/ke2Rt4TVx2uL1+k4d7AqZtY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=RXduIYWa/K1hrX1tgXCpv0b6TtUMUvmt9sRHeieURBUAg/PezL5s+8fjGGi0a3Rc25A9W8eZyT1YpEKUYtl4w0Lb85mStp99oGJe9vO/edk2HgJUZrYw7ltpxjYCMY1iH3qt/i+yFsHHRiQiaaADl7KvQdqapi19zc2feJ6Ok7E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=Tv7pTf4E; arc=none smtp.client-ip=113.46.200.219 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="Tv7pTf4E" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=izqAsj70qZfNF1O/YzvFj7uUN5J/lCj7ZHpgxS9ZCVA=; b=Tv7pTf4Ets2kpKcaYLiW3eenpr4XZrE3LHw7uKECF9M+l+KdDPHIVNtzi08S1wJviPUf6N24e TcHh1WU1gvpiZ5/lX8ZXf7HpyR3W5DjgrCGnZGSvhxDDWu4hDnXjeJQ2iHWzKmuwP0k9fFLFHRO NjHaR5J2ir1Xn9Bub70lCZs= Received: from mail.maildlp.com (unknown [172.19.163.0]) by canpmsgout04.his.huawei.com (SkyGuard) with ESMTPS id 4gmn293jPlz1prL8; Fri, 26 Jun 2026 15:13:05 +0800 (CST) Received: from dggemv705-chm.china.huawei.com (unknown [10.3.19.32]) by mail.maildlp.com (Postfix) with ESMTPS id 0C8D840537; Fri, 26 Jun 2026 15:22:14 +0800 (CST) Received: from kwepemq200017.china.huawei.com (7.202.195.228) by dggemv705-chm.china.huawei.com (10.3.19.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 26 Jun 2026 15:22:13 +0800 Received: from octopus.huawei.com (10.67.174.191) by kwepemq200017.china.huawei.com (7.202.195.228) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 26 Jun 2026 15:22:13 +0800 From: Cai Xinchen To: , , , , , , , , , , , , CC: , , , , , , , Subject: [PATCH v2 stable/linux-6.18.y 0/2] Backport Fix incorrect overlayfs mmap() and mprotect() LSM access controls Date: Fri, 26 Jun 2026 15:50:33 +0800 Message-ID: <20260626075035.143419-1-caixinchen1@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemq200017.china.huawei.com (7.202.195.228) v2: Add static to struct kmem_cache *lsm_backing_file_cache; and define lbs_backing_file as int for keeping the same type as 6.18. Backport the patch series "Fix incorrect overlayfs mmap() and mprotect() LSM access controls" [1] to 6.18 lts I test selinux-testsuite[2] overlay test, it pass 135 tests. [1] https://lore.kernel.org/all/20260403030848.731867-5-paul@paul-moore.com/ [2] https://github.com/SELinuxProject/selinux-testsuite Paul Moore (2): lsm: add backing_file LSM hooks selinux: fix overlayfs mmap() and mprotect() access checks fs/backing-file.c | 17 ++- fs/file_table.c | 27 +++- fs/fuse/passthrough.c | 2 +- fs/internal.h | 3 +- fs/overlayfs/dir.c | 2 +- fs/overlayfs/file.c | 2 +- include/linux/backing-file.h | 4 +- include/linux/fs.h | 13 ++ include/linux/lsm_audit.h | 2 +- include/linux/lsm_hook_defs.h | 5 + include/linux/lsm_hooks.h | 1 + include/linux/security.h | 22 +++ security/security.c | 109 ++++++++++++++ security/selinux/hooks.c | 242 ++++++++++++++++++++++-------- security/selinux/include/objsec.h | 11 ++ 15 files changed, 383 insertions(+), 79 deletions(-) -- 2.18.0.huawei.25