]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mwifiex: fix unbalanced locking in mwifiex_process_country_ie()
authorBrian Norris <briannorris@chromium.org>
Mon, 6 Jan 2020 22:42:12 +0000 (14:42 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 28 Apr 2020 18:02:14 +0000 (19:02 +0100)
commit 65b1aae0d9d5962faccc06bdb8e91a2a0b09451c upstream.

We called rcu_read_lock(), so we need to call rcu_read_unlock() before
we return.

Fixes: 3d94a4a8373b ("mwifiex: fix possible heap overflow in mwifiex_process_country_ie()")
Cc: huangwen <huangwenabc@gmail.com>
Cc: Ganapathi Bhat <ganapathi.bhat@nxp.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Acked-by: Ganapathi Bhat <ganapathi.bhat@nxp.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
[bwh: Backported to 3.16: adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/wireless/mwifiex/sta_ioctl.c

index 5326a0095601f8315efc680a9375c846b28fe7e7..501505f2e3c718adf244a236d6bcf2e8c89e56eb 100644 (file)
@@ -226,6 +226,7 @@ static int mwifiex_process_country_ie(struct mwifiex_private *priv,
 
        if (country_ie_len >
            (IEEE80211_COUNTRY_STRING_LEN + MWIFIEX_MAX_TRIPLET_802_11D)) {
+               rcu_read_unlock();
                wiphy_dbg(priv->wdev->wiphy,
                          "11D: country_ie_len overflow!, deauth AP\n");
                return -EINVAL;