From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Aloka Dixit <alokad@codeaurora.org>,
johannes@sipsolutions.net
Cc: lkp@intel.com, kbuild-all@lists.01.org,
linux-wireless@vger.kernel.org,
Aloka Dixit <alokad@codeaurora.org>
Subject: Re: [PATCH 1/2] nl80211: FILS discovery/bcast probe resp support
Date: Tue, 26 May 2020 17:45:01 +0300 [thread overview]
Message-ID: <20200526144501.GY30374@kadam> (raw)
In-Reply-To: <20200522221921.19347-2-alokad@codeaurora.org>
[-- Attachment #1: Type: text/plain, Size: 4303 bytes --]
Hi Aloka,
url: https://github.com/0day-ci/linux/commits/Aloka-Dixit/FILS-discovery-and-bcast-probe-resp-support/20200523-062228
base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: x86_64-defconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
net/wireless/nl80211.c:4771 nl80211_parse_fd_bcastpresp() error: we previously assumed 'tmpl' could be null (see line 4766)
# https://github.com/0day-ci/linux/commit/d7497e63c41decf82e86f11b0691e47e24b11122
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout d7497e63c41decf82e86f11b0691e47e24b11122
vim +/tmpl +4771 net/wireless/nl80211.c
d7497e63c41dec Aloka Dixit 2020-05-22 4738 static int nl80211_parse_fd_bcastpresp(struct genl_info *info,
d7497e63c41dec Aloka Dixit 2020-05-22 4739 struct cfg80211_ap_settings *params)
d7497e63c41dec Aloka Dixit 2020-05-22 4740 {
d7497e63c41dec Aloka Dixit 2020-05-22 4741 struct nlattr *tmpl;
d7497e63c41dec Aloka Dixit 2020-05-22 4742 struct nlattr *tb[NL80211_FD_BCASTPRESP_ATTR_MAX + 1];
d7497e63c41dec Aloka Dixit 2020-05-22 4743 int ret;
d7497e63c41dec Aloka Dixit 2020-05-22 4744 struct cfg80211_beacon_data *beacon = ¶ms->beacon;
d7497e63c41dec Aloka Dixit 2020-05-22 4745 struct cfg80211_fd_bcastpresp *cfg;
d7497e63c41dec Aloka Dixit 2020-05-22 4746
d7497e63c41dec Aloka Dixit 2020-05-22 4747 if (params->chandef.center_freq1 <= 5940 &&
d7497e63c41dec Aloka Dixit 2020-05-22 4748 params->chandef.center_freq1 >= 7105)
d7497e63c41dec Aloka Dixit 2020-05-22 4749 return -EOPNOTSUPP;
d7497e63c41dec Aloka Dixit 2020-05-22 4750
d7497e63c41dec Aloka Dixit 2020-05-22 4751 ret = nla_parse_nested(tb, NL80211_FD_BCASTPRESP_ATTR_MAX,
d7497e63c41dec Aloka Dixit 2020-05-22 4752 info->attrs[NL80211_ATTR_FD_BCASTPRESP_CFG],
d7497e63c41dec Aloka Dixit 2020-05-22 4753 fd_bcastpresp_policy, NULL);
d7497e63c41dec Aloka Dixit 2020-05-22 4754 if (ret)
d7497e63c41dec Aloka Dixit 2020-05-22 4755 return ret;
d7497e63c41dec Aloka Dixit 2020-05-22 4756
d7497e63c41dec Aloka Dixit 2020-05-22 4757 if (!tb[NL80211_FD_BCASTPRESP_ATTR_TYPE] ||
d7497e63c41dec Aloka Dixit 2020-05-22 4758 !tb[NL80211_FD_BCASTPRESP_ATTR_INT])
d7497e63c41dec Aloka Dixit 2020-05-22 4759 return -EINVAL;
d7497e63c41dec Aloka Dixit 2020-05-22 4760
d7497e63c41dec Aloka Dixit 2020-05-22 4761 cfg = ¶ms->fd_bcastpresp;
d7497e63c41dec Aloka Dixit 2020-05-22 4762 cfg->type = nla_get_u8(tb[NL80211_FD_BCASTPRESP_ATTR_TYPE]);
d7497e63c41dec Aloka Dixit 2020-05-22 4763 cfg->interval = nla_get_u32(tb[NL80211_FD_BCASTPRESP_ATTR_INT]);
d7497e63c41dec Aloka Dixit 2020-05-22 4764
d7497e63c41dec Aloka Dixit 2020-05-22 4765 tmpl = tb[NL80211_FD_BCASTPRESP_ATTR_TMPL];
d7497e63c41dec Aloka Dixit 2020-05-22 @4766 if (!tmpl && !beacon->fils_disc_len && !beacon->bcast_presp_len)
Should the && be ||?
d7497e63c41dec Aloka Dixit 2020-05-22 4767 return -EINVAL;
d7497e63c41dec Aloka Dixit 2020-05-22 4768
d7497e63c41dec Aloka Dixit 2020-05-22 4769 if (cfg->type == CFG80211_TYPE_FILS_DISCOVERY) {
d7497e63c41dec Aloka Dixit 2020-05-22 4770 beacon->fils_disc = nla_data(tmpl);
d7497e63c41dec Aloka Dixit 2020-05-22 @4771 beacon->fils_disc_len = nla_len(tmpl);
^^^^
Unchecked dereference.
d7497e63c41dec Aloka Dixit 2020-05-22 4772 } else if (cfg->type == CFG80211_TYPE_BCAST_PROBE_RESP) {
d7497e63c41dec Aloka Dixit 2020-05-22 4773 beacon->bcast_presp = nla_data(tmpl);
d7497e63c41dec Aloka Dixit 2020-05-22 4774 beacon->bcast_presp_len = nla_len(tmpl);
d7497e63c41dec Aloka Dixit 2020-05-22 4775 }
d7497e63c41dec Aloka Dixit 2020-05-22 4776
d7497e63c41dec Aloka Dixit 2020-05-22 4777 return 0;
d7497e63c41dec Aloka Dixit 2020-05-22 4778 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29124 bytes --]
next prev parent reply other threads:[~2020-05-26 14:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-22 22:19 [PATCH 0/2] FILS discovery and bcast probe resp support Aloka Dixit
2020-05-22 22:19 ` [PATCH 1/2] nl80211: FILS discovery/bcast " Aloka Dixit
2020-05-25 7:52 ` kbuild test robot
2020-05-26 14:45 ` Dan Carpenter [this message]
2020-05-22 22:19 ` [PATCH 2/2] mac80211: FILS disc/bcast probe resp config Aloka Dixit
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=20200526144501.GY30374@kadam \
--to=dan.carpenter@oracle.com \
--cc=alokad@codeaurora.org \
--cc=johannes@sipsolutions.net \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lkp@intel.com \
/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).