Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stefan Schmidt <stefan@datenfreihafen.org>
To: Tuo Li <islituo@gmail.com>,
	alex.aring@gmail.com, davem@davemloft.net, kuba@kernel.org
Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, baijiaju1990@gmail.com,
	TOTE Robot <oslab@tsinghua.edu.cn>
Subject: Re: [PATCH] ieee802154: hwsim: fix possible null-pointer dereference in mac802154_hwsim.c
Date: Wed, 11 Aug 2021 22:08:39 +0200	[thread overview]
Message-ID: <7f799a83-0709-d81a-6b45-88f8fafa3b3a@datenfreihafen.org> (raw)
In-Reply-To: <20210811023654.2971-1-islituo@gmail.com>

Hello.

On 11.08.21 04:36, Tuo Li wrote:
> In hwsim_new_edge_nl() and hwsim_set_edge_lqi(), if only one of the two
> info->attrs is NULL, the functions will not return.
>    if (!info->attrs[MAC802154_HWSIM_ATTR_RADIO_ID] &&
>        !info->attrs[MAC802154_HWSIM_ATTR_RADIO_EDGE])
> 	  return -EINVAL;
> 
> However, both of them may be dereferenced in the function
> nla_parse_nested_deprecated(), causing a null-pointer dereference.
> To fix this possible null-pointer dereference, the function returns
> -EINVAL if any info_attr is NULL.
> 
> Similarly, in hwsim_set_edge_lqi(), if only one of the two edge_attrs is
> NULL, both nla_get_u32() and nla_get_u8() will be called, causing a
> null-pointer dereference.
> Also, to fix this possible null-pointer dereference, the function returns
> -EINVAL if any edge_attr is NULL.
> 
> Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
> Signed-off-by: Tuo Li <islituo@gmail.com>

Thanks for your patch. This has already been fixed with patches in the 
wpan tree.
https://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan.git/

I just sent a pull request including them to get pulled into net.

regards
Stefan Schmidt

      reply	other threads:[~2021-08-11 20:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11  2:36 Tuo Li
2021-08-11 20:08 ` Stefan Schmidt [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=7f799a83-0709-d81a-6b45-88f8fafa3b3a@datenfreihafen.org \
    --to=stefan@datenfreihafen.org \
    --cc=alex.aring@gmail.com \
    --cc=baijiaju1990@gmail.com \
    --cc=davem@davemloft.net \
    --cc=islituo@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oslab@tsinghua.edu.cn \
    --subject='Re: [PATCH] ieee802154: hwsim: fix possible null-pointer dereference in mac802154_hwsim.c' \
    /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

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).