From patchwork Thu Jul 6 20:45:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 1804498 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=dvaZvjyR; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QxpTr4TTgz20bY for ; Fri, 7 Jul 2023 06:46:24 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qHVro-0001WK-74; Thu, 06 Jul 2023 20:46:20 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qHVrl-0001VL-Pc for kernel-team@lists.ubuntu.com; Thu, 06 Jul 2023 20:46:17 +0000 Received: from localhost.localdomain (1.general.cascardo.us.vpn [10.172.70.58]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id CAA4C4214C for ; Thu, 6 Jul 2023 20:46:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1688676377; bh=k5A27HufYbPRG+B6usuU8pPiZE/0S8xxS7cQyWZn3PA=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dvaZvjyRn/RwuTdBTUrgPHwXu3juBPVsA+tvaJVxabx/VzeacDzy5TA0qrcgcup8Q LsgwQ9ryOWqTrcOmjf/Uc0f1z4Vx8geX4/TTp4+Q9Hachb1gZ3xAxX8QtwmmcWfDoJ eoGyEqNNJ2dxhkSEvRO9UAfGX/IHXN6hGjRpSPKx2KhvOukhNk/B64K9elkwJYW6qH G/OKeC6QC5gJ2fHzkTTlblFjkgC5lE7Zsdhu7YFCtifqwsIT1YvwF7sb63MlLXaTOq I4T37TS4cNlDi879qsZ8L3nQJ4iGiRtOvxFS0c+DpGzHtGtsfL80D6xCu1GP2K3J7O /h0QwYTHYbepg== From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [SRU Kinetic, Lunar, OEM-6.1 1/3] Revert "UBUNTU: SAUCE: overlayfs: handle idmapped mounts in ovl_do_(set|remove)xattr" Date: Thu, 6 Jul 2023 17:45:14 -0300 Message-Id: <20230706204517.1071559-2-cascardo@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230706204517.1071559-1-cascardo@canonical.com> References: <20230706204517.1071559-1-cascardo@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" This reverts commit 520b4713f66b758048d921b73b2c9250d4c2a474. This is needed in order to revert "UBUNTU: SAUCE: overlayfs: Skip permission checking for trusted.overlayfs.* xattrs". CVE-2023-2640 CVE-2023-32629 Signed-off-by: Thadeu Lima de Souza Cascardo --- fs/overlayfs/overlayfs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h index 3a85be75d64a..e523d600da4e 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h @@ -255,7 +255,7 @@ static inline int ovl_do_setxattr(struct ovl_fs *ofs, struct dentry *dentry, int err; inode_lock(inode); - err = __vfs_setxattr_noperm(ovl_upper_mnt_userns(ofs), dentry, name, value, size, flags); + err = __vfs_setxattr_noperm(&init_user_ns, dentry, name, value, size, flags); inode_unlock(inode); pr_debug("setxattr(%pd2, \"%s\", \"%*pE\", %zu, %d) = %i\n", @@ -277,7 +277,7 @@ static inline int ovl_do_removexattr(struct ovl_fs *ofs, struct dentry *dentry, int err; inode_lock(inode); - err = __vfs_removexattr_noperm(ovl_upper_mnt_userns(ofs), dentry, name); + err = __vfs_removexattr_noperm(&init_user_ns, dentry, name); inode_unlock(inode); pr_debug("removexattr(%pd2, \"%s\") = %i\n", dentry, name, err);