Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp62836pxj; Thu, 20 May 2021 04:38:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0Jb/69XgvHzwbdq0Ul5XQ5F/MlJ8ssuEkD5KZWWUJ/5zc/+/YHR0ot5uhdSTAwntVcgqJ X-Received: by 2002:aa7:cd8b:: with SMTP id x11mr4546938edv.87.1621510700877; Thu, 20 May 2021 04:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510700; cv=none; d=google.com; s=arc-20160816; b=cHfWeV817Sf+3NH3IezMWdEcOC2nGAjB5suE33/9YXgOouarTtB/PY4gMkQ7yif1fL XU4cHwcdb2gtj0VlvPsr+XmV1w0pEjsPSo7huPSIG97Qzh3J4RudgHdfeo2S6XTCbUk4 Zsu/7868fuuTxKKEEJKzvIWMTFV2pGyOMwQFIeEUfqZexI2ls/Zbv6NWKHTPFDSssfrt MYI4lnpGnRxK4Z88COyRnCN+LCohYW/ARMRZj53b4TTvRPwOmQx38DGyN7xe7y46EViw MHyDV/x6xppbmv2P/gA2oJJIvdNd/6jvsJuUlbTRY51NVBD9x0oEXVeXcmrMnizE1a6/ JjOg== 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=rClSzXVEcmByzXDyzgeNDL7cnQguulRslA/Z9sMKGEc=; b=BMfyhBkWt1Zewa1JPq3h1fdkFkRfIb3fjfQHexfAUq+8nTF4So0Phz44mMMaU2sxwb C3Aocu9L19E65a9cHmZi4mjJETreolYciVY1Xxk4fNYGj42NMDWn4z7J7Rbjcisr9guA aIUMkh5MSk3IW7ip0/e6RzOk7b03Jtm6JAw6XvQBcOrRrsnASYQJUmKVxwCICOMHco5S lSNjfvTPJHKZrN+iho0pDp9VIi3+6XVwrwAarA0IfiKUYus6vchyNXJ2FQf0sn/6uZ9I OzeerHxPCiIEAGkUvUhVx0TFIySvak7/rlhvRy/vHdR6pYMuSB62YARtIe5IpotDDWlt f09g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K1AbjdZA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si2039649edb.4.2021.05.20.04.37.57; Thu, 20 May 2021 04:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K1AbjdZA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S241965AbhETLeO (ORCPT + 99 others); Thu, 20 May 2021 07:34:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:55582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239525AbhETLNX (ORCPT ); Thu, 20 May 2021 07:13:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1FDCD6121E; Thu, 20 May 2021 10:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505293; bh=QdV5bnJOeFklBnaoyUzVwmOrkL9ccU9dIhwypz1B5q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K1AbjdZAcddamRlwi8SHbHjdnFkpMbieLIPQpVQuneTqWHKgz0IYbBNOq8rzaZXx7 CFrVhU1xPMPw1qVbEHKjlHJMIErbwdMXph03xdYMFMsJyRvqk+7GgHfD1LpoYbz1w5 3970hy15Z6naWOfRRZx9KdrUHmuDcVUiSMIIebh0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Johannes Berg Subject: [PATCH 4.4 068/190] cfg80211: scan: drop entry from hidden_list on overflow Date: Thu, 20 May 2021 11:22:12 +0200 Message-Id: <20210520092104.423263007@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg commit 010bfbe768f7ecc876ffba92db30432de4997e2a upstream. If we overflow the maximum number of BSS entries and free the new entry, drop it from any hidden_list that it may have been added to in the code above or in cfg80211_combine_bsses(). Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/20210416094212.5de7d1676ad7.Ied283b0bc5f504845e7d6ab90626bdfa68bb3dc0@changeid Cc: stable@vger.kernel.org Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/wireless/scan.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -954,6 +954,8 @@ cfg80211_bss_update(struct cfg80211_regi if (rdev->bss_entries >= bss_entries_limit && !cfg80211_bss_expire_oldest(rdev)) { + if (!list_empty(&new->hidden_list)) + list_del(&new->hidden_list); kfree(new); goto drop; }