Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3259236rwb; Mon, 15 Aug 2022 22:32:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR5It+5X+uR/2D2kHrXcI+iH1veXX0cUd26PajzAEGYnnEkl7QGo/GmmCeD2LZp9M/WuQD6Z X-Received: by 2002:a05:6402:40ce:b0:43d:f8a0:9c4f with SMTP id z14-20020a05640240ce00b0043df8a09c4fmr17723198edb.95.1660627973536; Mon, 15 Aug 2022 22:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660627973; cv=none; d=google.com; s=arc-20160816; b=aZeVftHCqG5OK8FztF0uAOp2AEWLW/TGCJSjHM9EV9/eaq9B9018tF4iJAgH2yd8iD P/oo2UzuCM2ZsEpIKXR55bz890ZBqv6anSNCqxFo+qex2RGownv+xTpAbgzGLUhy58/X zCT4Ml+MRy1hby2m+PkkQX23pHwEEOaNSifQfm5fATqPR3ZWZcGt+bCzu0rERUiOebe/ k/cNodADVnUAceHbPJ5LXV0Daur4el7QNiZ31YMmzymIJAOe6IJVyK3bX+9wba2+lk4J 0JwqnR7S5fo/NrcI20vnmL+Zwi+/w9HfiNu+U055O5scPeBWWj9A1V9/42MWT9od6qbs gPdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FNvP169G+kvi5kpoLsbhhwN4hUVlJruaG/T1/WqFET0=; b=jvhXqjeS0/iKQuIUry9UFoV2NnHRAuTWEcXeUqIyzZSdc5j4fZl3SQPDjX3UzwYY3b Sl5D+MCdwANBEsPr7RY97UoXDSuDuXhMeH3snEcV8y//qP3U6XC21X98o3j0FzGa5Nal ldrOMWL8SWGtKLp692wpjDf3ZkzgHAIpzzfmT+mo2Qieo9t0nrtijYZyAWnZE8a3uorg U2LX4DlSWsLRUSLF1y+UBNqt6uQD8ahDvnh0GJregYtQ1iYR44rOl/uqf3kFeXb6CUDm A6gT9b6ohgOoIU9p9kLoVriAkuhBeJG9Osz2cUe7t10/qn49YfPetf0pr2xhLwyKr43z OJEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b0woAm0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10-20020a50fd0a000000b0043dafb921f0si7492828eds.617.2022.08.15.22.32.28; Mon, 15 Aug 2022 22:32:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b0woAm0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233479AbiHPE4i (ORCPT + 99 others); Tue, 16 Aug 2022 00:56:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233995AbiHPEz6 (ORCPT ); Tue, 16 Aug 2022 00:55:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB95FE0A8; Mon, 15 Aug 2022 13:51:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 324F3B811AE; Mon, 15 Aug 2022 20:50:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75983C433D7; Mon, 15 Aug 2022 20:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596656; bh=J0ycxpS4pz0mQ35m3dePt8F7dDXGXxiCq9z7Kw0TkRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b0woAm0BEy5+QQty13ps1WbC9cur/8ma0l+e4Xu82FFzDiFzjBgWQCKm0HwuvJJfI 1CDHl1jNOgxqKTpIPsG8CISwS+XM4s+lCNCuqYzqr/9zQlJorVRyPvHZa42zg8izn4 HQSI7pkw8hBw9lAG+7bu3ztuxmK083kdrPyGRYRs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+b4e9aa0f32ffd9902442@syzkaller.appspotmail.com, Johannes Berg Subject: [PATCH 5.19 1148/1157] wifi: nl80211: hold wdev mutex for tid config Date: Mon, 15 Aug 2022 20:08:24 +0200 Message-Id: <20220815180526.445027831@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg commit 206bbcf76121664e95a42e1c014c3fe168d07a3d upstream. We need wdev_chandef() in this code, which now requires the wdev mutex due to the per-link nature. Hold it here to make sure we can access the link. Reported-by: syzbot+b4e9aa0f32ffd9902442@syzkaller.appspotmail.com Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/wireless/nl80211.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -15285,6 +15285,8 @@ static int nl80211_set_tid_config(struct if (info->attrs[NL80211_ATTR_MAC]) tid_config->peer = nla_data(info->attrs[NL80211_ATTR_MAC]); + wdev_lock(dev->ieee80211_ptr); + nla_for_each_nested(tid, info->attrs[NL80211_ATTR_TID_CONFIG], rem_conf) { ret = nla_parse_nested(attrs, NL80211_TID_CONFIG_ATTR_MAX, @@ -15306,6 +15308,7 @@ static int nl80211_set_tid_config(struct bad_tid_conf: kfree(tid_config); + wdev_unlock(dev->ieee80211_ptr); return ret; }