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


Groups > linux.kernel > #1292460 > unrolled thread

[PATCH] net: fix uninitialized variable issue

Started byTadeusz Struk <tadeusz.struk@intel.com>
First post2015-12-15 19:50 +0100
Last post2015-12-15 21:50 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: fix uninitialized variable issue Tadeusz Struk <tadeusz.struk@intel.com> - 2015-12-15 19:50 +0100
    Re: [PATCH] net: fix uninitialized variable issue Eric Dumazet <eric.dumazet@gmail.com> - 2015-12-15 20:10 +0100
      Re: [PATCH] net: fix uninitialized variable issue Tadeusz Struk <tadeusz.struk@intel.com> - 2015-12-15 23:50 +0100
        Re: [PATCH] net: fix uninitialized variable issue Eric Dumazet <eric.dumazet@gmail.com> - 2015-12-16 00:20 +0100
    Re: [PATCH] net: fix uninitialized variable issue David Miller <davem@davemloft.net> - 2015-12-15 21:50 +0100

#1292460 — [PATCH] net: fix uninitialized variable issue

FromTadeusz Struk <tadeusz.struk@intel.com>
Date2015-12-15 19:50 +0100
Subject[PATCH] net: fix uninitialized variable issue
Message-ID<qG2PE-7Xw-7@gated-at.bofh.it>
msg_iocb needs to be initialized on the recv/recvfrom path.
Otherwise afalg will wrongly interpret it as an async call.

Cc: stable@vger.kernel.org
Reported-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
---
 net/socket.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/socket.c b/net/socket.c
index dd2c247..80ca820 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1702,6 +1702,7 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,
 	msg.msg_name = addr ? (struct sockaddr *)&address : NULL;
 	/* We assume all kernel code knows the size of sockaddr_storage */
 	msg.msg_namelen = 0;
+	msg.msg_iocb = NULL;
 	if (sock->file->f_flags & O_NONBLOCK)
 		flags |= MSG_DONTWAIT;
 	err = sock_recvmsg(sock, &msg, iov_iter_count(&msg.msg_iter), flags);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1292475

FromEric Dumazet <eric.dumazet@gmail.com>
Date2015-12-15 20:10 +0100
Message-ID<qG38Z-8jz-1@gated-at.bofh.it>
In reply to#1292460
On Tue, 2015-12-15 at 10:46 -0800, Tadeusz Struk wrote:
> msg_iocb needs to be initialized on the recv/recvfrom path.
> Otherwise afalg will wrongly interpret it as an async call.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
> Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
> ---
>  net/socket.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/socket.c b/net/socket.c
> index dd2c247..80ca820 100644
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -1702,6 +1702,7 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,
>  	msg.msg_name = addr ? (struct sockaddr *)&address : NULL;
>  	/* We assume all kernel code knows the size of sockaddr_storage */
>  	msg.msg_namelen = 0;
> +	msg.msg_iocb = NULL;
>  	if (sock->file->f_flags & O_NONBLOCK)
>  		flags |= MSG_DONTWAIT;
>  	err = sock_recvmsg(sock, &msg, iov_iter_count(&msg.msg_iter), flags);
> 

Do not add "Cc: stable@vger.kernel.org" for networking patches, thanks 
( Documentation/networking/netdev-FAQ.txt )

Do you know when was this bug added ?

Please add the 

Fixes:  12-digit-sha1 ("patch title")

Thanks.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1292618

FromTadeusz Struk <tadeusz.struk@intel.com>
Date2015-12-15 23:50 +0100
Message-ID<qG6zU-1Uc-9@gated-at.bofh.it>
In reply to#1292475
On 12/15/2015 11:02 AM, Eric Dumazet wrote:
> On Tue, 2015-12-15 at 10:46 -0800, Tadeusz Struk wrote:
>> msg_iocb needs to be initialized on the recv/recvfrom path.
>> Otherwise afalg will wrongly interpret it as an async call.
>>
>> Cc: stable@vger.kernel.org
>> Reported-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
>> Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
>> ---
>>  net/socket.c |    1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/net/socket.c b/net/socket.c
>> index dd2c247..80ca820 100644
>> --- a/net/socket.c
>> +++ b/net/socket.c
>> @@ -1702,6 +1702,7 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,
>>  	msg.msg_name = addr ? (struct sockaddr *)&address : NULL;
>>  	/* We assume all kernel code knows the size of sockaddr_storage */
>>  	msg.msg_namelen = 0;
>> +	msg.msg_iocb = NULL;
>>  	if (sock->file->f_flags & O_NONBLOCK)
>>  		flags |= MSG_DONTWAIT;
>>  	err = sock_recvmsg(sock, &msg, iov_iter_count(&msg.msg_iter), flags);
>>
> 
> Do not add "Cc: stable@vger.kernel.org" for networking patches, thanks 
> ( Documentation/networking/netdev-FAQ.txt )
> 
> Do you know when was this bug added ?
> 
> Please add the 
> 
> Fixes:  12-digit-sha1 ("patch title")
> 

It was added in this commit: 0345f93138b2 ("net: socket: add support for async operations")

Thanks
-- 
TS
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1292631

FromEric Dumazet <eric.dumazet@gmail.com>
Date2015-12-16 00:20 +0100
Message-ID<qG72W-2k7-19@gated-at.bofh.it>
In reply to#1292618
On Tue, 2015-12-15 at 14:42 -0800, Tadeusz Struk wrote:

> It was added in this commit: 0345f93138b2 ("net: socket: add support for async operations")
> 

Thanks !


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


#1292538

FromDavid Miller <davem@davemloft.net>
Date2015-12-15 21:50 +0100
Message-ID<qG4HN-Jq-33@gated-at.bofh.it>
In reply to#1292460
From: Tadeusz Struk <tadeusz.struk@intel.com>
Date: Tue, 15 Dec 2015 10:46:17 -0800

> msg_iocb needs to be initialized on the recv/recvfrom path.
> Otherwise afalg will wrongly interpret it as an async call.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
> Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>

Looks good, applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web