diff mbox series

[09/11] wifi: cfg80211: Add null check for ie data

Message ID 20230504134511.828474-10-gregory.greenman@intel.com
State New
Headers show
Series cfg80211/mac80211 patches from our internal tree 2023-05-04 | expand

Commit Message

Greenman, Gregory May 4, 2023, 1:45 p.m. UTC
From: Mukesh Sisodiya <mukesh.sisodiya@intel.com>

It's valid to pass NULL "ies" pointer to cfg80211_sme_get_conn_ies().
Add the corresponding NULL-check to avoid NULL pointer access.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 net/wireless/sme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Johannes Berg June 5, 2023, 11:38 a.m. UTC | #1
On Thu, 2023-05-04 at 16:45 +0300, gregory.greenman@intel.com wrote:
> From: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
> 
> It's valid to pass NULL "ies" pointer to cfg80211_sme_get_conn_ies().
> Add the corresponding NULL-check to avoid NULL pointer access.

Yes ... but it's not valid to do that when ies_len is 0, since you can't
have NULL ies with a length ...

So ... maybe we can do this patch but certainly the description is
bogus. Maybe you're trying to fix some static checker warnings or
something, which maybe is fine, but there was never any chance for an
NPD.

johannes
diff mbox series

Patch

diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 7bdeb8eea92d..77277e4bca50 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -513,7 +513,7 @@  static int cfg80211_sme_get_conn_ies(struct wireless_dev *wdev,
 	if (!buf)
 		return -ENOMEM;
 
-	if (ies_len) {
+	if (ies) {
 		static const u8 before_extcapa[] = {
 			/* not listing IEs expected to be created by driver */
 			WLAN_EID_RSN,