All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Håkon Bugge" <haakon.bugge@oracle.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH net] net: netlink: Fix uninit-value in netlink_recvmsg()
Date: Fri, 6 Dec 2019 20:07:19 +0100	[thread overview]
Message-ID: <449D3522-802F-47D8-9D8E-C7DF2CBD6C5F@oracle.com> (raw)
In-Reply-To: <c24c48d2-fc5e-6aca-27b8-7ea98ecd3ecc@gmail.com>



> On 6 Dec 2019, at 19:47, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> 
> 
> 
> On 12/6/19 5:49 AM, Håkon Bugge wrote:
>> If skb_recv_datagram() returns NULL, netlink_recvmsg() will return an
>> arbitrarily value.
>> 
>> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
>> ---
>> net/netlink/af_netlink.c | 1 +
>> 1 file changed, 1 insertion(+)
>> 
>> diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
>> index 90b2ab9dd449..bb7276f9c9f8 100644
>> --- a/net/netlink/af_netlink.c
>> +++ b/net/netlink/af_netlink.c
>> @@ -1936,6 +1936,7 @@ static int netlink_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
>> 		return -EOPNOTSUPP;
>> 
>> 	copied = 0;
>> +	err = 0;
>> 
>> 	skb = skb_recv_datagram(sk, flags, noblock, &err);
>> 	if (skb == NULL)
>> 
> 
> Please provide a Fixes: tag
> 
> By doing the research, you probably would find there is no bug.
> 
> err is set in skb_recv_datagram() when there is no packet to read.

yes, you are right, by bad.


Håkon



      reply	other threads:[~2019-12-06 19:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 13:49 [PATCH net] net: netlink: Fix uninit-value in netlink_recvmsg() Håkon Bugge
2019-12-06 18:20 ` Sergei Shtylyov
2019-12-06 18:45   ` Håkon Bugge
2019-12-06 18:57     ` Sergei Shtylyov
2019-12-06 18:47 ` Eric Dumazet
2019-12-06 19:07   ` Håkon Bugge [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=449D3522-802F-47D8-9D8E-C7DF2CBD6C5F@oracle.com \
    --to=haakon.bugge@oracle.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.