Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6553075rwi; Mon, 24 Oct 2022 03:02:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7M4wUFWUI3yWjLJth5TfGEF9jvAnohdHIj4Hl9nWWxUfFPNr770j+MMT4I6Ong2M0RisK4 X-Received: by 2002:a17:90b:264d:b0:20d:3935:778 with SMTP id pa13-20020a17090b264d00b0020d39350778mr71318078pjb.64.1666605766723; Mon, 24 Oct 2022 03:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666605766; cv=none; d=google.com; s=arc-20160816; b=K/GxHHbnW1Fk3K5CjVg1Vc+9EGIGNGMoPPmUf0OhHMione1HbbqhoJc87Tq3oboZgs wTtjuG+FMWX/cGoJc4KBKjFsUFOf9akHYMThikwAt8OKHHCiQRMHu6wKYMq+qMgTnDsG R6P8ROMq4ArmAQXIUNb43djN+UTwvD/QIahHeGYB6GEjxYff6GvDyndKXAgqEfR3SnjJ rFsmIdU27Huet9yepcv+HgObpbKJM39q1DH4mYxqHAi0OLMCrlijLF5qt+GCDUW33fkU abyt+1nv7h51iKl/Y+Os7yuvnJ3ckEM8NAfMNRRKKsie0qtvs+VboYwzuuUReGzzTb9V 64Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=C+NNoMHWB3XXNzQzWt5fd3QirA6sf8QDbcwvwfIOHGA=; b=Ue+lSqIhixuhp0KqkqhfzBdVx7K+enPgSHFsxjmUq+FNELY7+7QeeEgjXSpjUYk9LW CNZXaDAaUepyXwtDSChiFjE3lHBX0eusLZxdi76lqhnd7M7GzdB9YlgWhCrXHMSudOPt 3T15pbyPArhBbi5zlKof6NuRuugWyRIdBftR5TBFNkyzC9g1U2b9C7LdCwSI38hDiLIn C003q6NP+8YXtsBu59K4nlzKmHCxS13ayQVfPWqcy1IMsiW0CQ734Y0bMlqNVJPuEncI W37LQmEQwc/CB5KfgPiVbg0NCWttj9oI0thr+mMLRyWK0xJEWXE4QTCQVQyZaFJ27flN Vz9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=acsZYmBt; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z7-20020aa78887000000b005639db953adsi37161235pfe.68.2022.10.24.03.02.33; Mon, 24 Oct 2022 03:02:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=acsZYmBt; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230216AbiJXJuC (ORCPT + 65 others); Mon, 24 Oct 2022 05:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbiJXJuA (ORCPT ); Mon, 24 Oct 2022 05:50:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C70122495B for ; Mon, 24 Oct 2022 02:49:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 66BC861128 for ; Mon, 24 Oct 2022 09:49:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD785C433D6; Mon, 24 Oct 2022 09:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666604997; bh=fXposAJhPgxOUojoYHaqgEPPCjMMbUFD/bBUECimKMQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=acsZYmBtohqETJ94FXuV07V/GEUDhc29Yu36Dmk9PcmLV3+UeftXxr4rONA36oo7y IT9Gh145VMkyRTyYKKoCvhSyax/NTHmNO0UlAJpyIMc/4RHMB8Cz5ASPiai0Iaj92v TX4BjlN29Kx42s04kQoKWWBTHeg/Hu9GftuXZBZ+seb6FT8V48MwUcqAbBMHY5hMDU 0W8LqKd9mIITCB+wR//xYn+iphC6iv1CJB3vH5vShCDCTCrHfQ2WJLW3B+0/Q7cs2m H1U2X+TrlUK8/EUKFBj4I36jA0YBmRkA6BlQmyWjXUKS6uw3LDR4N3CQQAIyTY6Tw0 4LlS+AfA2k/bw== From: Kalle Valo To: Arend van Spriel Cc: Johannes Berg , arend.vanspriel@broadcom.com, linux-wireless@vger.kernel.org Subject: Re: [PATCH] wifi: cfg80211: fix memory leak in query_regdb_file() References: Date: Mon, 24 Oct 2022 12:49:50 +0300 In-Reply-To: (Arend van Spriel's message of "Wed, 19 Oct 2022 04:44:18 -0700") Message-ID: <87v8o9zh35.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Arend van Spriel writes: > In the function query_regdb_file() the alpha2 parameter is duplicated > using kmemdup() and subsequently freed in regdb_fw_cb(). However, > request_firmware_nowait() can fail without calling regdb_fw_cb() and > thus leak memory. > > Fixes: 007f6c5e6eb4 ("cfg80211: support loading regulatory database as > firmware file") The fixes tag should be in one line. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches