From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755090AbbCCAmb (ORCPT ); Mon, 2 Mar 2015 19:42:31 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:46470 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754988AbbCCAm3 (ORCPT ); Mon, 2 Mar 2015 19:42:29 -0500 Date: Mon, 2 Mar 2015 16:42:28 -0800 From: Andrew Morton To: Jeff Vander Stoep Cc: nnk@google.com, Sasha Levin , "Paul E. McKenney" , Rik van Riel , Vlastimil Babka , Paul Cassella , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: reorder can_do_mlock to fix audit denial Message-Id: <20150302164228.4de418951c7d17b7e315d52f@linux-foundation.org> In-Reply-To: <1425316867-6104-1-git-send-email-jeffv@google.com> References: <1425316867-6104-1-git-send-email-jeffv@google.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 Mar 2015 09:20:32 -0800 Jeff Vander Stoep wrote: > A userspace call to mmap(MAP_LOCKED) may result in the successful > locking of memory while also producing a confusing audit log denial. > can_do_mlock checks capable and rlimit. If either of these return > positive can_do_mlock returns true. The capable check leads to an LSM > hook used by apparmour and selinux which produce the audit denial. > Reordering so rlimit is checked first eliminates the denial on success, > only recording a denial when the lock is unsuccessful as a result of > the denial. I'm assuming that this is a minor issue - a bogus audit log, no other consequences. And based on this I queued the patch for 4.0 with no -stable backport. All of this might have been wrong - the changelog wasn't very helpful in making such decisions (hint).