Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5494997pxb; Wed, 26 Jan 2022 13:23:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCCUsU3sjUm9lg5p/60PPJhFLT/aNAYWvia1BJ33O6JkDc/FmahoI3c6gd8QKFRJZBW/4p X-Received: by 2002:a63:cd45:: with SMTP id a5mr604100pgj.64.1643232184840; Wed, 26 Jan 2022 13:23:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643232184; cv=none; d=google.com; s=arc-20160816; b=QH+WH+5EX1p1eIdozDLjQnlo5nqKZoMbzh9u3OYzjEsWnF4Esd+CbLP0nfFg7fdGoe CeWQFmbfVmjRqq4ncInEihcOsyCMU+H0EqIQIiRCpWV4Xxv41vN2PTYAinMLU/6YMDYB PTnffs6p9W8VIEs8Ic23nIzjjUbJo/ByiJBHx+cmrDoAoYYiZmp9BPu96iHARDi1ZjYO fYMZR8hCapDkmMlku1h8dqCsp9Rj2A5ZJO/eNOWW5GGpLLzBQdQNfEaDhNpieY8lkp3E vVVoM+RDum2lB7J88TtSthHe98V5yZZS+rFJQ/NoMZXVuEOk6FE3GEHeNjgAt4b0MzWw O7Vg== 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=ybAKOghw/A61ax0pqV95u7SMa7XjZGspEP16MsPD93Q=; b=nJmX5kd7AUWhhmEI4vrWDzgIB2HKOCSgC4FHWqnq0vEAyt9D9RmfhYAsivFBPqoZo+ 6JBIKHvYIFzXOI/p+jBSEefK/6SFkChCTQ1IEcB4S2K/XHI8CanGXJtemiB6G9sRcqdS nOMP8s55/40whCgHW4uS1xCLNAE8f4lbVevVwz/6a9SWBATvu8FG7GZkOAtyPhpXgWQi a9NWjOZlE1d4QADx28Xl8IK6vx8LLrU1I+GNC1xPzoyB81BPdVYJKPn7Mcs21bWHvXnv HE9b8peH5pcmq2HF9lO91Yl/ksq1r374wV99M8JuOpdft3udbi7WEpV+N5tWxfnt602p uMqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b="K/r9RiZ7"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 84si335966pga.173.2022.01.26.13.22.51; Wed, 26 Jan 2022 13:23:04 -0800 (PST) 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=@broadcom.com header.s=google header.b="K/r9RiZ7"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241139AbiAZNo0 (ORCPT + 72 others); Wed, 26 Jan 2022 08:44:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241087AbiAZNoZ (ORCPT ); Wed, 26 Jan 2022 08:44:25 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9277FC061747 for ; Wed, 26 Jan 2022 05:44:25 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id g9-20020a17090a67c900b001b4f1d71e4fso6140533pjm.4 for ; Wed, 26 Jan 2022 05:44:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=message-id:date:mime-version:user-agent:subject:to:cc:references :from:in-reply-to; bh=ybAKOghw/A61ax0pqV95u7SMa7XjZGspEP16MsPD93Q=; b=K/r9RiZ7Pu9/iopUR36mVkY7+i7W9U/PHnQN7k/+4HwT5YvywFRa354GecVqiEt+l7 7vOA8MdXo7rPL9Axa/Xm1V7mel1FNnK1f+p+jH+fIf0idtdcnz+4L7JIt9Eh9dk35jqC 2zAWI9VZiQ18yWBJzPI/F9HzqTqkWLg7hASic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :to:cc:references:from:in-reply-to; bh=ybAKOghw/A61ax0pqV95u7SMa7XjZGspEP16MsPD93Q=; b=wnf+yq8J1awZOWwCuH1Wo2d+Ux+/EmkmajYyvAU+bGv4UZPoChRYDn0D0xiHPjeNp9 QSWi7BXKc8gY2GI+aGbKjOVAA7cfe/NsIoxYwi+UMcsI1xRydljWtbQljsBwg+XyJwbA CHj7PqeLTdh1I1Acd6FKSvHuQ2MGqN4bHuboRervBC7v0GqCyTBv4C/C+VF/Y1aDjkRJ AuFGICu54WhZtgn/pLRPglngBmlCqXSyTUp0S1MDFFOZfmlispfD7N8YFZfmioaPNAzm OP0RH2spB4/ZTIfeOphrRhWLMOuZg5jJypimALpaba7z9keiLUWYxDt6fVz6TIzmcNYq d4ow== X-Gm-Message-State: AOAM533KXhdeeWEnoJJ2H6qRtvqpjs2PYoMnPqTPdAbC/OCtNtDp4soc AeVIaaC24NFjDojPBVSmOquLBg== X-Received: by 2002:a17:90a:8d15:: with SMTP id c21mr8746330pjo.185.1643204664967; Wed, 26 Jan 2022 05:44:24 -0800 (PST) Received: from [192.168.178.136] (f140230.upc-f.chello.nl. [80.56.140.230]) by smtp.gmail.com with ESMTPSA id w15sm2363991pfu.11.2022.01.26.05.44.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jan 2022 05:44:23 -0800 (PST) Message-ID: <84c2e35f-ec6a-93ee-0bca-f8ed535bc3f2@broadcom.com> Date: Wed, 26 Jan 2022 14:44:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] brcmfmac: Fix a NULL pointer dereference in brcmf_of_probe() To: Zhou Qingyang Cc: kjlu@umn.edu, Arend van Spriel , Franky Lin , Hante Meuleman , Chi-hsien Lin , Wright Feng , Chung-hsien Hsu , Kalle Valo , "David S. Miller" , Jakub Kicinski , Len Baker , "Gustavo A. R. Silva" , Shawn Guo , Hans deGoede , Matthias Brugger , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220124165048.54677-1-zhou1615@umn.edu> From: Arend van Spriel In-Reply-To: <20220124165048.54677-1-zhou1615@umn.edu> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000005f420405d67c66c6" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --0000000000005f420405d67c66c6 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/24/2022 5:50 PM, 'Zhou Qingyang' via BRCM80211-DEV-LIST,PDL wrote: > In brcmf_of_probe(), the return value of devm_kzalloc() is assigned to > board_type and there is a dereference of it in strcpy() right after > that. devm_kzalloc() could return NULL on failure of allocation, which > could lead to NULL pointer dereference. > > Fix this bug by adding a NULL check of board_type. > > This bug was found by a static analyzer. > > Builds with 'make allyesconfig' show no new warnings, > and our static analyzer no longer warns about this code Thanks for this suggestion. However, this has been addressed already by this patch [1]. Regards, Arend [1] https://patchwork.kernel.org/project/linux-wireless/patch/20220117142919.207370-8-marcan@marcan.st/ --0000000000005f420405d67c66c6 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 KwYBBAGCNxUGBgorBgEEAYI3CgMMBggrBgEFBQcDBwYIKwYBBQUHAxEwEgYDVR0TAQH/BA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