* [PATCH net-next] net: socket: Fix missing break in switch statement
@ 2019-04-24 15:31 Gustavo A. R. Silva
2019-04-24 18:45 ` Arnd Bergmann
2019-04-26 15:29 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-24 15:31 UTC (permalink / raw)
To: David S. Miller, Arnd Bergmann; +Cc: netdev, linux-kernel, Gustavo A. R. Silva
Add missing break statement in order to prevent the code from falling
through to cases SIOCGSTAMP_NEW and SIOCGSTAMPNS_NEW.
This bug was found thanks to the ongoing efforts to enable
-Wimplicit-fallthrough.
Fixes: 0768e17073dc ("net: socket: implement 64-bit timestamps")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
net/socket.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/socket.c b/net/socket.c
index 8d9d4fc7d962..a180e1a9ff23 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1173,6 +1173,7 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
err = sock->ops->gettstamp(sock, argp,
cmd == SIOCGSTAMP_OLD,
!IS_ENABLED(CONFIG_64BIT));
+ break;
case SIOCGSTAMP_NEW:
case SIOCGSTAMPNS_NEW:
if (!sock->ops->gettstamp) {
--
2.21.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: socket: Fix missing break in switch statement
2019-04-24 15:31 [PATCH net-next] net: socket: Fix missing break in switch statement Gustavo A. R. Silva
@ 2019-04-24 18:45 ` Arnd Bergmann
2019-04-24 19:47 ` Gustavo A. R. Silva
2019-04-26 15:29 ` David Miller
1 sibling, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2019-04-24 18:45 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: David S. Miller, Networking, Linux Kernel Mailing List, Dan Carpenter
On Wed, Apr 24, 2019 at 5:33 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> Add missing break statement in order to prevent the code from falling
> through to cases SIOCGSTAMP_NEW and SIOCGSTAMPNS_NEW.
>
> This bug was found thanks to the ongoing efforts to enable
> -Wimplicit-fallthrough.
>
> Fixes: 0768e17073dc ("net: socket: implement 64-bit timestamps")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
I had just prepared the same patch after Dan told me about the issue today,
but you managed to submit it first.
Thanks for the fix!
Arnd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: socket: Fix missing break in switch statement
2019-04-24 18:45 ` Arnd Bergmann
@ 2019-04-24 19:47 ` Gustavo A. R. Silva
0 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-24 19:47 UTC (permalink / raw)
To: Arnd Bergmann
Cc: David S. Miller, Networking, Linux Kernel Mailing List, Dan Carpenter
Arnd,
On 4/24/19 1:45 PM, Arnd Bergmann wrote:
> On Wed, Apr 24, 2019 at 5:33 PM Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
>>
>> Add missing break statement in order to prevent the code from falling
>> through to cases SIOCGSTAMP_NEW and SIOCGSTAMPNS_NEW.
>>
>> This bug was found thanks to the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Fixes: 0768e17073dc ("net: socket: implement 64-bit timestamps")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Just for clarification: Dan didn't report this to me. I found this
bug while working on the last fall-through warnings in net.
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> I had just prepared the same patch after Dan told me about the issue today,
> but you managed to submit it first.
>
> Thanks for the fix!
>
Glad to help. :)
Thanks
--
Gustavo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: socket: Fix missing break in switch statement
2019-04-24 15:31 [PATCH net-next] net: socket: Fix missing break in switch statement Gustavo A. R. Silva
2019-04-24 18:45 ` Arnd Bergmann
@ 2019-04-26 15:29 ` David Miller
2019-04-26 15:45 ` Gustavo A. R. Silva
1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2019-04-26 15:29 UTC (permalink / raw)
To: gustavo; +Cc: arnd, netdev, linux-kernel
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Wed, 24 Apr 2019 10:31:24 -0500
> Add missing break statement in order to prevent the code from falling
> through to cases SIOCGSTAMP_NEW and SIOCGSTAMPNS_NEW.
>
> This bug was found thanks to the ongoing efforts to enable
> -Wimplicit-fallthrough.
>
> Fixes: 0768e17073dc ("net: socket: implement 64-bit timestamps")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: socket: Fix missing break in switch statement
2019-04-26 15:29 ` David Miller
@ 2019-04-26 15:45 ` Gustavo A. R. Silva
0 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-26 15:45 UTC (permalink / raw)
To: David Miller; +Cc: arnd, netdev, linux-kernel
On 4/26/19 10:29 AM, David Miller wrote:
> From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
> Date: Wed, 24 Apr 2019 10:31:24 -0500
>
>> Add missing break statement in order to prevent the code from falling
>> through to cases SIOCGSTAMP_NEW and SIOCGSTAMPNS_NEW.
>>
>> This bug was found thanks to the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Fixes: 0768e17073dc ("net: socket: implement 64-bit timestamps")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> Applied.
>
Great. :)
Thanks, Dave.
--
Gustavo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-04-26 16:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 15:31 [PATCH net-next] net: socket: Fix missing break in switch statement Gustavo A. R. Silva
2019-04-24 18:45 ` Arnd Bergmann
2019-04-24 19:47 ` Gustavo A. R. Silva
2019-04-26 15:29 ` David Miller
2019-04-26 15:45 ` Gustavo A. R. Silva
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).