Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4192983yba; Tue, 9 Apr 2019 13:13:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLt2FssyjJT3zxAf/aSBzIBcarlnbJPsAjlExJTO9X1+VSRtoRTYmR6qlZvDguzjO2Edxh X-Received: by 2002:a17:902:bb8f:: with SMTP id m15mr39118564pls.247.1554840785729; Tue, 09 Apr 2019 13:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554840785; cv=none; d=google.com; s=arc-20160816; b=SnCdD9+TMOLVOyuiv66uaMqBFDnXIdSS75Lois79UMCjkE+EStKwWSHBj77wyACcJq fllajbe7bhcFj6zkIccb2NuJI5f1Xlexw4wofG+WDNL5+t6qkdWWABAjs+XzkxfRX8mt mYiPIBT50ija35L1zuE3wDVbuL2swaFIo5crWhYNVkrFb9L30Zp6hP9wdGOTgphyt4yD tBB8TwTB3h97sYw08ydXZN7HGLy6XMrBKql6gEOm5JiV8w5iozMltS93mYZylgljgYvM nVpnKf3JpAcBuclhwndDRgauEMcy1hW5xv+wU3tUDC0WGTwh3egy1CokY9yfWMmD7sbK 2DhA== 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=v4DOr++syvpOyQ5WqB4xQ6yyBRMGF8dYQrNeOGIDsRE=; b=YZwryqdAVvoq4nQ5iE8BjpYwlb/oSENXwfHKC82jHEM2JNueMm7C5FQ8SwsSRKQBTK XiVSmsBOI5DL9SuODiYtXjXoV4lhUUIzL+GngHIiFpi8FxiL3iF1X8Z4sX9HJkh8Jhi4 eP0oGCs+kSel0JE5vx6wbcsvopHmrXPQl0zcjk8rPf5pJLHsOkuq/PPm/1eOIhUcVD/U usxdWkWRDlBpyXYOqNa0HDeSj9NWmaVrCZeZHNmbavXPHGUPjB48/LfTj3C6grQ0ujJj T4ucQDRxKRjP8qQE49rpXAVm/4EfN+u7A0F27gAEo569vGbv/2ODMalM8isvKhz+Aqdg SiuQ== 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 78si29392759pga.566.2019.04.09.13.12.50; Tue, 09 Apr 2019 13:13:05 -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 S1726699AbfDIUMC (ORCPT + 99 others); Tue, 9 Apr 2019 16:12:02 -0400 Received: from namei.org ([65.99.196.166]:32992 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbfDIUMC (ORCPT ); Tue, 9 Apr 2019 16:12:02 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id x39KBwBR007797; Tue, 9 Apr 2019 20:11:58 GMT Date: Wed, 10 Apr 2019 06:11:58 +1000 (AEST) From: James Morris To: Kees Cook cc: David Rheinsberg , John Johansen , "Serge E. Hallyn" , linux-security-module , LKML , John Johansen 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? Actually, JJ usually submits directly to Linus. -- James Morris