Received: by 10.192.165.148 with SMTP id m20csp1332502imm; Wed, 2 May 2018 19:35:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoUKPOdErEXA8BKLFYWJWYa7yabGOx9JXMr9NoHRjKqeE58f2IaSfDUTddoxHpqQyimApLX X-Received: by 2002:a65:4083:: with SMTP id t3-v6mr17906574pgp.129.1525314902050; Wed, 02 May 2018 19:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525314902; cv=none; d=google.com; s=arc-20160816; b=hP9hPRoY4m0TjpfRsuwu3Eu0jXbGAdVPPZUygIJabm0B+h4Rl+a6ImYJ4kk6su96db +DFk8b1UwKoKdkil6xcWngYe+ereWFBVlu8/061KZFhdhMqgGtHyHR5lyZLr4U1/zXTv 9Ez3K4qbLVnruxYwYfGfHyc1P6iVEVHLMcqyvDqini1YstYst4xIBEJY3ZMva+/rt9rc EZMsm3CisqSM+rsTlI/oyaeO00AZSj5RWLsdZx9ukiY9Wc/xd1geW7hA8IlLrT2Ttw5k FuB0I5yjswsRaidimmDM3fXFm4SopAoYtPvP3Oua0chkP2l4UxesWj0MniezF70oMX1X RRkw== 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:dkim-signature :arc-authentication-results; bh=eHvXL6ftbCEXdeeZO8l2ztFukgWRaQWjieZ8EPvCWO0=; b=mJ0W4R3wgJ7EQkPzDbBuvW3JuHqMKzmUlpdU7Jaq7JssiL34moTh/3+MM5ccq5dT02 +efpPCN9ZNbyBY7UQDvL1PWXGWwaTGgAxmTnlfPKjP1tNmYlXGmSzkA28ePgTNi49bxB y+n6jiEtmwcDm360T62dwhynY4CWgTwdKNzvz7bF9IDb73EPk2FNzNDqKjjXpiJpf3aP dEmsG+WjATQUY1nbACoruXeEqA88cnF6rYeeNoTzmAK49vmmuKPYkpyEfu3M7pEgNg6J Ewe5sHxXHEgKYGfxf2K/HHSIcVZTqJiXybBDNXKP0DdytFnTurh713R0irpjQphShNmd G8Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=NyoM/A22; 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 o186-v6si10611334pga.350.2018.05.02.19.34.48; Wed, 02 May 2018 19:35:02 -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; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=NyoM/A22; 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 S1752117AbeECCdT (ORCPT + 99 others); Wed, 2 May 2018 22:33:19 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:39943 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752070AbeECCc6 (ORCPT ); Wed, 2 May 2018 22:32:58 -0400 Received: by mail-lf0-f68.google.com with SMTP id j16-v6so23710993lfb.7 for ; Wed, 02 May 2018 19:32:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eHvXL6ftbCEXdeeZO8l2ztFukgWRaQWjieZ8EPvCWO0=; b=NyoM/A22hlF3E2Eu5M6wcLlv080MzVJZkEKWWxAESiI5DTO+89wp975yc8NfJ7PGZM 4KMc+pAF/FO+TB2EmPm2kUof1Il59ysLB8Ks0fNzb6b8Ep/3hajZq6DrCbWZpP65EKBW c/pcCDFowWFpapdxl3u70HidNpgw2i6bhFMHD4U5C/bPG1Xga7vbt25oPYBOAZhiuslR 9UrWgQm629b5bwD9oLvww2E2oGJqi9i0UV06PD2j7lU8ZYHx/aX9r+fQEyBCGT8xdQ9A 7Q0lZZ2uAn+xvXSIqRLpcwvVkMZGfpS0Ms4tWlcjFwze+s/3sLfErceIUQMkQxVXcAc0 8PLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eHvXL6ftbCEXdeeZO8l2ztFukgWRaQWjieZ8EPvCWO0=; b=WaOoI3NgVK2W+HCJMcjN+kui7TK9/cuWqQOhDFgzg9c2Z/fUyOJ3tpR7Nbj7aBKrYU 0cN6G5O5HP1xU3y2XGQCzI3XxpkM93BJpoj8qHaIqS7X8msIrG45iF+2ALI3Li9Hi7aA UeQ1rNXQUTtI5SB64JvasY4ewEPvNj3/H4tVY5VB8ns57G2+Jua8UHfTs5n7n4ha/b88 YR5oN9313ChXrjAsDUykdFreXwcmmK3Zq+E3jbeDDB6BGkRi7E3izN6EaGJZd6mSxRW3 OgPriPm5d0utA+jnKywQQQ55trPW9FTlTZRNCAnjwDuC0a1jtx35bTV1XHfB+cUA9FxK Ep7Q== X-Gm-Message-State: ALQs6tBsy5OSi2c5abJZ3+zyqi7QIy64zn5h6n4ybZV9QuwEt36WktQY FhdUvXfCZn0n7d5k3pORJIo81AFBAyQWqezaX0lx X-Received: by 2002:a2e:810a:: with SMTP id d10-v6mr14343972ljg.83.1525314776554; Wed, 02 May 2018 19:32:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:c78f:0:0:0:0:0 with HTTP; Wed, 2 May 2018 19:32:55 -0700 (PDT) X-Originating-IP: [108.20.156.165] In-Reply-To: References: <1525276400-7161-1-git-send-email-tyhicks@canonical.com> <1525276400-7161-5-git-send-email-tyhicks@canonical.com> From: Paul Moore Date: Wed, 2 May 2018 22:32:55 -0400 Message-ID: Subject: Re: [PATCH v2 4/4] seccomp: Don't special case audited processes when logging To: Kees Cook Cc: Tyler Hicks , LKML , Andy Lutomirski , Will Drewry , Eric Paris , Steve Grubb , Jonathan Corbet , Linux Audit , linux-security-module , linux-doc@vger.kernel.org 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, May 2, 2018 at 12:57 PM, Kees Cook wrote: > On Wed, May 2, 2018 at 8:53 AM, Tyler Hicks wrote: >> diff --git a/kernel/seccomp.c b/kernel/seccomp.c >> index da78835..9029d9d 100644 >> --- a/kernel/seccomp.c >> +++ b/kernel/seccomp.c >> @@ -584,18 +584,13 @@ static inline void seccomp_log(unsigned long syscall, long signr, u32 action, >> } >> >> /* >> - * Force an audit message to be emitted when the action is RET_KILL_*, >> - * RET_LOG, or the FILTER_FLAG_LOG bit was set and the action is >> - * allowed to be logged by the admin. >> + * Emit an audit message when the action is RET_KILL_*, RET_LOG, or the >> + * FILTER_FLAG_LOG bit was set. The admin has the ability to silence >> + * any action from being logged by removing the action name from the >> + * seccomp_actions_logged sysctl. >> */ >> if (log) >> - return __audit_seccomp(syscall, signr, action); >> - >> - /* >> - * Let the audit subsystem decide if the action should be audited based >> - * on whether the current task itself is being audited. >> - */ >> - return audit_seccomp(syscall, signr, action); >> + audit_seccomp(syscall, signr, action); >> } > > This whole series looks great to me. If I can get an Ack from Paul for > the audit bits, I can take it via the seccomp tree. I got stuck doing some day job things today and didn't get a chance to look at v2 today, but I'll do that tomorrow. I'm not sure if you've already got anything queued up in your seccomp tree Kees, but if not I'm happy to take these patches via the audit tree; that was my original plan, assuming I got a positive nod from you. Either way, as long as it hits Linus' tree eventually I'll be happy (assuming everything looks good post-review of course). > ... One minor nit on > seccomp_log() above, I'd probably change this to show the "exception" > case as "out of line" of normal code flow. i.e. instead of "if (log) > audit_seccomp", invert it to return early: > > ... > if (!log) > return; > > audit_seccomp(syscall, signr, action); > } > > But if there isn't some other need for a v3, I can just make this > change when I commit. > > Thanks for fixing this up! > > -Kees > > -- > Kees Cook > Pixel Security -- paul moore www.paul-moore.com