From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C14453C417F for ; Mon, 8 Jun 2026 17:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780939452; cv=none; b=HMuwItfYbjFqOzzNKTC9VzN8BfeaHOjiz7X27kZFEL529RwsfVenaYKwjWRvn5kmyt/T5UERNVbLtaJTfWT77A/lL/7gmLv5lQ4VM+n3h2SdmOBJ+KepmsgRaK1LBbNwlQKO86IBEIqBKTdez2gbXneJzBQ7a9ynhuVARQ6OAbw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780939452; c=relaxed/simple; bh=5FFoVBEExNYKZz7vEGVYM7wHnO+IsODRKnWMRDLXEQk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ViOavRFXNRHdnAN6DSU6lIhgiqq8ulMQbwafYH0/fFeHJIQTYteyaF5bZurygWu6FyDRwdmfSLI3K8pHKXu+tF9q5brBiuODefqGzH00Zz6kR+Xs6yss9OTC+sCWzzSBaI5v0h2UWeHf7Ec1vAONBusueiPpiRno8OO7/gEUwxo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=CN8pI+VF; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=AZYkzQan; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="CN8pI+VF"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="AZYkzQan" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 658FFWpx4041683 for ; Mon, 8 Jun 2026 17:24:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= hfgCRBrZnDBP1u/s15A1fdefY2DOaGJlkzPOAChYS2s=; b=CN8pI+VFZKtTBZjg Cq+3caSimpCLphuXYRweOq0L+SpwoOkTT7DhvHGE61ynYtxsCzKMXMAfZHf8rSVS 7YjT4j7q0v7Gv4csZy4J9so0EFUXcxiv5dyzb8tIwMmTsSnV/G/3PDerdyGtlB4s AzzkigyyPXbk8u3lS70tQl26fqUAWANyZPs7C+1IZ76ZrzQd0wLnncx32C2qJRkP RvcaNtTFblLfs5EIZUD0KqF4+vYuibQokVWda1coaocmrMManpwWtKY4b3puIJqM EXj1YEFN3l926fUZQWZ2ToODIH4Njjdcydc8NQxsmAhaL52WEb7sKL7jVT/hJ9Le 7qMdVg== Received: from mail-dl1-f69.google.com (mail-dl1-f69.google.com [74.125.82.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4enwsv9h7s-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 08 Jun 2026 17:24:10 +0000 (GMT) Received: by mail-dl1-f69.google.com with SMTP id a92af1059eb24-135916eefa0so15828572c88.1 for ; Mon, 08 Jun 2026 10:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780939450; x=1781544250; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=hfgCRBrZnDBP1u/s15A1fdefY2DOaGJlkzPOAChYS2s=; b=AZYkzQanZ9RCdY98KxuFje+QGEP+TyVERHxBS299paoUpMxN+kgAzbT9fevtUoJCKJ xSC6BfSbnUlG1kDAEN9hjNmavbSL+ogrVNNCzob1i2omD+x/N1qqApY8b4eatocDLMSz bZXk1uZyeIv1VoEEqDcW5doTG4WcBRj9oY7SgyXCmBIEXhj40YR+CQIfpAPk/Ue7FikE FR/4UhU/iJuZGq3qP7Nf4x8RxBRR+Y1fyoUqei8dFZ4T16twWe0TWvlgJtJDJEkq6B4v c/jJvhjZXPHz+AQdCN7UhzvVuPwBjLcpMnzIQUZvdJzro7F8fyij6Dc2jsgt+bNujsTz ok6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780939450; x=1781544250; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hfgCRBrZnDBP1u/s15A1fdefY2DOaGJlkzPOAChYS2s=; b=SeQNAQog2fOIK6+YuO4suPDaUkex6LAdMvtWbOzoAMlilQBw/64MWay0ZnrLxXvApE pKD8nA0Fc+8ng8wLS5DM7OdjkQARkn/bBe5WKmZ/n7hu0LFT+rXJ+WsNg155ZBYMqksI FwC8zOkWFKWqlAaYC6kIV6vzOvzXUqNSGFRv0EfGJmQZ+VvJQ8XSTK3vMFNA+826+YsI GXAFWDzkvT4ku04vt0IUj8dPxeYXL3QY+Q2bR2ef+NZpPFOLfULSD+NiBJGYuPg9hZs8 JxjorSFrqSyAt+6IgHh4blaQwwzLY8WQfTKvBxSi3QY2DumR5OZCUcnJS9awjjztwM3F sgzQ== X-Forwarded-Encrypted: i=1; AFNElJ9uoIKBwetmv2iHaBDSEQ9CupZ7S1K8vjFdxE6ZubYJmv7MC9VvEQHFWquTT3MIHZGCZbjY4k6bYTvOxaw=@vger.kernel.org X-Gm-Message-State: AOJu0YyvKGRyGD13ev952iGx7bhMatNxzJ+QQLIs2bymnFGZE53im9P1 0KOYmmcB7r2uHMB0V0UdgDP19RmGJfhREGfcVJVM+5AvE34r7dCSUKNB//eOhNf78jCDAbzOwX2 luzDalaqivu57ddf0T3ylXjVSMx+Gnbx7hnrRQDfyPr5U+aoRmPhp8Er1XjGcEPgUV8U= X-Gm-Gg: Acq92OENaIqZUToAn6f/UMZDXqkqj6TGBhsVyhRZoYNRtnlNhQvTUaLxiWsLv42uMx1 TV6/GCzq8xHGmx+rl0i+SoHXpVfGaBDIgjqaOFwf3s2bTLCrNCJeS99oBKE+8gpjcQSAhCLboOV GkPofwa/jhc3ac/6CexKpkzyenE2/Wr31hEnlI7aQia/P3M58SyqUbNViz5p28TJ79dIdaUBhvW jlBSevucmy9FycODi2hGHtNkE9hDfteWoefNuywjXBQLoE96PhOFH8mdguj9MrmgVAF9vr2iZiC zJ5Dr1Q9DGnP9MB2AzKV+VnFjSwp7t2rkQ18vKDJ/6LH2rkvadJ+7T74f1XD4phu5tADWcgUCYC 5xZCCrbozR/StCkjNlsbuuhHVOeB/lTnQM2Fgjh6ony+73LWnf/7fmsw9vsSpZtoLmPojNHxVlM df4C78ELcbQC5AOck36Ba5ZPr3 X-Received: by 2002:a05:7022:390:b0:137:6bdb:5842 with SMTP id a92af1059eb24-138065bad3dmr7705746c88.0.1780939449754; Mon, 08 Jun 2026 10:24:09 -0700 (PDT) X-Received: by 2002:a05:7022:390:b0:137:6bdb:5842 with SMTP id a92af1059eb24-138065bad3dmr7705716c88.0.1780939448974; Mon, 08 Jun 2026 10:24:08 -0700 (PDT) Received: from [192.168.1.59] (c-24-130-122-79.hsd1.ca.comcast.net. [24.130.122.79]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-137f53f06c4sm12449060c88.0.2026.06.08.10.24.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Jun 2026 10:24:08 -0700 (PDT) Message-ID: Date: Mon, 8 Jun 2026 10:24:07 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] wifi: mac80211: fix memory leak in ieee80211_register_hw() To: Dawei Feng , johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, jianhao.xu@seu.edu.cn, stable@vger.kernel.org, Zilin Guan References: <20260608145543.3443390-1-dawei.feng@seu.edu.cn> From: Jeff Johnson Content-Language: en-US In-Reply-To: <20260608145543.3443390-1-dawei.feng@seu.edu.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: gpalJEWbq05CAHmFVb3ua0Hznvr-fo9d X-Proofpoint-ORIG-GUID: gpalJEWbq05CAHmFVb3ua0Hznvr-fo9d X-Authority-Analysis: v=2.4 cv=dIaWXuZb c=1 sm=1 tr=0 ts=6a26faba cx=c_pps a=kVLUcbK0zfr7ocalXnG1qA==:117 a=Tg7Z00WN3eLgNEO9NLUKUQ==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=VwQbUJbxAAAA:8 a=ceM9LITnlY0sHtZh5UYA:9 a=QEXdDO2ut3YA:10 a=vr4QvYf-bLy2KjpDp97w:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA4MDE2NCBTYWx0ZWRfX631hntEXJ2WE uxkPmP94ywtNRHJfsGb+NHLHvg4IkSDToEM7Cbh3JBiey5w7tDoAOKsrr8xtvBuN9DoWiApH1Dc g0ScXswmCsFOhMeNc+5QTrxk/OuXW6OAvzkezNIMM+kxF0yc75izb3kcG0d9//V8UeWayF/I/Og Ghi6FvclQnZPxx7EkU919d8xf4WaZPUit0GB7o2t6GrOLZph7PbmMLLnfLRAIzwPz9qC4XoUwVY qhdhHFuiYEbRad+PHXMHpcxtdB0gq7yfXi3uz08TNjT6P/erKm6Er8SDTGw24Ggsvxj9aYMjbx6 WDP+9RXUMYL0BGhIacrE53nqNAHzTk4c+bhV5bXGGm6LP1iov+LoesHN8rBHtZp2LFV+P559rE4 JffRACP60xg69azxrKBKkKHQCAgiSJL+sl3mSHgLeVSHcz1lTZFptxPUIQxhM3RJP4JcxBwgGOo DcaHDw5esHsMtX6OgAA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-08_04,2026-06-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 spamscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 phishscore=0 adultscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606080164 On 6/8/2026 7:55 AM, Dawei Feng wrote: > If kmemdup() fails while copying supported band structures, the error > path jumps to fail_rate. This skips rate_control_deinitialize() and > leaks the initialized local->rate_ctrl. > > Fix this by redirecting the error path to fail_wiphy_register to > ensure proper cleanup. > > The bug was first flagged by an experimental analysis tool we are > developing for kernel memory-management bugs while analyzing > v6.13-rc1. The tool is still under development and is not yet publicly > available. Manual inspection confirms that the bug is still present in > v7.1-rc7. > > An x86_64 allyesconfig build showed no new warnings. As we do not have a > suitable mac80211 device/driver combination to test with, no runtime > testing was able to be performed. > > Fixes: 09b4a4faf9d0 ("mac80211: introduce capability flags for VHT EXT NSS support") > Cc: stable@vger.kernel.org > Signed-off-by: Zilin Guan why is this SOB here? > Signed-off-by: Dawei Feng this is the posted author of the patch, and this patch hasn't been posted previously, so it is unclear why there is an additional S-o-b > --- > net/mac80211/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/mac80211/main.c b/net/mac80211/main.c > index f47dd58770ad..9306e0af3b5f 100644 > --- a/net/mac80211/main.c > +++ b/net/mac80211/main.c > @@ -1599,7 +1599,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) > sband = kmemdup(sband, sizeof(*sband), GFP_KERNEL); > if (!sband) { > result = -ENOMEM; > - goto fail_rate; > + goto fail_wiphy_register; I'm wondering if it would be more logical to have another label at the same place, i.e. fail_band, since it is illogical to goto fail_wiphy_register when you aren't performing the wiphy_register function > } > > wiphy_dbg(hw->wiphy, "copying sband (band %d) due to VHT EXT NSS BW flag\n",