From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BD6D15E8B for ; Fri, 8 May 2026 02:17:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778206647; cv=none; b=XtzviWm/WiS+YEd9UPhTAb8aNOlPB6vwxJjaaLvSe+SRwiaVDStpwOsQJhUOP6Q05Y+gZgy4/a57HKy10IPLpoLbCKoql9MbSSSeO6/YLMbnQGVkvlEIbNEsimcXkfPCEuLCcm+FVpk5bWBlVvHc8jv9IKkDFlm/Fiv4LhoznNY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778206647; c=relaxed/simple; bh=H465SliCmb2jsOKBFN9TkAbtiUh88yXe6olqSdgR30w=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=pwome5ZFGC33sSwadqnaHH0rUOehdVhM3aFS6n5DT7zJh+mHwGmUbdpOuAlinmscTwqWSXxIRs/KxnimaN/ZI08MpT0NOlsNF/fJsGDy8XKc9VAbQGkiFzcIv1Sk0Etm93jHldrtWk5LIZ/oOz0twEwqKqoslvzgzcmw4UTpvrg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.210.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-7dbe0e914adso2755132a34.2 for ; Thu, 07 May 2026 19:17:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778206644; x=1778811444; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=D4MGVI7eQhrYezmWeC3XOYzFM2jBz+lF6pnf0PnoLl4=; b=IScSdEOe4s1UdQT2TS8GSNWsr8xwkONWc94wDZ3009DdEsBf6iKvs7SSgxJIm7V2Qd zfOgBtYwtjxABq6sf9LWlWjFsfZj+y/5/tg3w2kQR2qEHK+h9bVLgWbOqf6DLZPo870y sXR6EfCo3gY7NIH+MP1he1q8ENPYpsQI573qV5mPMnWexrdMIh7MXai6hIZ5u4xC9Mub cDv6efUdQROdDMxDDO/1PZHWQPi6+GN9KdhiVpX1WeT1jasbXcjHgqjO8INcfSIo7gie sUxNuxjZ0ioCc6ev3kgO63lc/yrKg+qKq1mm/l1IT/3tFusirY+9QvzIPP7VUEaMHVvN oOgw== X-Gm-Message-State: AOJu0Yyx92/LypUiNg25YnT0EBqGuzh4lpmEKK8NZFLvCxwannCG2oOf 1FhKh+YY6VPaEWKt5b/qKxBogmJLuEyiZWOOEe25PDm9y+F+hHJvvcp74VmW9BX1WQbKbqmXEqO 9z3vAaP/1sw2+W8fOyzxX+265IyBscuk5sEMO8epSxG3bOsTP/93/PQBoaAg= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:f034:b0:696:2b81:e0f9 with SMTP id 006d021491bc7-69998cbc49dmr6229559eaf.15.1778206644640; Thu, 07 May 2026 19:17:24 -0700 (PDT) Date: Thu, 07 May 2026 19:17:24 -0700 In-Reply-To: <69fd2ea3.170a0220.25a3d6.0008.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69fd47b4.a00a0220.a7d34.0001.GAE@google.com> Subject: Forwarded: [PATCH] wifi: mac80211_hwsim: reject NAN on multi-radio wiphys From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] wifi: mac80211_hwsim: reject NAN on multi-radio wiphys Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git main When userspace creates a new hwsim radio with both HWSIM_ATTR_MULTI_RADIO and HWSIM_ATTR_SUPPORT_NAN_DEVICE, hwsim_new_radio_nl() sets BIT(NL80211_IFTYPE_NAN_DATA) in wiphy->interface_modes while configuring the wiphy with n_radio > 1. This violates the invariant checked in wiphy_register(): (interface_modes & BIT(NL80211_IFTYPE_NAN_DATA)) && (!nan_capa.phy.ht.ht_supported || n_radio > 1) triggering a WARN reachable from userspace via genetlink. With panic_on_warn this becomes a denial of service. Refuse the combination at parse time with -EINVAL and an extack message, matching the cfg80211 constraint that NAN is not supported on multi-radio wiphys. Reported-by: syzbot+2002864e6c6895cb0ac3@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=2002864e6c6895cb0ac3 Signed-off-by: Deepanshu Kartikey --- drivers/net/wireless/virtual/mac80211_hwsim_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/virtual/mac80211_hwsim_main.c b/drivers/net/wireless/virtual/mac80211_hwsim_main.c index dc9775cd9f54..a625a9e3caa7 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim_main.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim_main.c @@ -6766,9 +6766,15 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info) param.p2p_device = true; } - if (param.nan_device) + if (param.nan_device) { + if (param.multi_radio) { + NL_SET_ERR_MSG(info->extack, + "NAN is not supported on multi-radio wiphys"); + return -EINVAL; + } param.iftypes |= BIT(NL80211_IFTYPE_NAN) | BIT(NL80211_IFTYPE_NAN_DATA); + } if (info->attrs[HWSIM_ATTR_CIPHER_SUPPORT]) { u32 len = nla_len(info->attrs[HWSIM_ATTR_CIPHER_SUPPORT]); -- 2.43.0