From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Tycho Andersen <tycho@tycho.ws>
Cc: Kees Cook <keescook@chromium.org>,
Andy Lutomirski <luto@amacapital.net>,
Oleg Nesterov <oleg@redhat.com>,
linux-api@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] ptrace, seccomp: add support for retrieving seccomp metadata
Date: Tue, 20 Feb 2018 22:30:52 +0300 [thread overview]
Message-ID: <20180220193051.GA22210@altlinux.org> (raw)
In-Reply-To: <20171115020019.13517-2-tycho@tycho.ws>
[-- Attachment #1: Type: text/plain, Size: 1528 bytes --]
Hi,
On Tue, Nov 14, 2017 at 07:00:19PM -0700, Tycho Andersen wrote:
> With the new SECCOMP_FILTER_FLAG_LOG, we need to be able to extract these
> flags for checkpoint restore, since they describe the state of a filter.
>
> So, let's add PTRACE_SECCOMP_GET_METADATA, similar to ..._GET_FILTER, which
> returns the metadata of the nth filter (right now, just the flags).
> Hopefully this will be future proof, and new per-filter metadata can be
> added to this struct.
>
> v3: * use GET_METADATA instead of GET_FLAGS
> v4: * resend
>
> Signed-off-by: Tycho Andersen <tycho@tycho.ws>
> CC: Kees Cook <keescook@chromium.org>
> CC: Andy Lutomirski <luto@amacapital.net>
> CC: Oleg Nesterov <oleg@redhat.com>
[...]
> diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h
> index e3939e00980b..e46d82b91166 100644
> --- a/include/uapi/linux/ptrace.h
> +++ b/include/uapi/linux/ptrace.h
> @@ -66,6 +66,12 @@ struct ptrace_peeksiginfo_args {
> #define PTRACE_SETSIGMASK 0x420b
>
> #define PTRACE_SECCOMP_GET_FILTER 0x420c
> +#define PTRACE_SECCOMP_GET_METADATA 0x420d
> +
> +struct seccomp_metadata {
> + unsigned long filter_off; /* Input: which filter */
> + unsigned int flags; /* Output: filter's flags */
> +};
This "unsigned long" field is unacceptable unless you are willing
to implement a compat layer for this arch-dependent type.
Please use an arch-independent type instead.
See e.g. struct ptrace_peeksiginfo_args or struct struct seccomp_data.
--
ldv
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
next prev parent reply other threads:[~2018-02-20 19:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 2:00 [PATCH v4 1/2] seccomp: hoist out filter resolving logic Tycho Andersen
2017-11-15 2:00 ` [PATCH v4 2/2] ptrace, seccomp: add support for retrieving seccomp metadata Tycho Andersen
2018-02-20 19:30 ` Dmitry V. Levin [this message]
2018-02-21 2:49 ` Tycho Andersen
2018-02-20 20:13 ` Eugene Syromiatnikov
2018-02-21 2:50 ` Tycho Andersen
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=20180220193051.GA22210@altlinux.org \
--to=ldv@altlinux.org \
--cc=keescook@chromium.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=oleg@redhat.com \
--cc=tycho@tycho.ws \
/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
Powered by JetHome