From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9806DC4360C for ; Sun, 6 Oct 2019 10:19:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6AA2E2084B for ; Sun, 6 Oct 2019 10:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570357193; bh=eRkf44setEkcKMyuD4Ryf9Y/ZzshmK7SrlcSOvIvpHw=; h=Subject:To:Cc:From:Date:List-ID:From; b=Os/Yg71CKHGIcQ8OINmfjIUATvNy8U929K6SWie25eXEpxcRUF1wbvxcaP2naurGM 7+zoAuuCefeqeXJsAN41sp/6KlTVvvakSc+rYlPwl0tAcy023QfF8vagkITqiFFNa8 n36yXWw3qUoG65NOWjHccS45RnX8aWGcxLmPIF5I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726248AbfJFKTw (ORCPT ); Sun, 6 Oct 2019 06:19:52 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:39799 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbfJFKTw (ORCPT ); Sun, 6 Oct 2019 06:19:52 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 830BA20CB2; Sun, 6 Oct 2019 06:19:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 06 Oct 2019 06:19:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=ladBD/ dcraNLTZW85m6P2C8YePcHzvQDPpJmVC4Of10=; b=tZdH9KCHDXzC6uJ2gWT0wy lpbMKJjZWF5w6rKZP2KT0sGv1iIuzh+0aal++CcMhU33y1hu8tUXPwgdAsgBDgY6 TcTLstVY6XaZKj8vxluxlG3DLo8CTLx7oovJDnE+KwMCLWI9Uil8RMgj/CwM0seK 3KV+t6rVjfZLu+iwsUGshrxSvkYaRNlvP71MGGNGG1BEgMLXBtz8rWC6xj7HylUv TjVqDGTtO3QrFdPCzP9uRBjpdDJtB6JARTPJpmDKz5QEEvjYPRyucF7d1jVS8nPA 4TpIUDwp861xfx7f4eQ+m4EIc18rKFgWMVKjlism/4WwpM8UE9UbBSlGl7OY9p7w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrheehgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 9DD198005C; Sun, 6 Oct 2019 06:19:50 -0400 (EDT) Subject: FAILED: patch "[PATCH] ovl: filter of trusted xattr results in audit" failed to apply to 3.18-stable tree To: salyzyn@android.com, mszeredi@redhat.com Cc: From: Date: Sun, 06 Oct 2019 12:19:49 +0200 Message-ID: <1570357189135205@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 3.18-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 . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 5c2e9f346b815841f9bed6029ebcb06415caf640 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Thu, 29 Aug 2019 11:30:14 -0700 Subject: [PATCH] ovl: filter of trusted xattr results in audit When filtering xattr list for reading, presence of trusted xattr results in a security audit log. However, if there is other content no errno will be set, and if there isn't, the errno will be -ENODATA and not -EPERM as is usually associated with a lack of capability. The check does not block the request to list the xattrs present. Switch to ns_capable_noaudit to reflect a more appropriate check. Signed-off-by: Mark Salyzyn Cc: linux-security-module@vger.kernel.org Cc: kernel-team@android.com Cc: stable@vger.kernel.org # v3.18+ Fixes: a082c6f680da ("ovl: filter trusted xattr for non-admin") Signed-off-by: Miklos Szeredi diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 7663aeb85fa3..bc14781886bf 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -383,7 +383,8 @@ static bool ovl_can_list(const char *s) return true; /* Never list trusted.overlay, list other trusted for superuser only */ - return !ovl_is_private_xattr(s) && capable(CAP_SYS_ADMIN); + return !ovl_is_private_xattr(s) && + ns_capable_noaudit(&init_user_ns, CAP_SYS_ADMIN); } ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size)