netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] fix two more udp pull header issues
@ 2016-04-07 22:12 Willem de Bruijn
  2016-04-07 22:12 ` [PATCH net-next 1/2] udp: do not expect udp headers on ioctl SIOCINQ Willem de Bruijn
  2016-04-14  2:25 ` [PATCH net-next 0/2] fix two more udp pull header issues David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Willem de Bruijn @ 2016-04-07 22:12 UTC (permalink / raw)
  To: netdev; +Cc: davem, tom, samanthakumar, Willem de Bruijn

From: Willem de Bruijn <willemb@google.com>

Follow up patches to the fixes to RxRPC and SunRPC. A scan of the
code showed two other interfaces that expect UDP packets to have
a udphdr when queued: read packet length with ioctl SIOCINQ and
receive payload checksum with socket option IP_CHECKSUM.

Willem de Bruijn (2):
  udp: do not expect udp headers on ioctl SIOCINQ
  udp: do not expect udp headers in recv cmsg IP_CMSG_CHECKSUM

 net/ipv4/ip_sockglue.c | 3 ++-
 net/ipv4/udp.c         | 4 +---
 2 files changed, 3 insertions(+), 4 deletions(-)

-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/2] udp: do not expect udp headers on ioctl SIOCINQ
  2016-04-07 22:12 [PATCH net-next 0/2] fix two more udp pull header issues Willem de Bruijn
@ 2016-04-07 22:12 ` Willem de Bruijn
  2016-04-14  2:25 ` [PATCH net-next 0/2] fix two more udp pull header issues David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: Willem de Bruijn @ 2016-04-07 22:12 UTC (permalink / raw)
  To: netdev; +Cc: davem, tom, samanthakumar, Willem de Bruijn

From: Willem de Bruijn <willemb@google.com>

On udp sockets, ioctl SIOCINQ returns the payload size of the first
packet. Since commit e6afc8ace6dd pulled the headers, the result is
incorrect when subtracting header length. Remove that operation.

Fixes: e6afc8ace6dd ("udp: remove headers from UDP packets before queueing")

Signed-off-by: Willem de Bruijn <willemb@google.com>
---
 net/ipv4/udp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 3563788d..d2d294b 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1282,8 +1282,6 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
 			 * of this packet since that is all
 			 * that will be read.
 			 */
-			amount -= sizeof(struct udphdr);
-
 		return put_user(amount, (int __user *)arg);
 	}
 
-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 0/2] fix two more udp pull header issues
  2016-04-07 22:12 [PATCH net-next 0/2] fix two more udp pull header issues Willem de Bruijn
  2016-04-07 22:12 ` [PATCH net-next 1/2] udp: do not expect udp headers on ioctl SIOCINQ Willem de Bruijn
@ 2016-04-14  2:25 ` David Miller
  2016-04-14  2:57   ` Willem de Bruijn
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2016-04-14  2:25 UTC (permalink / raw)
  To: willemdebruijn.kernel; +Cc: netdev, tom, samanthakumar, willemb

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Thu,  7 Apr 2016 18:12:57 -0400

> Follow up patches to the fixes to RxRPC and SunRPC. A scan of the
> code showed two other interfaces that expect UDP packets to have
> a udphdr when queued: read packet length with ioctl SIOCINQ and
> receive payload checksum with socket option IP_CHECKSUM.

As we are seeing, lots of places depend upon the old way of queueing
up UDP frames. :-/

Applied, thanks for mopping all of this up.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 0/2] fix two more udp pull header issues
  2016-04-14  2:25 ` [PATCH net-next 0/2] fix two more udp pull header issues David Miller
@ 2016-04-14  2:57   ` Willem de Bruijn
  0 siblings, 0 replies; 4+ messages in thread
From: Willem de Bruijn @ 2016-04-14  2:57 UTC (permalink / raw)
  To: David Miller
  Cc: Network Development, Tom Herbert, Sam Kumar, Willem de Bruijn

On Wed, Apr 13, 2016 at 10:25 PM, David Miller <davem@davemloft.net> wrote:
> From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
> Date: Thu,  7 Apr 2016 18:12:57 -0400
>
>> Follow up patches to the fixes to RxRPC and SunRPC. A scan of the
>> code showed two other interfaces that expect UDP packets to have
>> a udphdr when queued: read packet length with ioctl SIOCINQ and
>> receive payload checksum with socket option IP_CHECKSUM.
>
> As we are seeing, lots of places depend upon the old way of queueing
> up UDP frames. :-/

Yes, I greatly underestimated that. I should have done a much more
thorough scan before submitting. Hopefully we've caught them all now.

> Applied, thanks for mopping all of this up.

Apologies for breaking it in the first place!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-14  2:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07 22:12 [PATCH net-next 0/2] fix two more udp pull header issues Willem de Bruijn
2016-04-07 22:12 ` [PATCH net-next 1/2] udp: do not expect udp headers on ioctl SIOCINQ Willem de Bruijn
2016-04-14  2:25 ` [PATCH net-next 0/2] fix two more udp pull header issues David Miller
2016-04-14  2:57   ` Willem de Bruijn

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).