]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
carl9170: prevent speculative execution
authorElena Reshetova <elena.reshetova@intel.com>
Wed, 30 Aug 2017 10:43:39 +0000 (13:43 +0300)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 5 Feb 2018 15:55:59 +0000 (16:55 +0100)
CVE-2017-5753 (Spectre v1 Intel)

Since the queue value in function carl9170_op_conf_tx()
seems to be controllable by userspace and later on
conditionally (upon bound check) used to resolve
ar9170_qmap and following ar->edcf, insert an observable
speculation barrier before its usage. This should prevent
observable speculation on that branch and avoid
kernel memory leak.

Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/wireless/ath/carl9170/main.c

index 988c8857d78c9d21abbe3b007ce605b13e04b109..cf267b709af6638138a3474474a68f0792532789 100644 (file)
@@ -1388,6 +1388,7 @@ static int carl9170_op_conf_tx(struct ieee80211_hw *hw,
 
        mutex_lock(&ar->mutex);
        if (queue < ar->hw->queues) {
+               osb();
                memcpy(&ar->edcf[ar9170_qmap[queue]], param, sizeof(*param));
                ret = carl9170_set_qos(ar);
        } else {