netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: Jiri Pirko <jpirko@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] sock filter: fix copy of filter from userspace
Date: Mon, 15 Oct 2012 08:57:12 -0700	[thread overview]
Message-ID: <20121015085712.5a70a4d0@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <20121013191949.GA16286@minipsycho.orion>

On Sat, 13 Oct 2012 21:19:49 +0200
Jiri Pirko <jiri@resnulli.us> wrote:

> Sat, Oct 13, 2012 at 08:40:32PM CEST, shemminger@vyatta.com wrote:
> >The sk_unattached_filter_create function is passed a socket
> >filter structure and the copies the contents of the filter from
> >userspace. Sparse detected that this code was incorrectly using
> >memcpy when it needed to use copy_from_user instead.
> 
> Hmm. fprog->filter is in this case allocated and filled in kernel.
> So memcpy is good.
> 
> Not sure how to handle this correctly. Either we remove "__user" or we
> redefine "struct sock_fprog" for sk_unattached_filter_create() use.
> 
> Any thoughts?

Or define a different structure for kernel usage versus userspace API.

      reply	other threads:[~2012-10-15 15:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-13 18:40 [PATCH] sock filter: fix copy of filter from userspace Stephen Hemminger
2012-10-13 19:19 ` Jiri Pirko
2012-10-15 15:57   ` Stephen Hemminger [this message]

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=20121015085712.5a70a4d0@nehalam.linuxnetplumber.net \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=jiri@resnulli.us \
    --cc=jpirko@redhat.com \
    --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).