Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1522242rdh; Mon, 25 Sep 2023 15:55:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyOqwxhVzNyFdWmxemtodrudDizVEAcnqAOTz5qGI2iIXuZMb0smJnUPPeu4XJAEywVfdo X-Received: by 2002:a05:6a00:1c82:b0:68f:c2f7:cef0 with SMTP id y2-20020a056a001c8200b0068fc2f7cef0mr1177879pfw.4.1695682517849; Mon, 25 Sep 2023 15:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695682517; cv=none; d=google.com; s=arc-20160816; b=bkTuPz2ho4nkSUCCIwCx6fRxq0D+jrrnRjGGnMPnoQIBxeOXgK7t1q2vdXkwJzUyAg 4hKLtwpw9WgvTdQD9TQrrnJ2j7Q+FdrGa273Jp4K58FGAd+Nb17tA6jZ91wesmo4mDpT LOjQfOXpAvfn626uRbVCrCmjJSY+U2jOZEQ7uRJQi39Tv8F6jbgezOta3N97zyFHdCOu tfk5vvYAnnhX6DesOifRyUveQFV9ZXvSTgUP/Q5AxZ7DGYPDspmXDuUh5H0ZuUY5GaZi ZvP2tl5cF1dqTUkpvHr0A83tOoSp4lZQrpgg85x27uJDZQRt6NTz1upxtmmIjfYuJ16T A/Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7qzOKZEryNuTAMV520/DOS4D/U+CE50T2S4n3ISZSPo=; fh=Iu3O/Ycbl+w+4oYQ79wm7eY5viYqrLt51nzrFAX2Zeg=; b=UVaT/Ndy08Uj72o2YD2YNPRlIvKL2PHwIxLpRBmiNCXjaR8UZNQlj63rB3DdfrUUMq xu55nlinvpsWsUe9nVhbs2qpBG5DB86aHigT2NjpO28o7Uxai++rnpo1cHA8v2NkFeDw 82/zpOWMO/SZFxaglW+FkgJi4z12TeVAGR64dCRpXUXM1mDKIuUqb2onvzFN7PQv9eHJ jRGfQRyB2Sx1VbYjf5hxrpQnEBmInaq2OvSmz7TU6CX3pexfm3XAkGt+x/lTqg79nTK5 fdWNbwUCZxjtyNSpKUsx0+4RDX8WGgZ6AgaVFZtM1//iVtGMME5kkr4NTlMfq+jJe7XP ShyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=S9UC5lCe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id eg23-20020a056a00801700b0068fa57d2486si11035490pfb.125.2023.09.25.15.55.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 15:55:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=S9UC5lCe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 2D9BE8186509; Mon, 25 Sep 2023 13:55:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233365AbjIYUzK (ORCPT + 99 others); Mon, 25 Sep 2023 16:55:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233330AbjIYUzJ (ORCPT ); Mon, 25 Sep 2023 16:55:09 -0400 Received: from smtp.smtpout.orange.fr (smtp-15.smtpout.orange.fr [80.12.242.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF80010F for ; Mon, 25 Sep 2023 13:54:58 -0700 (PDT) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id ksbTqNdzdvU2mksbTqP3zl; Mon, 25 Sep 2023 22:54:51 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1695675291; bh=7qzOKZEryNuTAMV520/DOS4D/U+CE50T2S4n3ISZSPo=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=S9UC5lCekptgVAY6BUwXIbKLDF7xRd4t1vPiN8652emUmFC9CEym9eMfg7KM8VWst 20V41WgNpcHSCzp5WPp1Uc8fa0ziB+cnRcW0OnEpG5Hanavu1DaHor70axUQzHUR7h zCKj8EYeWktjzreF8o5yNVpPGOtMvEZpsJFZcea2pxZ3TE+S+DnTK/dNe9dgA5J2lZ c4r6vFbbHKdCiNbwp4vUjED+SIBi2NkU004OS7SVTqJ4hiAsjywiVcZ7/eWKEspCjl 4Qme0V0WvWTj/szLUXO1I44oQHB4Azg6ZFZOmWMTiPuFaxQ89kxhdDRRgux+ISUgmi YRDvdZWPb49PQ== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 25 Sep 2023 22:54:51 +0200 X-ME-IP: 86.243.2.178 Message-ID: Date: Mon, 25 Sep 2023 22:54:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH wireless 1/2] ath: dfs_pattern_detector: Fix a memory initialization issue Content-Language: fr, en-CA To: quic_jjohnson@quicinc.com Cc: christophe.jaillet@wanadoo.fr, kernel-janitors@vger.kernel.org, kvalo@kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, quic_kvalo@quicinc.com References: From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 25 Sep 2023 13:55:22 -0700 (PDT) Le 25/09/2023 à 20:46, Jeff Johnson a écrit : > On 9/23/2023 11:57 PM, Christophe JAILLET wrote: >> If an error occurs and channel_detector_exit() is called, it relies on >> entries of the 'detectors' array to be NULL. >> Otherwise, it may access to un-initialized memory. >> >> Fix it and initialize the memory, as what was done before the commit in >> Fixes. >> >> Fixes: a063b650ce5d ("ath: dfs_pattern_detector: Avoid open coded >> arithmetic in memory allocation") >> Signed-off-by: Christophe JAILLET >> >> --- >> Patch #1/2 is a fix, for for wireless. >> Patch #2/2 is for wireless-next I guess, but depnds on #1 >> >> Not sure if we can mix different target in the same serie. Let me know. >> >> BTW, sorry for messing up things with a063b650ce5d :( >> --- >>   drivers/net/wireless/ath/dfs_pattern_detector.c | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/wireless/ath/dfs_pattern_detector.c >> b/drivers/net/wireless/ath/dfs_pattern_detector.c >> index 27f4d74a41c8..2788a1b06c17 100644 >> --- a/drivers/net/wireless/ath/dfs_pattern_detector.c >> +++ b/drivers/net/wireless/ath/dfs_pattern_detector.c >> @@ -206,7 +206,7 @@ channel_detector_create(struct >> dfs_pattern_detector *dpd, u16 freq) >>       INIT_LIST_HEAD(&cd->head); >>       cd->freq = freq; >> -    cd->detectors = kmalloc_array(dpd->num_radar_types, >> +    cd->detectors = kcalloc(dpd->num_radar_types, >>                         sizeof(*cd->detectors), GFP_ATOMIC); > > nit: align descendant on ( Agreed, but as the code is removed in patch 2/2, I thought that having a smaller diff was a better option. Let me know if I should resend the serie. CJ > >>       if (cd->detectors == NULL) >>           goto fail; > >