Forwarded: [PATCH] mac802154: test patch for security parameter handling

syzbot posted 1 patch 5 hours ago
net/mac802154/iface.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
Forwarded: [PATCH] mac802154: test patch for security parameter handling
Posted by syzbot 5 hours ago
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] mac802154: test patch for security parameter handling
Author: katharasasikumar007@gmail.com

Signed-off-by: Kathara Sasikumar <katharasasikumar007@gmail.com>
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

---
 net/mac802154/iface.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index 9e4631fade90..48220e645e4f 100644
--- a/net/mac802154/iface.c
+++ b/net/mac802154/iface.c
@@ -328,8 +328,14 @@ static int mac802154_set_header_security(struct ieee802154_sub_if_data *sdata,
 
 	mac802154_llsec_get_params(&sdata->sec, &params);
 
-	if (!params.enabled && cb->secen_override && cb->secen)
-		return -EINVAL;
+	if (!cb->secen_override) {
+        	if (!params.enabled)
+                	return 0;
+	} else {
+        	if (cb->secen && !params.enabled)
+                	return -EINVAL;
+	}
+
 	if (!params.enabled ||
 	    (cb->secen_override && !cb->secen) ||
 	    !params.out_level)
-- 
2.51.0