From: Dan Carpenter <dan.carpenter@oracle.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] nl80211: fix error pointer dereference in error handling
Date: Fri, 1 Oct 2021 15:56:16 +0300 [thread overview]
Message-ID: <20211001125616.GI2283@kili> (raw)
The error handling calls kfree(params->acl) so if "params->acl" is an
error pointer that will lead to an Oops.
Fixes: 9e263e193af7 ("nl80211: don't put struct cfg80211_ap_settings on stack")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
net/wireless/nl80211.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 0b4f29d689d2..962fb169a5fb 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5507,6 +5507,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
params->acl = parse_acl_data(&rdev->wiphy, info);
if (IS_ERR(params->acl)) {
err = PTR_ERR(params->acl);
+ params->acl = NULL;
goto out;
}
}
--
2.20.1
next reply other threads:[~2021-10-01 12:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 12:56 Dan Carpenter [this message]
2021-10-01 16:11 ` [PATCH] nl80211: fix error pointer dereference in error handling Johannes Berg
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=20211001125616.GI2283@kili \
--to=dan.carpenter@oracle.com \
--cc=johannes@sipsolutions.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-wireless@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