Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8079386rwi; Tue, 25 Oct 2022 02:06:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7JcYCBozMLEWkJ/M1eiRvamgeJ6BetMMWxTmp0KAwx+XnPTAWHAou0APuTeDekFwZc2Gz4 X-Received: by 2002:a05:6402:510f:b0:45d:353e:dd37 with SMTP id m15-20020a056402510f00b0045d353edd37mr35027260edd.362.1666688794514; Tue, 25 Oct 2022 02:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666688794; cv=none; d=google.com; s=arc-20160816; b=KgQT5Dxn9pT/Y/+pboi3I5BKxv0YoBL5khm8cYjVjS0tZ7ttGgAAKSYQcrRMCSfRnU AnaD9MDLQ8t/KUjNF+0iQ6HU6nwa25gAhZjOZ3aHQYo7ljyixNTyTQwUoCBMzoD5IZS2 lQvf2gVZxLjHMmvGubNURNhGsu5Kucjz0zaFwoKAwnDh0RMYHxwW9XoMSu0gE4QyM9Bz 2LGwU+Ijsg/2oYECvFZEPFCA9GK+eSkiRRv3GRfWrIrm7Nxfmp6jVvHCkx40dewpb4Ad MeRFGfJ6cJNXrte1v27/IS/6bmGrkmxu+1IBu5qRDGZGiDyDzHYWh2oGwuLMpatiVLvj HKEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=0YH77zo/Qdkiwc19m1Q4KHQKsJzrm+2DkCih+UY21Rg=; b=tjGsV5P/a8Y6B5u4Gz+6ypaanTUnkBUJSMMzd4OkFeMd2fOv83r5kpYcg/cwaOY2jn KhvqwqPI4/TjbQMCtHMEZ0C+DGZOzoUHAP2JXYnXC8dJvVNY1wXXTzh28N+n2Oxzrw48 WeWrpU30N+HtVao8FFsRHGDSdoNgX5C/9lez7KgGf1vCyz5wdW5+vb8s8C9js+0WLW6P DrAu7lHTy9vPV+sV1GDWL4QRkEg9aYKIOzz4p0B8TrwRDGf+NN901MAZcP7G/n1FW4E8 pSz3iXfxrsyKLvbgrGgkd7a0ZnK2/ncN3pGZW0CcnxKP/+qVUFTWODgf9yMXEWJlfmW5 ecVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=BFEcTf82; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a05640235ca00b00461e426dcb0si2543540edc.609.2022.10.25.02.06.17; Tue, 25 Oct 2022 02:06:34 -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=@broadcom.com header.s=google header.b=BFEcTf82; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbiJYIzE (ORCPT + 65 others); Tue, 25 Oct 2022 04:55:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231342AbiJYIzA (ORCPT ); Tue, 25 Oct 2022 04:55:00 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B5A514D8E7 for ; Tue, 25 Oct 2022 01:54:58 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id bp11so19118320wrb.9 for ; Tue, 25 Oct 2022 01:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=in-reply-to:from:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=0YH77zo/Qdkiwc19m1Q4KHQKsJzrm+2DkCih+UY21Rg=; b=BFEcTf82UVeFxGe0+1E0nuovO/Ep4cO8uGBgwHwXB4OBedQILtcrAozZpnR/gW4Q4D L3goS8h9QIyVcr+0qPmI2E/md7dJ8kjpoHXzHTtmu3pz7mVROHzeWGpDoznkI8h3mk5U 2ds45M4U7WrQ4vFEcfla8qnuJjzcvmRegHzeQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0YH77zo/Qdkiwc19m1Q4KHQKsJzrm+2DkCih+UY21Rg=; b=VVg2qsL0Lfn7hBAW3lP1VmsI6GDvD68K09wR+NYeenOowCgZNxbzuk7ANaeS3Bjpho MBFVh0Uz7r5nBYRiP+17gwRS7K8jNZUz/2c7OoqrlUitVbt/C4t67KnQ7zz4A1JUDAe9 2OZWtCW2nhylZrSShfolo7oR4u1XwHSopfHIH+EGTJif8LKmkF/VMBCfQWYPWFiJEgar ULi0ZS0n5LAt2zUQvmfNGWqCzgpZ92ZbGoEtBp3XhxDBMlKvwEgnOE0yJbOVsHw/MRmH BJLx/mopRBdm43dDQF08OKZOzoHX9WDs08BwKPvw2iFYBuu3LbJYUp1y+11MJYhe4rXx 9wUw== X-Gm-Message-State: ACrzQf3rv5pa99egKdh5lQERqKNq/MksoF1Z1bMSBfdJIUxftrXqZVs1 zte9cuzgksV21WNtP0/8Ej5C4Q== X-Received: by 2002:a5d:5a9d:0:b0:225:2783:d6f1 with SMTP id bp29-20020a5d5a9d000000b002252783d6f1mr25269082wrb.385.1666688096466; Tue, 25 Oct 2022 01:54:56 -0700 (PDT) Received: from [10.176.68.61] ([192.19.148.250]) by smtp.gmail.com with ESMTPSA id t8-20020adff608000000b00228d67db06esm1929613wrp.21.2022.10.25.01.54.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Oct 2022 01:54:55 -0700 (PDT) Message-ID: Date: Tue, 25 Oct 2022 10:54:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH] wifi: cfg80211: fix memory leak in query_regdb_file() To: Kalle Valo , Arend van Spriel Cc: Johannes Berg , linux-wireless@vger.kernel.org References: <87v8o9zh35.fsf@kernel.org> From: Arend van Spriel In-Reply-To: <87v8o9zh35.fsf@kernel.org> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000f4cb8405ebd80f1d" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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 --000000000000f4cb8405ebd80f1d Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/24/2022 11:49 AM, Kalle Valo wrote: > 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. Correct,which is why I sent a V2 ;-) Regards, Arend --000000000000f4cb8405ebd80f1d Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQdwYJKoZIhvcNAQcCoIIQaDCCEGQCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg3OMIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA5MTYwMDAwMDBaFw0yODA5MTYwMDAwMDBaMFsxCzAJBgNVBAYT AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMTEwLwYDVQQDEyhHbG9iYWxTaWduIEdDQyBS MyBQZXJzb25hbFNpZ24gMiBDQSAyMDIwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA vbCmXCcsbZ/a0fRIQMBxp4gJnnyeneFYpEtNydrZZ+GeKSMdHiDgXD1UnRSIudKo+moQ6YlCOu4t rVWO/EiXfYnK7zeop26ry1RpKtogB7/O115zultAz64ydQYLe+a1e/czkALg3sgTcOOcFZTXk38e aqsXsipoX1vsNurqPtnC27TWsA7pk4uKXscFjkeUE8JZu9BDKaswZygxBOPBQBwrA5+20Wxlk6k1 e6EKaaNaNZUy30q3ArEf30ZDpXyfCtiXnupjSK8WU2cK4qsEtj09JS4+mhi0CTCrCnXAzum3tgcH cHRg0prcSzzEUDQWoFxyuqwiwhHu3sPQNmFOMwIDAQABo4IB2jCCAdYwDgYDVR0PAQH/BAQDAgGG MGAGA1UdJQRZMFcGCCsGAQUFBwMCBggrBgEFBQcDBAYKKwYBBAGCNxQCAgYKKwYBBAGCNwoDBAYJ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