linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Eliad Peller <eliad@wizery.com>,
	Eliad Peller <eliadx.peller@intel.com>,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 7/7] regulatory: add NULL to alpha2
Date: Sun, 11 May 2014 11:50:50 +0300	[thread overview]
Message-ID: <1399798250-20987-8-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <1399798250-20987-1-git-send-email-emmanuel.grumbach@intel.com>

From: Eliad Peller <eliad@wizery.com>

alpha2 is defined as 2-chars array, but is used in multiple
places as string (e.g. with nla_put_string calls), which
might leak kernel data.

Solve it by simply adding an extra char for the NULL
terminator, making such operations safe.

Change-Id: Ib31639dc65deab62953923cab3cdf169cb1d0d32
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 include/net/regulatory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index 2599924..dad7ab2 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -167,7 +167,7 @@ struct ieee80211_reg_rule {
 struct ieee80211_regdomain {
 	struct rcu_head rcu_head;
 	u32 n_reg_rules;
-	char alpha2[2];
+	char alpha2[3];
 	enum nl80211_dfs_regions dfs_region;
 	struct ieee80211_reg_rule reg_rules[];
 };
-- 
1.8.3.2


  parent reply	other threads:[~2014-05-11  8:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-11  8:50 [PATCH 0/7] regulatory enhancements Emmanuel Grumbach
2014-05-11  8:50 ` [PATCH 1/7] cfg80211: don't set reg timeout for user-handled hint Emmanuel Grumbach
2014-05-12  6:47   ` Kalle Valo
2014-05-12  6:49     ` Grumbach, Emmanuel
2014-05-12  7:48       ` Johannes Berg
2014-05-20  8:09   ` Luis R. Rodriguez
2014-05-20 13:21   ` Johannes Berg
2014-05-11  8:50 ` [PATCH 2/7] cfg80211: introduce regulatory flags controlling bw Emmanuel Grumbach
2014-05-20  8:26   ` Luis R. Rodriguez
2014-05-20  8:33     ` Arik Nemtsov
2014-05-20  8:51       ` Luis R. Rodriguez
2014-05-20  9:25         ` Arik Nemtsov
2014-05-20  9:54           ` Luis R. Rodriguez
2014-05-20 12:31             ` Arik Nemtsov
2014-06-10 21:28               ` Luis R. Rodriguez
2014-06-11  5:24                 ` Arik Nemtsov
2014-06-11  6:21                   ` Janusz Dziedzic
2014-06-11  6:38                     ` Arik Nemtsov
2014-06-18 21:50                   ` Luis R. Rodriguez
2014-05-11  8:50 ` [PATCH 3/7] cfg80211: allow drivers to provide regulatory settings Emmanuel Grumbach
2014-05-20  8:44   ` Luis R. Rodriguez
2014-05-20  9:12     ` Arik Nemtsov
2014-05-20  9:53       ` Luis R. Rodriguez
2014-05-20 12:00         ` Arik Nemtsov
2014-06-10 21:43           ` Luis R. Rodriguez
2014-06-11  5:51             ` Arik Nemtsov
2014-05-11  8:50 ` [PATCH 4/7] cfg80211: treat the special "unknown" alpha2 as valid Emmanuel Grumbach
2014-05-11  8:50 ` [PATCH 5/7] cfg80211: accept world/same regdom from driver/user hints Emmanuel Grumbach
2014-05-11  8:50 ` [PATCH 6/7] cfg80211: leave invalid channels on regdomain change Emmanuel Grumbach
2014-05-11  8:50 ` Emmanuel Grumbach [this message]
2014-05-20  8:48 ` [PATCH 0/7] regulatory enhancements Luis R. Rodriguez
2014-06-10 21:44   ` Luis R. Rodriguez
2014-06-11  5:20     ` Arik Nemtsov

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=1399798250-20987-8-git-send-email-emmanuel.grumbach@intel.com \
    --to=emmanuel.grumbach@intel.com \
    --cc=eliad@wizery.com \
    --cc=eliadx.peller@intel.com \
    --cc=johannes@sipsolutions.net \
    --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;
as well as URLs for NNTP newsgroup(s).