Skip to content

Commit 5fa0d9c

Browse files
elpgregkh
authored andcommitted
regulatory: add NUL to alpha2
commit a5fe8e7 upstream. 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. Signed-off-by: Eliad Peller <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 145f3d4 commit 5fa0d9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/regulatory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ struct ieee80211_reg_rule {
167167
struct ieee80211_regdomain {
168168
struct rcu_head rcu_head;
169169
u32 n_reg_rules;
170-
char alpha2[2];
170+
char alpha2[3];
171171
enum nl80211_dfs_regions dfs_region;
172172
struct ieee80211_reg_rule reg_rules[];
173173
};

0 commit comments

Comments
 (0)