netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: bernat@luffy.cx
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] sk-filter: Add ability to lock a socket filter program
Date: Wed, 16 Jan 2013 16:20:12 -0500 (EST)	[thread overview]
Message-ID: <20130116.162012.1782638746075880444.davem@davemloft.net> (raw)
In-Reply-To: <1358296955-30582-1-git-send-email-bernat@luffy.cx>

From: Vincent Bernat <bernat@luffy.cx>
Date: Wed, 16 Jan 2013 01:42:34 +0100

> While a privileged program can open a raw socket, attach some
> restrictive filter and drop its privileges (or send the socket to an
> unprivileged program through some Unix socket), the filter can still
> be removed or modified by the unprivileged program. This commit adds a
> socket option to lock the filter (SO_LOCK_FILTER) preventing any
> modification of a socket filter program.
> 
> This is similar to OpenBSD BIOCLOCK ioctl on bpf sockets, except even
> root is not allowed change/drop the filter.
> 
> The state of the lock can be read with getsockopt(). No error is
> triggered if the state is not changed. -EPERM is returned when a user
> tries to remove the lock or to change/remove the filter while the lock
> is active. The check is done directly in sk_attach_filter() and
> sk_detach_filter() and does not affect only setsockopt() syscall.
> 
> Signed-off-by: Vincent Bernat <bernat@luffy.cx>

I'm fine with this feature but:

> +SO_LOCK_FILTER ioctl allows to lock the filter attached to a

It's not an ioctl, it's a socket option.

  reply	other threads:[~2013-01-16 21:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-16  0:42 [PATCH] sk-filter: Add ability to lock a socket filter program Vincent Bernat
2013-01-16 21:20 ` David Miller [this message]
2013-01-16 21:55   ` [PATCH net-next] " Vincent Bernat
2013-01-17  8:33     ` David Miller
2013-01-16 21:57   ` [PATCH] " Vincent Bernat

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=20130116.162012.1782638746075880444.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=bernat@luffy.cx \
    --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).