lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 20 Jan 2014 10:43:49 +0200
From:	"Michael S. Tsirkin" <mst@...hat.com>
To:	David Miller <davem@...emloft.net>
Cc:	jasowang@...hat.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, mtk.manpages@...il.com,
	linux-man@...r.kernel.org
Subject: Re: [PATCH net] tun: handle copy failure in tun_put_user()

On Sun, Jan 19, 2014 at 07:48:56PM -0800, David Miller wrote:
> From: Jason Wang <jasowang@...hat.com>
> Date: Mon, 20 Jan 2014 11:16:48 +0800
> 
> > This patch return the error code of copy helpers in tun_put_user() instead of
> > ignoring them.
> > 
> > Cc: Michael S. Tsirkin <mst@...hat.com>
> > Signed-off-by: Jason Wang <jasowang@...hat.com>

I'm not sure we need to worry about this too much.
But if yes, a bunch of places besides tun should be
changed. Consider for example udp_recvmsg: it
never seems to return any error except -EAGAIN.

Is this a bug? Man page for recvmsg says:
     EFAULT The receive buffer pointer(s)  point  outside  the process's  address
              space.

this isn't very clear: does this mean "all pointers are invalid"
or "some pointers are invalid"?
Also, what if pointers themselves are valid but length
makes us go outside the address space?

I'm guessing the simplest way is to clarify in the man page that
passing invalid pointers / lengths is not guaranteed
to result in EFAULT and that Linux makes no guarantees
about the returned length in this case.

Cc linux-man in case they can suggest some insights on this.

> If you perform some of the copy successfully, you have to report that
> length rather than just an error.
> 
> Otherwise userland has no way to determine how much of the data was
> successfully sourced.
>
> I'm not applying this, sorry.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ