mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tyler Hicks <tyhicks@canonical.com>
To: Kees Cook <keescook@chromium.org>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Will Drewry <wad@chromium.org>, Paul Moore <paul@paul-moore.com>,
	Eric Paris <eparis@redhat.com>, John Crispin <john@phrozen.org>,
	Tycho Andersen <tycho@docker.com>,
	linux-audit@redhat.com, LKML <linux-kernel@vger.kernel.org>,
	Linux API <linux-api@vger.kernel.org>
Subject: Re: [PATCH v6 3/6] seccomp: Sysctl to configure actions that are allowed to be logged
Date: Fri, 11 Aug 2017 14:33:35 -0500	[thread overview]
Message-ID: <23a0adb0-4db0-52aa-831e-36ceca466636@canonical.com> (raw)
In-Reply-To: <CAGXu5jJzboJ47tZH_BkeXTYgD_QyTpK4gXd8FTpcj-acO-F+VQ@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2105 bytes --]

On 08/11/2017 02:17 PM, Kees Cook wrote:
> On Thu, Aug 10, 2017 at 9:33 PM, Tyler Hicks <tyhicks@canonical.com> wrote:
>> +static int seccomp_actions_logged_handler(struct ctl_table *ro_table, int write,
>> +                                         void __user *buffer, size_t *lenp,
>> +                                         loff_t *ppos)
>> +{
>> +       char names[sizeof(seccomp_actions_avail)];
>> +       struct ctl_table table;
>> +       int ret;
>> +
>> +       if (write && !capable(CAP_SYS_ADMIN))
>> +               return -EPERM;
>> +
>> +       memset(names, 0, sizeof(names));
>> +
>> +       if (!write) {
>> +               if (!seccomp_names_from_actions_logged(names, sizeof(names),
>> +                                                      seccomp_actions_logged))
>> +                       return -EINVAL;
>> +       }
>> +
>> +       table = *ro_table;
>> +       table.data = names;
>> +       table.maxlen = sizeof(names);
>> +       ret = proc_dostring(&table, write, buffer, lenp, ppos);
>> +       if (ret)
>> +               return ret;
>> +
>> +       if (write) {
>> +               u32 actions_logged;
>> +
>> +               if (!seccomp_actions_logged_from_names(&actions_logged,
>> +                                                      table.data))
>> +                       return -EINVAL;
>> +
>> +               if (actions_logged & SECCOMP_LOG_ALLOW)
>> +                       return -EINVAL;
>> +
>> +               seccomp_actions_logged = actions_logged;
>> +       }
>> +
>> +       return 0;
>> +}
> 
> One thought here: should "kill" be always forced on during a write?
> This flag effectively cannot be disabled, so listing it (or not) in
> the sysctl may be confusing...

"kill" can be silenced in the current implementation. Lets hammer out
whether or not that's the right thing to do and then we can discuss the
sysctl behavior on write. I don't personally have any concerns about an
admin being able to silence RET_KILL logs but let me know if you are
against it.

Tyler

> 
> -Kees
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2017-08-11 19:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-11  4:33 [PATCH v6 0/6] Improved seccomp logging Tyler Hicks
2017-08-11  4:33 ` [PATCH v6 1/6] seccomp: Sysctl to display available actions Tyler Hicks
2017-08-11  4:33 ` [PATCH v6 2/6] seccomp: Operation for checking if an action is available Tyler Hicks
2017-08-11  4:33 ` [PATCH v6 3/6] seccomp: Sysctl to configure actions that are allowed to be logged Tyler Hicks
2017-08-11 19:17   ` Kees Cook
2017-08-11 19:33     ` Tyler Hicks [this message]
2017-08-11 19:35       ` Kees Cook
2017-08-11  4:33 ` [PATCH v6 4/6] seccomp: Selftest for detection of filter flag support Tyler Hicks
2017-08-11  4:33 ` [PATCH v6 5/6] seccomp: Filter flag to log all actions except SECCOMP_RET_ALLOW Tyler Hicks
2017-08-11  4:33 ` [PATCH v6 6/6] seccomp: Action to log before allowing Tyler Hicks
2017-08-11 19:14 ` [PATCH v6 0/6] Improved seccomp logging Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23a0adb0-4db0-52aa-831e-36ceca466636@canonical.com \
    --to=tyhicks@canonical.com \
    --cc=eparis@redhat.com \
    --cc=john@phrozen.org \
    --cc=keescook@chromium.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=paul@paul-moore.com \
    --cc=tycho@docker.com \
    --cc=wad@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®