Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp310829pxj; Thu, 20 May 2021 09:50:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZP40wYE6yQJaHhXc6Auj8DYl0YpOqoxPDsFj3I9YBXMpVHEoT7tHSX6R29QgPzBHF84NI X-Received: by 2002:a50:fe94:: with SMTP id d20mr2145784edt.127.1621529437737; Thu, 20 May 2021 09:50:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529437; cv=none; d=google.com; s=arc-20160816; b=zpdxJjwd/MyMfXxAQiGQqH9Kewp5Cyug0UOtowdyxYOLd7o+dyYeMY8/douS1CZ85L ZYDD52mppEWMS1DMquGyOQhTkpL1X0tb53hO3jGpOnmztMRBrUBRKtQSxJY/eOESgu3C MXOz/y3bIGmGYLNB8UVDMnt9xzKYfnxBIIgoaJmIJNm9dQAUuJrzMrbRqpZbSJ6QjhJ7 UtSF7dAfhfmod+Vvad/YLva6ulIIBW5zrO6jI5ScNXluS0VipNixbfFEqlFBM9mdj7/Z TeSC4m/fI4QqMYCLLExq05Y2oI0j1QMB/TD+qt4OPISGQd9LqMWAXv1EbnTR34lcCB9/ cp3A== 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=EtWxE+yEQbLPY/yY7zyngK3pteDGSonTCA0Cea2KI2k=; b=ckRsUfq3nStT4KXFjetaYKpqrW2gKHdE3sX0Y01oi6/62HJyh/K6G76GwUkNzRaVfq 0ambirFSBj6W639q1fnjLSSV4qHZRLKDg6U+zEi0X1to1DDaFx+L1H19+/b0SIWAWI0e VLSGy4WBMS8cvCmP/37BOSFX8PfXacxnOKoD2HPNvSqVLzYWOpnkFABXG2g6eLo3CT4m dox22rHzo1iqa97+L1A4DDz93m7JdScvyWxbLbQXMqTnAdH8PYMGRmkporlzl2JnTXf7 +6PKr6TW2FyEmnBVbcp9W3O7WozwcXYVo21ThBx+k5Zmx+k9H9cBR0+aLrfiQkwCRnSe /8wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PzYNg2WF; 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 j7si489582ejn.636.2021.05.20.09.50.14; Thu, 20 May 2021 09:50:37 -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=PzYNg2WF; 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 S234378AbhETJxq (ORCPT + 99 others); Thu, 20 May 2021 05:53:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:55098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234201AbhETJvV (ORCPT ); Thu, 20 May 2021 05:51:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 171BF614A7; Thu, 20 May 2021 09:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503347; bh=PfdXGmhqVBBrByarCnCERALL2lUqO4JI4vzhzeQQ4Ck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PzYNg2WF2m3uSSq0rQm8lJyN6c8ul96w6GADP8UOOvxBbCdgInrzG2qgmf11WTwqW v44SXynlcSDP0nFd833gP4J3U9KfIyC19em/YfGbV1tqfT32lfq2nYjW1mLnEG0r+z BoXAFgwK6qzDG90M3y38Us/Fvg3NslzcmsVQNylM= 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.19 146/425] cfg80211: scan: drop entry from hidden_list on overflow Date: Thu, 20 May 2021 11:18:35 +0200 Message-Id: <20210520092136.224100000@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 @@ -1036,6 +1036,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; }