lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220112173312.764660-28-miquel.raynal@bootlin.com>
Date:   Wed, 12 Jan 2022 18:33:12 +0100
From:   Miquel Raynal <miquel.raynal@...tlin.com>
To:     Alexander Aring <alex.aring@...il.com>,
        Stefan Schmidt <stefan@...enfreihafen.org>,
        linux-wpan@...r.kernel.org,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org
Cc:     Michael Hennerich <michael.hennerich@...log.com>,
        Harry Morris <h.morris@...coda.com>,
        Varka Bhadram <varkabhadram@...il.com>,
        Xue Liu <liuxuenetmail@...il.com>, Alan Ott <alan@...nal11.us>,
        David Girault <david.girault@...vo.com>,
        Romuald Despres <romuald.despres@...vo.com>,
        Frederic Blain <frederic.blain@...vo.com>,
        Nicolas Schodet <nico@...fr.eu.org>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        linux-wireless@...r.kernel.org,
        Miquel Raynal <miquel.raynal@...tlin.com>
Subject: [wpan-next v2 27/27] net: ieee802154: ca8210: Refuse most of the scan operations

The Cascada 8210 hardware transceiver is kind of a hardMAC which
interfaces with the softMAC and in practice does not support sending
anything else than dataframes. This means we cannot send any BEACON_REQ
during active scans nor any BEACON in general. Refuse these operations
officially so that the user is aware of the limitation.

Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>
---
 drivers/net/ieee802154/ca8210.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index d3a9e4fe05f4..49c274280e3c 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -2385,6 +2385,25 @@ static int ca8210_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
 	return link_to_linux_err(status);
 }
 
+static int ca8210_enter_scan_mode(struct ieee802154_hw *hw,
+				  struct cfg802154_scan_request *request)
+{
+	/* This xceiver can only send dataframes */
+	if (request->type != NL802154_SCAN_PASSIVE)
+		return -EOPNOTSUPP;
+
+	return 0;
+}
+
+static int ca8210_enter_beacons_mode(struct ieee802154_hw *hw,
+				     struct cfg802154_beacons_request *request)
+{
+	/* This xceiver can only send dataframes */
+	return -EOPNOTSUPP;
+}
+
+static void ca8210_exit_scan_beacons_mode(struct ieee802154_hw *hw) { }
+
 static const struct ieee802154_ops ca8210_phy_ops = {
 	.start = ca8210_start,
 	.stop = ca8210_stop,
@@ -2397,7 +2416,11 @@ static const struct ieee802154_ops ca8210_phy_ops = {
 	.set_cca_ed_level = ca8210_set_cca_ed_level,
 	.set_csma_params = ca8210_set_csma_params,
 	.set_frame_retries = ca8210_set_frame_retries,
-	.set_promiscuous_mode = ca8210_set_promiscuous_mode
+	.set_promiscuous_mode = ca8210_set_promiscuous_mode,
+	.enter_scan_mode = ca8210_enter_scan_mode,
+	.exit_scan_mode = ca8210_exit_scan_beacons_mode,
+	.enter_beacons_mode = ca8210_enter_beacons_mode,
+	.exit_beacons_mode = ca8210_exit_scan_beacons_mode,
 };
 
 /* Test/EVBME Interface */
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ