Received: by 10.213.65.68 with SMTP id h4csp672712imn; Tue, 13 Mar 2018 17:37:22 -0700 (PDT) X-Google-Smtp-Source: AG47ELt4eOD9Pk55iKTUhag3/9m46EeimkjpBIcXz8EE+cDypnZylcTxDUIHqTL6+YxTB7C+IRfj X-Received: by 2002:a17:902:6ac2:: with SMTP id i2-v6mr2188698plt.368.1520987842349; Tue, 13 Mar 2018 17:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520987842; cv=none; d=google.com; s=arc-20160816; b=lscYbzGDCIwe1aIj9BGqvuKnflQ/lrS6dd8T2je+7nznWE3Gt4ANyUTbu78WNEadZd ExHmqbrcake2gfhVA9E7DLatB4SRyz+vEJSfeUxCUBXXl6yvfH5pyUMdJXqgEX8AFhzc uI3dJqncI7zoT1m043oZyIEmeMHNUb00teQRSU5phMxjQ/woZrMF1+2WB6Ok0igoR8QW MyUy3luZyrcVre9VHOkypDVyJZBDawRLVeMvKrCTkCPJU5wfDGfVXJRwqEJnKwKcWs37 e25RJWuOOimBPziU7GRN6W19m5aQrWQplF2ShklpWgL7HEPDKm5Sa0z+7F4jYBAguF2F 5AZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=Lrpc2+eUUxGjKpJR22Nx3uOrFbhf+JrwqMg7oWYKlaQ=; b=kjVRCEyqKWUDHCCl1E65QwqDSnQh3dN/9pnRCGHDg3UMvvAFu1DOh/h64zcoWQzEb2 hvLcxKHNBbnjvPSV5FYJpNWBMrLsJn9GGLwXHIhP8LLbLH5GL8AHJoZeulKtKJPGdncm pzmcVtxf0vyYaI2fmyLAo8WHtACHUmTo3t3lYN08U1795wxnYr+z9KSd1dybBTfgmDiH GuvOWH8Xjubb3cvVToz47Q6iqsLt2EQvpN0a6gzyuIobaIkD2Ckn/T/tJYHTLvc9dbvr Ma2X6TGL56FP46AUTvVLJFe47TiG7Uylv2Wf4H7EHMgR7x+geTTYOQF5dvS8yCsYgNW2 GfUw== 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 s13-v6si969994plp.675.2018.03.13.17.37.06; Tue, 13 Mar 2018 17:37:22 -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 S933015AbeCNAgH (ORCPT + 99 others); Tue, 13 Mar 2018 20:36:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:43454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932590AbeCNAgF (ORCPT ); Tue, 13 Mar 2018 20:36:05 -0400 Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5A62D2178D for ; Wed, 14 Mar 2018 00:36:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A62D2178D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org Received: by mail-it0-f43.google.com with SMTP id n136-v6so2387029itg.5 for ; Tue, 13 Mar 2018 17:36:05 -0700 (PDT) X-Gm-Message-State: AElRT7FNDiy7DQFDLLQxFNoLdmGN5/phdWCbw9suuOSqQ0f8z/8kfm74 z1kNxSh8pfrn02tlT9x16VuZRSWWju+pCTwKsrTOCw== X-Received: by 2002:a24:4c54:: with SMTP id a81-v6mr59795itb.55.1520987764725; Tue, 13 Mar 2018 17:36:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.137.101 with HTTP; Tue, 13 Mar 2018 17:35:44 -0700 (PDT) In-Reply-To: References: <20180310111535.2e3202bc@ivy-bridge> From: Andy Lutomirski Date: Wed, 14 Mar 2018 00:35:44 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] audit: set TIF_AUDIT_SYSCALL only if audit filter has been populated To: Jiri Kosina Cc: Andy Lutomirski , Steve Grubb , Paul Moore , linux-audit@redhat.com, Andrew Morton , Michal Hocko , Oleg Nesterov , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 14, 2018 at 12:28 AM, Jiri Kosina wrote: > On Wed, 14 Mar 2018, Andy Lutomirski wrote: > >> > Yes...I wished I was in on the beginning of this discussion. Here's the >> > problem. We need all tasks auditable unless specifically dismissed as >> > uninteresting. This would be a task,never rule. >> > >> > The way we look at it, is if it boots with audit=1, then we know auditd >> > is expected to run at some point. So, we need all tasks to stay >> > auditable. If they weren't and auditd enabled auditing, then we'd need >> > to walk the whole proctable and stab TIF_AUDIT_SYSCALL into every >> > process in the system. It was decided that this is too ugly. >> >> When was that decided? That's what this patch does. > > I'd like to see some more justification as well. > > Namely, if I compare "setting TIF_AUDIT_SYSCALL for every process on a > need-to-be-so basis" to "we always go through the slow path and > pessimistically assume that audit is enabled and has reasonable ruleset > loaded", I have my own (different) opinion of what is too ugly. Me too. That being said, on re-review of my old code, I think that audit_dec_n_rules() may be the wrong approach. It may be better to leave TIF_AUDIT_SYSCALL set but to make the audit code itself clear the flag the next time through. That way we don't end up with a partially filled in syscall audit record that never gets consumed if we clear TIF_AUDIT_SYSCALL in the middle of a syscall.