From: Sergey Popovich <popovich_sergei@mail.ru>
To: netdev@vger.kernel.org
Subject: Re: [PATCH 2/3] rtnetlink: fix potential NULL pointer dereference
Date: Tue, 06 May 2014 18:26:17 +0300 [thread overview]
Message-ID: <7039871.D07mH35iXC@tuxracer> (raw)
In-Reply-To: <d525a30e52966da564bc3e4de31c4197a989b2ae.1399388943.git.popovich_sergei@mail.ru>
В письме от 6 мая 2014 18:13:16 пользователь Sergey Popovich написал:
> Now since commit fbdc1e8c6b79 (rtnetlink: walk through all devs in
> netns safely on link params change) group of network devices can
> be moved into another network namespace, there is NULL pointer
> dereference in the do_setlink() as it get's called from
> rtnl_group_changelink() with ifname == NULL.
>
> Fixes: e7ed828f10bd netlink: support setting devgroup parameters
> Signed-off-by: Sergey Popovich <popovich_sergei@mail.ru>
Not needed, self-rejected patch, ifm->ifi_index is == 0 when
calling from rtnl_group_changelink().
Sorry for noise.
> ---
> net/core/rtnetlink.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 95258e2..188c060 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -1484,7 +1484,7 @@ static int do_setlink(struct net_device *dev, struct
> ifinfomsg *ifm, * name provided implies that a name change has been
> * requested.
> */
> - if (ifm->ifi_index > 0 && ifname[0]) {
> + if (ifname && ifname[0] && ifm->ifi_index > 0) {
> err = dev_change_name(dev, ifname);
> if (err < 0)
> goto errout;
--
SP5474-RIPE
Sergey Popovich
next prev parent reply other threads:[~2014-05-06 15:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 15:13 [PATCH 0/3] Fixes to network device group configuration via rtnetlink Sergey Popovich
2014-05-06 15:13 ` [PATCH 1/3] rtnetlink: walk through all devs in netns safely on link params change Sergey Popovich
2014-05-06 15:13 ` [PATCH 2/3] rtnetlink: fix potential NULL pointer dereference Sergey Popovich
2014-05-06 15:26 ` Sergey Popovich [this message]
2014-05-07 21:04 ` David Miller
2014-05-06 15:13 ` [PATCH 3/3] rtnetlink: add IFLA_GROUP to ifla_policy Sergey Popovich
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=7039871.D07mH35iXC@tuxracer \
--to=popovich_sergei@mail.ru \
--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 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).