From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Vincent Bernat <bernat@luffy.cx>
Cc: mtk.manpages@gmail.com, Craig Gallek <kraigatgoog@gmail.com>,
linux-man@vger.kernel.org, netdev@vger.kernel.org,
alexei.starovoitov@gmail.com
Subject: Re: [PATCH v2] socket.7: Document some BPF-related socket options
Date: Tue, 1 Mar 2016 11:29:56 +0100 [thread overview]
Message-ID: <56D56F24.3090605@gmail.com> (raw)
In-Reply-To: <87k2lm7bks.fsf@zoro.exoscale.ch>
On 03/01/2016 11:10 AM, Vincent Bernat wrote:
> ❦ 1 mars 2016 11:03 +0100, "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> :
>
>> Once the SO_LOCK_FILTER option has been enabled,
>> attempts by an unprivileged process to change or remove
>> the filter attached to a socket, or to disable the
>> SO_LOCK_FILTER option will fail with the error EPERM.
>
> You should remove "unprivileged". I didn't try to check for permissions
> because I was just lazy (and I didn't have a need for it). As root, you
> can just recreate another socket.
Bother. That's what I meant to do, and then I omitted to do it! Done now
And thanks for catching that, Vincent.
Revised text below, with another query.
SO_LOCK_FILTER
When set, this option will prevent changing the filters
associated with the socket. These filters include any
set using the socket options SO_ATTACH_FILTER,
SO_ATTACH_BPF, SO_ATTACH_REUSEPORT_CBPF and
SO_ATTACH_REUSEPORT_EPBF.
The typical use case is for a privileged process to set
up a socket with restrictive filters, set SO_LOCK_FIL‐
TER, and then either drop its privileges or pass the
socket file descriptor to an unprivileged process.
Once the SO_LOCK_FILTER option has been enabled,
attempts to change or remove the filter attached to a
socket, or to disable the SO_LOCK_FILTER option will
fail with the error EPERM.
I think the second paragraph should probably drop mention of privileges,
right? In fact, maybe just drop the paragraph altogether?
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
next prev parent reply other threads:[~2016-03-01 10:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-29 17:36 [PATCH v2] socket.7: Document some BPF-related socket options Craig Gallek
2016-03-01 10:03 ` Michael Kerrisk (man-pages)
[not found] ` <56D56901.5070307-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-01 10:10 ` Vincent Bernat
2016-03-01 10:29 ` Michael Kerrisk (man-pages) [this message]
2016-03-01 15:40 ` Craig Gallek
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=56D56F24.3090605@gmail.com \
--to=mtk.manpages@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bernat@luffy.cx \
--cc=kraigatgoog@gmail.com \
--cc=linux-man@vger.kernel.org \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).