All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Cong Wang ." <cong.wang@bytedance.com>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [bug report] net: fix dev_ifsioc_locked() race condition
Date: Tue, 16 Feb 2021 11:52:12 -0800	[thread overview]
Message-ID: <CAM_iQpXb1oUXUEtVxXh8yVKgArx4ANJ3jcMNAOLz+pX2OPxNqw@mail.gmail.com> (raw)
In-Reply-To: <YCwfQn21MdZmE3CO@mwanda>

On Tue, Feb 16, 2021 at 11:40 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> Hello Cong Wang,
>
> The patch 3b23a32a6321: "net: fix dev_ifsioc_locked() race condition"
> from Feb 11, 2021, leads to the following static checker warning:
>
>         drivers/net/tap.c:1095 tap_ioctl()
>         warn: check that 'sa.sa_family' doesn't leak information
>
> drivers/net/tap.c
>   1084
>   1085          case SIOCGIFHWADDR:
>   1086                  rtnl_lock();
>   1087                  tap = tap_get_tap_dev(q);
>   1088                  if (!tap) {
>   1089                          rtnl_unlock();
>   1090                          return -ENOLINK;
>   1091                  }
>   1092                  ret = 0;
>   1093                  dev_get_mac_address(&sa, dev_net(tap->dev), tap->dev->name);
>
> How do you want to handle errors from dev_get_mac_address()?

I did have a check there but it turns out unnecessary, because the only
error can happen is when the device name is not found, but here
we already have tap->dev, therefore its name is always there and valid.

Thanks.

      reply	other threads:[~2021-02-16 19:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 19:38 [bug report] net: fix dev_ifsioc_locked() race condition Dan Carpenter
2021-02-16 19:52 ` Cong Wang [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=CAM_iQpXb1oUXUEtVxXh8yVKgArx4ANJ3jcMNAOLz+pX2OPxNqw@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=cong.wang@bytedance.com \
    --cc=dan.carpenter@oracle.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.