Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp544565pxj; Thu, 20 May 2021 15:50:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoIA1oJyj2dL2i/fGQsOk/3y+mxk1oUltqOIm9o+BfUBAObcd+iwuB/qbdTtJO1/nS3KPN X-Received: by 2002:a6b:5c18:: with SMTP id z24mr7304175ioh.127.1621551029573; Thu, 20 May 2021 15:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621551029; cv=none; d=google.com; s=arc-20160816; b=zu60koElu0RvkTEVmr2hb65H3n/9su22PRwyJmzk1uLCGunvKp/3oO5Su4T7Eo7F1O gxwSFbh+bMRf6n6WqPOBcMfOiOyhoIeLGVNLIni3Ab3HBPGNlAzJrXPbwkHd5AJpx0/J Akgq5zKE/CZtkUbblk/EUnPtJC4juaeyQbKgAwOy0FjS/ecA6xTA+mlxo5V/O+8b8xyh IBToSNe9JV/uPCL6yINeInfXhgg+02PvdFFUoRbGuvCuBlGPMux0P5OyL91gLAccZH5r bNYTxGLn1ehD1mAeNQS0f7MaW7tzrI0sWzZURM/QWJTabkmu1QKlqMJH00wyG2B19Gpj XwrQ== 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=Lpa7wFCc68BFuRXbKBiifc4vHVXT9jpFERVIRSfT7hM=; b=iUFa1kG0TLd5sJGLJolTD9tjgYGRZf1xyFk803X+ikp6u0qa6KivEmLVBo8FyTDiJt 1ldCB0iAD8OOWcTBp35pEZnsWn35ZLyo45V1PGiasMo0VNlCNrh43zkXc+Tdjc3O4MOA QLRe8tiGmcsumsGv1bawNpETplC7LK+m8NdPFK0tqVXhlGkNn5eXiMkNw0w45jJ/fzJk JPCfjmxSyRe3JvTTmuWbi6T6PIc3cENe6K/rzv4fctBICPRSoNRrF5v/cJcLwNc3xz3p ZLl5b7Inn9zOSRC5b0rOmUQO4+0QUuGtww8G5MaP05AyGlm7WY3Fuc6SAqREmXfchvRn Dltg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J9au3vsT; 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 g5si3802911ilq.106.2021.05.20.15.50.15; Thu, 20 May 2021 15:50:29 -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=J9au3vsT; 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 S239444AbhETLLF (ORCPT + 99 others); Thu, 20 May 2021 07:11:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:49448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239062AbhETKuv (ORCPT ); Thu, 20 May 2021 06:50:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 32A3861CBE; Thu, 20 May 2021 09:59:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504793; bh=jAgXn5Y5+zNwOvtTy3DMpUoC0Tqnqy/XB5rd4KL8gRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J9au3vsTbKzYG4JLgHMw0TqSDkDmwsS6h0OZC1ZSSB0RBdh8WpRy3nZMC9gAfoFMq nrgMSF79nInEOcQqnkmuTaIKV7bSe8ZHPdoVTnp0u0UfjZX6exFRkP1XAl6+4JtGsU gZD0QaR81t5OdyhgpohygmJMeAgs50p+Camdg3GA= 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.9 084/240] cfg80211: scan: drop entry from hidden_list on overflow Date: Thu, 20 May 2021 11:21:16 +0200 Message-Id: <20210520092111.508364012@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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 @@ -956,6 +956,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; }