Received: by 10.223.185.116 with SMTP id b49csp675772wrg; Tue, 20 Feb 2018 06:07:51 -0800 (PST) X-Google-Smtp-Source: AH8x226iJiT+NPdIM0cB3YGIFKkvvejSkN1hQDrnCQl43LAeVvdyx+0t9+C4rKEO8mYHjrABg9nU X-Received: by 10.99.125.19 with SMTP id y19mr11533377pgc.285.1519135671436; Tue, 20 Feb 2018 06:07:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519135671; cv=none; d=google.com; s=arc-20160816; b=U+vfBjI7Hmy6vobS+0AqnJcn2ZLUIwM6++QbG4nhYe/q6DVOA4cBlhPEXsDl2U/swH ka+I/J5SZBbcKGqT8msDwTxRPisIViZ4VrePKiXntAnn0TLmUGk2XeRgyvs+km9tIwjJ FHVe+IwTvSBHHqaHRLOrnxlhNmD3mIGuIwxbIvwH2fADOnkow3UmLIHA+j8xGH5ehAoE lawMOaUM9jOzCYu0pBLDrbMHd3yuCDezaO3y2hoS27BDXnzgtEd7W+lJlD3sNaBd+pli /5doV3Vy8XnaLluBdiMg7gLknu54BeahdJ7BXmjeiXIRVaMIsgOMox6jTE+r5pccSXFq sHVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=cOlBAcYslFrqTFt+c/zQXK+N4TiEvJVaZuQBUP7k9KA=; b=RSPeNGwWnOccK2oW3HktujBYY2tc+eaOTYwIi1WLNP64z78sb73aiwMSiR6YyfQNXP BLS4/72W9APXILqYQmLcSEiV9R2VgRclM0iZ/y6xRVPesOykJwGLeM+RH5pvUtgeY8Ye 53pRNKkuXZWYuamnN1KV86ns8jzMTAG2X1EkVRFf6Lnleu5h9MgHkjXnkGuy7D7T40FP 3dbcdxkS3deYgJeKSg9BMAxl4FbTJWqPll++4Gr+2uLQ322bE8+PNiDOCbnGWe/6Y51q sKjsBZ0qhod8M6EF42Ff1VwwVK80rqBSzEUUVh6lzx0ffbyHPhHrBY3dLPsQXuYZgOg8 aN1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=FTSbX7KK; 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 c26si5694286pgf.423.2018.02.20.06.07.35; Tue, 20 Feb 2018 06:07:51 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=FTSbX7KK; 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 S1751343AbeBTOGv (ORCPT + 99 others); Tue, 20 Feb 2018 09:06:51 -0500 Received: from merlin.infradead.org ([205.233.59.134]:56092 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750799AbeBTOGt (ORCPT ); Tue, 20 Feb 2018 09:06:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=cOlBAcYslFrqTFt+c/zQXK+N4TiEvJVaZuQBUP7k9KA=; b=FTSbX7KKp+boS404P11dPXqhM DhO+AOojEBqlN9sX+9DexHW/QqtelVW+osUXYjjspI9b8V5EmDmVgsDWCI10GUkbQgFKN61aK3UW3 u84cybjyo64Jf4/xZqycGTOTyvt64b7cCF+DmCFea/DAqYsaKU3ox0/vTguzCgwiczTCj79PJx0Xl pJdXOu3qgMnHFbf7vxHWV+XX4QR+/H5+EUbGAxF84EKw0bzkle9QPcIm6pT9KP1mVnYG4TvsJ5+Z1 KzviED3mv+54hcnT/y82CHpIIwR7J9EvLbnIsYpH1+TfOLmSz7TwXQ3Vd80WNIpzUuBAUoXalIwQL 2e7LdN5aw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1eo8Z8-00005u-8u; Tue, 20 Feb 2018 14:06:42 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id AF5FC2038D7BC; Tue, 20 Feb 2018 15:06:40 +0100 (CET) Date: Tue, 20 Feb 2018 15:06:40 +0100 From: Peter Zijlstra To: Paul Moore Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Dmitry Vyukov , linux-audit@redhat.com Subject: Re: [PATCH 4.10 070/111] audit: fix auditd/kernel connection state tracking Message-ID: <20180220140640.GE25201@hirez.programming.kicks-ass.net> References: <20170328122915.640228468@linuxfoundation.org> <20170328122918.597715642@linuxfoundation.org> <20180220123757.GE25314@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 20, 2018 at 08:25:21AM -0500, Paul Moore wrote: > On Tue, Feb 20, 2018 at 7:37 AM, Peter Zijlstra wrote: > > On Tue, Mar 28, 2017 at 02:30:56PM +0200, Greg Kroah-Hartman wrote: > >> 4.10-stable review patch. If anyone has any objections, please let me know. > > > >> + if (!(auditd_test_task(current) || > >> + (current == __mutex_owner(&audit_cmd_mutex)))) { > >> + long stime = audit_backlog_wait_time; > > > > Since I cannot find the original email on lkml, NAK on this. > > __mutex_owner() is not a general purpose helper function. > > Since this code also exists in the current kernel, I need to ask what > recommended alternatives exist for determining the mutex owner? > > I imagine we could track the mutex owner separately in the audit > subsystem, but I'd much prefer to leverage an existing mechanism if > possible. It's not at all clear to me what that code does, I just stumbled upon __mutex_owner() outside of the mutex code itself and went WTF. The comment (aside from having the most horribly style) is wrong too, because it claims it will not block when we hold that lock, while, afaict, it will in fact do just that. Maybe if you could explain how that code is supposed to work and why it doesn't know if it holds a lock I could make a suggestion...