netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <zbr@ioremap.net>
To: Michael Stone <michael@laptop.org>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] Security: Implement and document RLIMIT_NETWORK.
Date: Thu, 8 Jan 2009 07:27:15 +0300	[thread overview]
Message-ID: <20090108042715.GA16187@ioremap.net> (raw)
In-Reply-To: <20090108005621.GI3164@didacte.laptop.org>

On Wed, Jan 07, 2009 at 07:56:21PM -0500, Michael Stone (michael@laptop.org) wrote:
> On Thu, Jan 08, 2009 at 12:59:36AM +0300, Evgeniy Polyakov wrote:
> >I meant that connected or accepted socket will not be able to send data
> >via send() call, but will be able to receive data using recv().
> 
> A key fact which may not have stood out, since I didn't comment on it
> explicitly in the code, is that the disqualification tests inserted by
> the __sock_sendmsg() and unix_dgram_sendmsg hunks contain additional
> conditions like
> 
> __sock_sendmsg():
> +               && (msg->msg_name != NULL || msg->msg_namelen != 0))
> 
> unix_dgram_sendmsg():
> +                       && !sunaddr->sun_path[0])
> 
> which return us to the usual codepaths whenever we're dealing with an
> already-connected socket. Since my tests pass, can you post an example
> of a failing send() call which you think should work?

You are right, I misread the documentation part where it is explained
that already connected sockets are allowed to operate. Btw that code
part breaks codying style with trailing '\' and '&&' on the new line.
There should be something wrong in the patch :)

> >Your patch adds a rlimit check into __sock_sendmsg() call, which is
> >invoked via usual send() path, but sendfile() and splice() are still
> >exectuted without this check and thus will be able to send data after
> >rlimit applied.
> 
> As far as I can tell, sendfile() and splice(), which operate solely on
> fds, cannot be used to send messages via a disconnected socket.
> Therefore, I /believe/ that they require no modification. Am I terribly
> mistaken about this?

No you are not, as long as user is allowed to operate with already
connected and/or bound sockets there should be no problems.

-- 
	Evgeniy Polyakov

  reply	other threads:[~2009-01-08  4:27 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07  5:48 RFC: Network privilege separation Michael Stone
2009-01-07  5:48 ` [PATCH] Security: Implement and document RLIMIT_NETWORK Michael Stone
2009-01-07 11:47   ` Evgeniy Polyakov
2009-01-07 16:52     ` Rémi Denis-Courmont
2009-01-07 17:48       ` Evgeniy Polyakov
2009-01-07 20:54         ` Rémi Denis-Courmont
2009-01-07 21:42           ` Evgeniy Polyakov
2009-01-07 18:35     ` C. Scott Ananian
2009-01-07 19:02       ` Evgeniy Polyakov
2009-01-07 19:39         ` Evgeniy Polyakov
2009-01-07 21:07     ` Michael Stone
2009-01-07 21:59       ` Evgeniy Polyakov
2009-01-08  0:56         ` Michael Stone
2009-01-08  4:27           ` Evgeniy Polyakov [this message]
2009-01-08  1:22       ` James Morris
2009-01-08  3:34         ` Michael Stone
2009-01-07 21:10 ` RFC: Network privilege separation Andi Kleen
2009-01-08  2:31   ` Michael Stone
2009-01-08  3:10     ` Andi Kleen
2009-01-08  4:51       ` Michael Stone
2009-01-08  5:41         ` Andi Kleen
2009-01-08  7:05       ` Oliver Hartkopp
2009-01-08  7:52       ` david
2009-01-08 10:43     ` Alan Cox
2009-01-12 18:44       ` Valdis.Kletnieks
2009-01-12 19:09         ` Bryan Donlan
2009-01-12 19:43         ` Andi Kleen
2009-01-12 19:47           ` Rémi Denis-Courmont
2009-01-12 20:14             ` Andi Kleen
2009-01-12 20:15               ` Rémi Denis-Courmont
2009-01-12 20:27                 ` Evgeniy Polyakov
2009-01-12 20:39                 ` Andi Kleen
2009-01-12 20:30                   ` Rémi Denis-Courmont
2009-01-12 20:55                     ` Andi Kleen
2009-01-12 20:47                       ` Rémi Denis-Courmont
2009-01-12 21:50                         ` Andi Kleen

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=20090108042715.GA16187@ioremap.net \
    --to=zbr@ioremap.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@laptop.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).