Commit 4e79fd98 authored by Jinbum Park's avatar Jinbum Park Committed by Kleber Sacilotto de Souza

mac80211_hwsim: Fix possible Spectre-v1 for hwsim_world_regdom_custom

User controls @idx which to be used as index of hwsim_world_regdom_custom.
So, It can be exploited via Spectre-like attack. (speculative execution)

This kind of attack leaks address of hwsim_world_regdom_custom,
It leads an attacker to bypass security mechanism such as KASLR.

So sanitize @idx before using it to prevent attack.

I leveraged strategy [1] to find and exploit this gadget.

[1] https://github.com/jinb-park/linux-exploit/tree/master/exploit-remaining-spectre-gadget/Signed-off-by: default avatarJinbum Park <jinb.park7@gmail.com>
[johannes: unwrap URL]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>

CVE-2017-5753

(backported from commit 3a2af7cc)
[juergh: Adjusted context.]
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 144f0fbd
......@@ -30,6 +30,7 @@
#include <linux/module.h>
#include <linux/ktime.h>
#include <net/genetlink.h>
#include <linux/nospec.h>
#include "mac80211_hwsim.h"
#define WARN_QUEUE 100
......@@ -2925,6 +2926,9 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
kfree(hwname);
return -EINVAL;
}
idx = array_index_nospec(idx,
ARRAY_SIZE(hwsim_world_regdom_custom));
param.regd = hwsim_world_regdom_custom[idx];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment