Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3325406rwa; Tue, 23 Aug 2022 02:53:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR4+NCRBplyWBRM0AYhiKNb947LhfAPiSqCYvp+bF9QC9pSyN1fJaHfwxl0B7SYB9tMVPMxA X-Received: by 2002:a05:6402:26c6:b0:446:b4aa:5d00 with SMTP id x6-20020a05640226c600b00446b4aa5d00mr3018386edd.63.1661248403000; Tue, 23 Aug 2022 02:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248402; cv=none; d=google.com; s=arc-20160816; b=A6rOqiMWjh70YQbDIPRiCxW0Tx/8QpAsVJEv8sr3Ruk5kVU8SMvKABBDf2X2JdTcx7 3wz/+VBBAjq5iJ+rJz802tnPyAE+TduhseA057Lu462TXp8140RajF7zMRL1dImJlLkf fG6jbyH1L3hKJoTpLpgmIQmSnp4jftRKihQg0nHgVkkc0RupOLCOdCBsSZeCwHvYYjWn romB5JJhmroJ2RCPJtF07EfKF8ZxiWhCCt8g5Tu658ZnpCH0wt7ehPn9inWbRcR5WJ1g JqGcD/0knDUBxWF2wfsAupOO1GTmVO1sZxYeRm3fRjjiEMXWMWb0r/yiO8PjsZe+lmkd eVoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RaSuFxVQnOuBzt9pKDOMRSTmmn3YDZmkdZTOnHRs2Xs=; b=maKoS1vZiF++QUhqaPnEqe1eViz3Ua0hT+eyVCBnJVvDPr3TeHuJ99DwmXaCg8sdQ6 Zu1/pDsI9mOFAGEG0r52ltOi5/oH1OVV5yXSh4reNMgL4EUr836uaCDec5HtTuCjaXC6 +xuizFXS0FGMyOlzwswt6K3f6SBLCvc9Eo4yEmzlpJxWr4esOQlQV/hIfqPjXUyqRXgm HoEtZcw/MMGZKcncSBeBYEOXgsP6ZOKmr5sKz4EXZeA9ieMbcyma+Z76Md7FuASg5xJ5 p/8jydYPgaFXHkmjFmuofzb/Sc7N06xmYNG9bqU7oGDjCWQ/33YQko7aocOYtf5FvV6x u+xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XGeelUsh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr2-20020a170907720200b0072eece129bdsi11754089ejc.59.2022.08.23.02.52.57; Tue, 23 Aug 2022 02:53:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XGeelUsh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242165AbiHWIMm (ORCPT + 99 others); Tue, 23 Aug 2022 04:12:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241902AbiHWIJ7 (ORCPT ); Tue, 23 Aug 2022 04:09:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73EA766A60; Tue, 23 Aug 2022 01:06:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EF05C611DD; Tue, 23 Aug 2022 08:06:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01527C433D6; Tue, 23 Aug 2022 08:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242000; bh=pq5jl0liAQqHiKcuVEOGf6QiN0IET6PLiMh34kv50FY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XGeelUshXeID6gN2scK4xCghVQ3TiTPbKTAkWxwXGVTxezsseImXFEB4whIu7ajOw bsDX2dcvH/Wj87dnQJVEfdo31o+pxl3yOWVZoyI4o0CQqhvcr5zdaqKiDh//oD5RPH 7gxEx3zNeAoWySeyd7FENKoNSaOTPtHeukofBndw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Johansen Subject: [PATCH 5.19 043/365] apparmor: Fix failed mount permission check error message Date: Tue, 23 Aug 2022 09:59:04 +0200 Message-Id: <20220823080119.976579673@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Johansen commit ec240b5905bbb09a03dccffee03062cf39e38dc2 upstream. When the mount check fails due to a permission check failure instead of explicitly at one of the subcomponent checks, AppArmor is reporting a failure in the flags match. However this is not true and AppArmor can not attribute the error at this point to any particular component, and should only indicate the mount failed due to missing permissions. Fixes: 2ea3ffb7782a ("apparmor: add mount mediation") Signed-off-by: John Johansen Signed-off-by: Greg Kroah-Hartman --- security/apparmor/mount.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/security/apparmor/mount.c +++ b/security/apparmor/mount.c @@ -229,7 +229,8 @@ static const char * const mnt_info_table "failed srcname match", "failed type match", "failed flags match", - "failed data match" + "failed data match", + "failed perms check" }; /* @@ -284,8 +285,8 @@ static int do_match_mnt(struct aa_dfa *d return 0; } - /* failed at end of flags match */ - return 4; + /* failed at perms check, don't confuse with flags match */ + return 6; }