Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4192450yba; Tue, 9 Apr 2019 13:12:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+866+pAckLc1EmXWIwmjz/NpejFuAjy2YP/qKDk1cZGDwp70M8R6x3JdU+2u2HhfXSDGb X-Received: by 2002:a62:be13:: with SMTP id l19mr38499638pff.137.1554840745071; Tue, 09 Apr 2019 13:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554840745; cv=none; d=google.com; s=arc-20160816; b=zXydHDXLOj2S6RPtclJYnCtUjp17tQrn029p3ecO7XzqPcg665fzVeZBVHzPHKPrpW H40afHwWqWKnaAk6WlMdIsNTebre2/yt2QU345Ql/kb5n9rdtZwFwARQY0ElCMAcqFbU VifOGv2cI3f1RCqsjDOLJVqmsnXEf0vhyLQGW04bVNte1k+UbclytY7CpkYtFAtHUE11 +9S3aB4Q9KEsiqkwOgHMsh+HWBXZ8dv4oi0m9J1rXURvyhNQOPzANQR7gPtYScxKq3VV qA1mYZ0Gne6G8ELm+tv4gvcN4dyet9iz22GpnxqzkHizu0x5EF1t/gm0/8qclvKEq0Aq 9fOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=SA35K4iNNLSVS1qrsMs0DyDwWk/Mxyk+eWUfPfmYyVc=; b=RPu8QY6FtuYfuWdXQEq6K1843hSUsIkXiIGejfKDwJ0iRxYnlD/FflZiUBfo7hnmIk yFP1blR11IPKoNOTJygBm27cgmEsplVZ4JcCX5pIHgiKhhOvAT3HPEJ62Fk3BqMfqavF laF2n95tfqM2qgpW5tfVOQ7Ue7mv2e9Bjls29rovVJKncDCqo+yIimqBc71pRLOiyVa2 +0atIjMIzx1gE/GMjXYf4+RRVvxQjUC4S2xaFYrni+LxzvU9X0XFYib7Ms7k2j1jQg3l G6OkoQzgdV04FLuRf2CR16NYBMNqnwzy44sGK89DRZ2Z78z7N4rYwzUTnyWLzzilZI76 FAOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b23si27971500pgm.517.2019.04.09.13.12.09; Tue, 09 Apr 2019 13:12:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbfDIULc (ORCPT + 99 others); Tue, 9 Apr 2019 16:11:32 -0400 Received: from namei.org ([65.99.196.166]:32978 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbfDIULc (ORCPT ); Tue, 9 Apr 2019 16:11:32 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id x39KBJA2007756; Tue, 9 Apr 2019 20:11:19 GMT Date: Wed, 10 Apr 2019 06:11:19 +1000 (AEST) From: James Morris To: Kees Cook cc: David Rheinsberg , John Johansen , "Serge E. Hallyn" , linux-security-module , LKML Subject: Re: [PATCH] apparmor: Restore Y/N in /sys for apparmor's "enabled" In-Reply-To: Message-ID: References: <20190408160706.GA18786@beast> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 9 Apr 2019, Kees Cook wrote: > On Mon, Apr 8, 2019 at 11:21 PM David Rheinsberg > wrote: > > > > Hi > > > > On Mon, Apr 8, 2019 at 6:07 PM Kees Cook wrote: > > > > > > Before commit c5459b829b71 ("LSM: Plumb visibility into optional "enabled" > > > state"), /sys/module/apparmor/parameters/enabled would show "Y" or "N" > > > since it was using the "bool" handler. After being changed to "int", > > > this switched to "1" or "0", breaking the userspace AppArmor detection > > > of dbus-broker. This restores the Y/N output while keeping the LSM > > > infrastructure happy. > > > > > > Before: > > > $ cat /sys/module/apparmor/parameters/enabled > > > 1 > > > > > > After: > > > $ cat /sys/module/apparmor/parameters/enabled > > > Y > > > > > > Reported-by: David Rheinsberg > > > Link: https://lkml.kernel.org/r/CADyDSO6k8vYb1eryT4g6+EHrLCvb68GAbHVWuULkYjcZcYNhhw@mail.gmail.com > > > Fixes: c5459b829b71 ("LSM: Plumb visibility into optional "enabled" state") > > > Signed-off-by: Kees Cook > > > --- > > > This fix, if John is okay with it, is needed in v5.1 to correct the > > > userspace regression reported by David. > > > --- > > > security/apparmor/lsm.c | 49 ++++++++++++++++++++++++++++++++++++++++- > > > 1 file changed, 48 insertions(+), 1 deletion(-) > > > > This looks good to me. Thanks a lot! If this makes v5.1, I will leave > > the apparmor-detection in dbus-broker as it is, unless someone asks me > > to parse 0/1 as well? > > > > I cannot judge whether the apparmor_initialized check is correct, but > > for the parameter parsing: > > > > Reviewed-by: David Rheinsberg > > Thanks! > > James, are you able to take this for v5.1 fixes? Sure. -- James Morris