Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/next/external/patch/misc/kali-wifi-injection-2.patch
Views: 3959
From c46a994dd78befbe94e66771db41c18351be2aae Mon Sep 17 00:00:00 20011From: Steve deRosier <[email protected]>2Date: Fri, 29 Sep 2017 10:48:19 -07003Subject: [PATCH] wireless: carl9170: Enable sniffer mode promisc flag to fix4injection56The removal of the AR9170_MAC_SNIFFER_ENABLE_PROMISC flag to fix an issue7many years ago caused the AR9170 to not be able to pass probe response8packets with different MAC addresses back up to the driver. In general9operation, this doesn't matter, but in the case of packet injection with10aireplay-ng it is important. aireplay-ng specifically injects packets with11spoofed MAC addresses on the probe requests and looks for probe responses12back to those addresses. No other combination of filter flags seem to fix13this issue and so AR9170_MAC_SNIFFER_ENABLE is required to get these packets.1415This was originally caused by commit e0509d3bdd7365d06c9bf570bf9f11 which16removed this flag in order to avoid spurious ack noise from the hardware.17In testing for this issue, keeping this flag but not restoring the18AR9170_MAC_RX_CTRL_ACK_IN_SNIFFER flag on the rc_ctrl seems to solve this19issue, at least with the most current firmware v1.9.9.2021Signed-off-by: Steve deRosier <[email protected]>22---23drivers/net/wireless/ath/carl9170/mac.c | 5 +++++241 file changed, 5 insertions(+)2526diff --git a/drivers/net/wireless/ath/carl9170/mac.c b/drivers/net/wireless/ath/carl9170/mac.c27index 7d4a72dc98db..c617e883f47a 10064428--- a/drivers/net/wireless/ath/carl9170/mac.c29+++ b/drivers/net/wireless/ath/carl9170/mac.c30@@ -309,6 +309,7 @@ int carl9170_set_operating_mode(struct ar9170 *ar)31u32 rx_ctrl = AR9170_MAC_RX_CTRL_DEAGG |32AR9170_MAC_RX_CTRL_SHORT_FILTER;33u32 sniffer = AR9170_MAC_SNIFFER_DEFAULTS;34+ u32 mac_ftf = AR9170_MAC_FTF_DEFAULTS;35int err = 0;3637rcu_read_lock();38@@ -373,6 +374,9 @@ int carl9170_set_operating_mode(struct ar9170 *ar)3940if (ar->sniffer_enabled) {41enc_mode |= AR9170_MAC_ENCRYPTION_RX_SOFTWARE;42+ mac_ftf = AR9170_MAC_FTF_MONITOR;43+ sniffer |= AR9170_MAC_SNIFFER_ENABLE_PROMISC;44+ mac_addr = NULL;45}4647err = carl9170_set_mac_reg(ar, AR9170_MAC_REG_MAC_ADDR_L, mac_addr);48@@ -384,6 +388,7 @@ int carl9170_set_operating_mode(struct ar9170 *ar)49return err;5051carl9170_regwrite_begin(ar);52+ carl9170_regwrite(AR9170_MAC_REG_FRAMETYPE_FILTER, mac_ftf);53carl9170_regwrite(AR9170_MAC_REG_SNIFFER, sniffer);54carl9170_regwrite(AR9170_MAC_REG_CAM_MODE, cam_mode);55carl9170_regwrite(AR9170_MAC_REG_ENCRYPTION, enc_mode);56--572.14.158596061