Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4439132rdh; Wed, 29 Nov 2023 01:16:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGn8hg+MnUq0JrBq7Y6cIv2zL8N0dCbT7iqqAussugOGE0iYOKWDqLeHqnlP38cYrglPkNF X-Received: by 2002:a05:6a00:2d94:b0:6c4:d615:2169 with SMTP id fb20-20020a056a002d9400b006c4d6152169mr36798845pfb.10.1701249388112; Wed, 29 Nov 2023 01:16:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701249388; cv=none; d=google.com; s=arc-20160816; b=o5EILfy0UnqGK92WMDWLlweVP5q4h8ZQ+ZPv0itCleS2wmaDh2Ax7etNw5aUbnXA/Y WfqR3qalL+7QGHCgTcdH38feNV5UJvIL8cki43+fg96DcQBx0qEWebKPsQMU98ThWRjJ /HN0GO81UtWQwFatb48BxzfhCnMwnrzZ92f321O/TSQmUjbxMMhIhpO6a3FsdunXztYb Cglo/67hfRMmF/jKjdJXOc5U7xgT9EHDcmSIQjKffA/Zd6hB7ljCDOnyHO0TjLVFZudf OofvfvfWmuvB7I7eMkXJ7i8mSVTkOPFqVQnSAEAPosItsNaEMJuYSS170j3D53vBvp4I M4sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=eQwJTZYRx3LOEKLgH4dhH9QWBCcY6L5CkgMzMJz45eY=; fh=uo38ucHzoKor7/TCv9Kjgs/NHAhIrZXqoECGHQIVGvw=; b=diQCwx4duHxVEQO9WM6W5+GpnErHlNCDYgAps+SHLE33IHeuNmkYbzehu288vG+kWY bseDM5Y7j6/IemRrYbPCFBMev3+QaJcqKO+ffhZqzyTnPn765cMHf+cKBbaSm2ZPsjZ6 8llqsZqW/yHjEtKb3CmQHX1IfP5Fb7HpSr/GrQwnTpukheXNcJ5K/iAGYTct1VHcajiM MhzdfCBLRy/7ZAKPWAqStJeVofWA2qmpoFfCCZEVyeJpw8jCnXIanW1mr4T2uhqTyU16 6YF2iGkbS/I670TLVSxWlnFnrfCcO1/OY4Q8d5LmSla9tuyVJ+f9OxtrUEV1O22p+7Xl 1U4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=SnkI84eN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u4-20020a63d344000000b005c289c5cb5fsi13783869pgi.445.2023.11.29.01.16.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 01:16:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=SnkI84eN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 70BC3809214D; Wed, 29 Nov 2023 01:16:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233473AbjK2JQG (ORCPT + 99 others); Wed, 29 Nov 2023 04:16:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233068AbjK2JPT (ORCPT ); Wed, 29 Nov 2023 04:15:19 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 601C41FDF; Wed, 29 Nov 2023 01:15:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=eQwJTZYRx3LOEKLgH4dhH9QWBCcY6L5CkgMzMJz45eY=; t=1701249312; x=1702458912; b=SnkI84eNdN/GEVkd1IOO5NmO8V0GpjbGCmElF8Lpsgm6eR5 YWwlDj9f0++zN9YUYcPq2KevMbPXFBTqi64VYj+V3d6LFwXbnXZS6YdwqMtKjJSRvHS+TfvPBsa2P xu60wjRE68S3xzsmFBbr5Ks6Ce74giMv+Qv1FHWefwZ2JMXIc5r7o2AHZ3vW5gdseESVGvH8jemEL iW0BIDe9n+fLIHF8DysA4VWcxdn07tSBRCGQxAhOz1Hg7WfRbK0XPgJvYSueTvvy3TzZYprbgp7tH gUdodW7lSKqIGIpwJqHEHFBbldRc6ayHmHdR7lw+Ake3VZpKH8o5nSDNa+BmI78g==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1r8Gev-00000008bo2-0c7n; Wed, 29 Nov 2023 10:15:05 +0100 Message-ID: <52e6ba0affb1648edd3ffd25fb6d8199a39a2f51.camel@sipsolutions.net> Subject: Re: [PATCH] wifi: mac80211: sband's null check should precede params From: Johannes Berg To: Edward Adam Davis Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, llvm@lists.linux.dev, nathan@kernel.org, ndesaulniers@google.com, netdev@vger.kernel.org, pabeni@redhat.com, syzbot+62d7eef57b09bfebcd84@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com, trix@redhat.com Date: Wed, 29 Nov 2023 10:15:03 +0100 In-Reply-To: References: <56d8b3b9099d3935a7b53e976fa998f06fbfd9a5.camel@sipsolutions.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 29 Nov 2023 01:16:25 -0800 (PST) On Wed, 2023-11-29 at 16:48 +0800, Edward Adam Davis wrote: > On Wed, 29 Nov 2023 09:33:23 +0100, Johannes Berg wrote: > > > > > [Analysis] > > > > > When ieee80211_get_link_sband() fails to find a valid sband and f= irst checks > > > > > for params in sta_link_apply_parameters(), it will return 0 due t= o new_link > > > > > being 0, which will lead to an incorrect process after sta_apply_= parameters(). > > > > >=20 > > > > > [Fix] > > > > > First obtain sband and perform a non null check before checking t= he params. > > > >=20 > > > > Not sure I can even disagree with that analysis, it seems right, bu= t ... > > > >=20 > > > > > + if (!link || !link_sta) > > > > > + return -EINVAL; > > > > > + > > > > > + sband =3D ieee80211_get_link_sband(link); > > > > > + if (!sband) > > > > > + return -EINVAL; > > > > > + > > > > > /* > > > > > * If there are no changes, then accept a link that doesn't exi= st, > > > > > * unless it's a new link. > > > >=20 > > > > There's a comment here which is clearly not true after this change, > > > > since you've already returned for !link_sta? > > > No, after applying my patch, it will return due to !sband. > > >=20 > >=20 > > Right, OK, but the way I read the comment (now) is that it wanted to > > accept it in that case? > >=20 > > That said, I just threw the patch into our internal testing machinery > > quickly (probably has more MLO tests than upstream hostap for now), and > > it worked just fine ... > >=20 > > Maybe we should just remove the comment? > Do you mean to delete the comments below? > 3 /* > 2 * If there are no changes, then accept a link that doesn't = exist, > 1 * unless it's a new link. > 1800 */ >=20 Right, it doesn't seem correct any more? johannes