Thread (3 messages) 3 messages, 2 authors, 2012-10-15

Re: [PATCH] sock filter: fix copy of filter from userspace

flat view

From: Stephen Hemminger <hidden>
Date: 2012-10-15 15:57:54

On Sat, 13 Oct 2012 21:19:49 +0200
Jiri Pirko [off-list ref] wrote:
Sat, Oct 13, 2012 at 08:40:32PM CEST, shemminger@vyatta.com wrote:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help