Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2820307pxb; Sun, 29 Aug 2021 04:46:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7pjESZZubUEZeGauwAVJg0LgHSOO83wT/9MVzn/D0Fx5f9cE3bM+DLcPEzy2xatRmTE68 X-Received: by 2002:a17:906:1dd6:: with SMTP id v22mr19626074ejh.226.1630237570602; Sun, 29 Aug 2021 04:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630237570; cv=none; d=google.com; s=arc-20160816; b=ThE5UfhB6sfqsa2Iz9/EYnDAyXV2WhiH7Y70x81TF2W/Uy9ZHoDXpvQbB2cIwW0WvS kctokEodjUzaIPTN6I0xL8e7fGLF3XdLC7iwukk+i6bDp7MK07kzfwyq3O7UjudBE+3F MB57wL+dJG+FRYpXK2KgsGy/jUX0wgaQwZUj68quyfJUG3JIoha7FZiEzrXAjBsp2tpi CS6h/cM44bHS65Qj2CW4vhrD+9T1ITcAz939QLv+n7xiFT+T0mnXOKdfrXLczBs+FTT9 wHNJFDMGHhU0OX6Q8FnWem5bzv69coNrKHuh2YCgyK65kgP/iqln8GMA6GHTt8DCHrpC D53w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dmarc-filter:sender:dkim-signature; bh=irGqUUIYdBveN6/7OVMy9T8jCS+s1qL+o56/wbFqR2s=; b=TqJLQ7PtcYLbMCbYs8bdtlbuVZit6eipeuEKJWXbM/m43SLHR1PdpIY+SjqXYjxsbk YAf/2ycNyduJfCRpVNXnAD+/kvMJkqN6g5s2440LKbom9RN4x3wKUr70k0uSMn/7EczH OhuMAkcJjdrNMgrkZ7arr/MjZK7XSNFGNAiQs1sTxQEprYttkEv6R1ng/8ocsEvvM4cI 4UPMcXYM/RYSVNIIyV/AdZzEt52bDNwF4NaRXgSss00/57gWueA6U0dOsaDHMI2wX9gu +OVV0AK4zZQfYRZkvtRARDj//OMEEYJHe2dacyKSpmh8gfqLI1gdwGMxx8sRAQCFuHHZ s+Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=mKAOZxBg; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp20si107055ejc.294.2021.08.29.04.45.35; Sun, 29 Aug 2021 04:46:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@mg.codeaurora.org header.s=smtp header.b=mKAOZxBg; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235195AbhH2LqU (ORCPT + 99 others); Sun, 29 Aug 2021 07:46:20 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:12190 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235182AbhH2LqT (ORCPT ); Sun, 29 Aug 2021 07:46:19 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1630237527; h=Date: Message-Id: Cc: To: References: In-Reply-To: From: Subject: Content-Transfer-Encoding: MIME-Version: Content-Type: Sender; bh=irGqUUIYdBveN6/7OVMy9T8jCS+s1qL+o56/wbFqR2s=; b=mKAOZxBgrORbrtLKytPb0jkJlIJ/pj3YGZKWfE1hBhGxiOgclkrQFWxiXPZYL7YjI27kMVoM acy56V2hieKlbkxw2ivWP0NuHdsgsG/HLoEgSEtQflISPHC/o0Mk996N8iygfQsdiN+jE78N smc99C9nN5oczoJlWRLILhZAAZI= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-east-1.postgun.com with SMTP id 612b7350825e13c54a35bc0d (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sun, 29 Aug 2021 11:45:20 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 46822C4360D; Sun, 29 Aug 2021 11:45:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,BAYES_00, MISSING_DATE,MISSING_MID,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from tykki.adurom.net (tynnyri.adurom.net [51.15.11.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id A6054C43460; Sun, 29 Aug 2021 11:45:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org A6054C43460 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH 1/2] bcma: Fix memory leak for internally-handled cores From: Kalle Valo In-Reply-To: <20210727025232.663-2-yuzenghui@huawei.com> References: <20210727025232.663-2-yuzenghui@huawei.com> To: Zenghui Yu Cc: , , , , , , Zenghui Yu User-Agent: pwcli/0.1.0-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-Id: <20210829114519.46822C4360D@smtp.codeaurora.org> Date: Sun, 29 Aug 2021 11:45:19 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Zenghui Yu wrote: > kmemleak reported that dev_name() of internally-handled cores were leaked > on driver unbinding. Let's use device_initialize() to take refcounts for > them and put_device() to properly free the related stuff. > > While looking at it, there's another potential issue for those which should > be *registered* into driver core. If device_register() failed, we put > device once and freed bcma_device structures. In bcma_unregister_cores(), > they're treated as unregistered and we hit both UAF and double-free. That > smells not good and has also been fixed now. > > Fixes: ab54bc8460b5 ("bcma: fill core details for every device") > Signed-off-by: Zenghui Yu 2 patches applied to wireless-drivers-next.git, thanks. b63aed3ff195 bcma: Fix memory leak for internally-handled cores 9fc8048c56f3 bcma: Drop the unused parameter of bcma_scan_read32() -- https://patchwork.kernel.org/project/linux-wireless/patch/20210727025232.663-2-yuzenghui@huawei.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches