Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1381378 > unrolled thread

[patch -next] udp: fix if statement in SIOCINQ ioctl

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2016-04-18 10:50 +0200
Last post2016-04-18 19:50 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [patch -next] udp: fix if statement in SIOCINQ ioctl Dan Carpenter <dan.carpenter@oracle.com> - 2016-04-18 10:50 +0200
    Re: [patch -next] udp: fix if statement in SIOCINQ ioctl Eric Dumazet <eric.dumazet@gmail.com> - 2016-04-18 14:30 +0200
      Re: [patch -next] udp: fix if statement in SIOCINQ ioctl Willem de Bruijn <willemdebruijn.kernel@gmail.com> - 2016-04-18 15:50 +0200
    Re: [patch -next] udp: fix if statement in SIOCINQ ioctl David Miller <davem@davemloft.net> - 2016-04-18 19:50 +0200

#1381378 — [patch -next] udp: fix if statement in SIOCINQ ioctl

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-04-18 10:50 +0200
Subject[patch -next] udp: fix if statement in SIOCINQ ioctl
Message-ID<rpd2x-2oe-1@gated-at.bofh.it>
We deleted a line of code and accidentally made the "return put_user()"
part of the if statement when it's supposed to be unconditional.

Fixes: 9f9a45beaa96 ('udp: do not expect udp headers on ioctl SIOCINQ')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index f186313..37e09c3 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1276,12 +1276,6 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
 	{
 		unsigned int amount = first_packet_length(sk);
 
-		if (amount)
-			/*
-			 * We will only return the amount
-			 * of this packet since that is all
-			 * that will be read.
-			 */
 		return put_user(amount, (int __user *)arg);
 	}
 

[toc] | [next] | [standalone]


#1381655

FromEric Dumazet <eric.dumazet@gmail.com>
Date2016-04-18 14:30 +0200
Message-ID<rpgtt-5Be-9@gated-at.bofh.it>
In reply to#1381378
On Mon, 2016-04-18 at 11:44 +0300, Dan Carpenter wrote:
> We deleted a line of code and accidentally made the "return put_user()"
> part of the if statement when it's supposed to be unconditional.
> 
> Fixes: 9f9a45beaa96 ('udp: do not expect udp headers on ioctl SIOCINQ')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Eric Dumazet <edumazet@google.com>

[toc] | [prev] | [next] | [standalone]


#1381715

FromWillem de Bruijn <willemdebruijn.kernel@gmail.com>
Date2016-04-18 15:50 +0200
Message-ID<rphIT-6ug-21@gated-at.bofh.it>
In reply to#1381655
On Mon, Apr 18, 2016 at 8:19 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Mon, 2016-04-18 at 11:44 +0300, Dan Carpenter wrote:
>> We deleted a line of code and accidentally made the "return put_user()"
>> part of the if statement when it's supposed to be unconditional.
>>
>> Fixes: 9f9a45beaa96 ('udp: do not expect udp headers on ioctl SIOCINQ')
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Acked-by: Eric Dumazet <edumazet@google.com>

Acked-by: Willem de Bruijn <willemb@google.com>

Thanks for catching this.

[toc] | [prev] | [next] | [standalone]


#1381947

FromDavid Miller <davem@davemloft.net>
Date2016-04-18 19:50 +0200
Message-ID<rplt8-13z-9@gated-at.bofh.it>
In reply to#1381378
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Mon, 18 Apr 2016 11:44:49 +0300

> We deleted a line of code and accidentally made the "return put_user()"
> part of the if statement when it's supposed to be unconditional.
> 
> Fixes: 9f9a45beaa96 ('udp: do not expect udp headers on ioctl SIOCINQ')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web