Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1177593pxb; Sun, 10 Oct 2021 23:27:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkiHSd62VN9IW21ZGDY0Cm94pQslM6KXUt9h1YhVhwKxT/pczQbLottmtQOeMiXxrYol1s X-Received: by 2002:a17:906:9888:: with SMTP id zc8mr24888619ejb.504.1633933678879; Sun, 10 Oct 2021 23:27:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633933678; cv=none; d=google.com; s=arc-20160816; b=kg6KnIG9INBS942bvHRDs0dvGLfCVcRBq0DjyyFe9tvHCyCgzDQ6g6KX2+b5M2fQYE QC5R3E87+dzUN8bxjLSj0z3si41dDzwsIqJYITgqrtynrnpCdIPm3wOsBZ64bFwFy4kP dVPm0NttZAciSMC01cryLL8rqEwY4/iP/aOYDaqn2trqnq8+utWa2cDyN1VKqvEgcqNx 6MjRDzKwOWRVQpUe/qUNUT2UvEXVPe5oYi3+t5iO9DYIftj4Z7A5jUguzJhRkfFEA24D +U6LM5gqMDkEHudYzb5EDctIggvLPfVbhiWTJUC1bTR3BJ1IUj86/jd/L5QWDqp94T/f PxWA== 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=ZVQrWonnh9hRM9Qxp6VLOIO41IBcRwVY8KNlil4vdIk=; b=SIOCPuuCxOsUT5efoGaqIn/4HBDo6gOZa+kN9FXy4QCL0X8+ajm+WJfTKNZywfh6xK Jm2ASeHNp5hRBcdbcwjIZFqgG+G8avjfs3MIG1oz5wrLbSa85Pw3Pifz4r3OhRyqxVND bFG9NdrtjYipHkd+/1Gj6fb1VkE2BRAixrhQZO/x78Bk3VPKVQNsRIwGRtRAb0LHD47E gcul7zrU5alFlPCKF09U/40swQp/BmlRrf1kZ24tswFBV3ASZtCfPh3qTLuTMxzibnGB K5XIMSUxFPuhRIx+p4RA1uRjkWhaF3hdNI1X40Rg8kOyC6d1DvkrPJJV3yKN6v2WnIXl eqTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=D1JAduLg; 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 bi21si10161937edb.618.2021.10.10.23.27.40; Sun, 10 Oct 2021 23:27:58 -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=D1JAduLg; 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 S234192AbhJKG2m (ORCPT + 76 others); Mon, 11 Oct 2021 02:28:42 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:11979 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231839AbhJKG2l (ORCPT ); Mon, 11 Oct 2021 02:28:41 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1633933602; h=Date: Message-ID: Cc: To: References: In-Reply-To: From: Subject: Content-Transfer-Encoding: MIME-Version: Content-Type: Sender; bh=ZVQrWonnh9hRM9Qxp6VLOIO41IBcRwVY8KNlil4vdIk=; b=D1JAduLgYEmmosf0b5+nUkDKy84PiUe8ew198Im5sYUKH3N+mr8AKOhoVOmzrfu41lB39dQt hYxrQk8h6HV3l30iSt87vtrSQWtRxUGkYzKxkTwT68686ICLrtWwFwt1hw0mTZKE3QnsyaRy 9hX8E8cIrFxgCnezLEafBVhwYxo= 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-n03.prod.us-west-2.postgun.com with SMTP id 6163d90b4ccc4cf2c79b9895 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 11 Oct 2021 06:26:19 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C9180C43616; Mon, 11 Oct 2021 06:26: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.5 required=2.0 tests=ALL_TRUSTED,BAYES_00, MISSING_DATE,SPF_FAIL,URIBL_BLOCKED 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 B3848C4338F; Mon, 11 Oct 2021 06:26:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org B3848C4338F 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] ath: dfs_pattern_detector: Fix possible null-pointer dereference in channel_detector_create() From: Kalle Valo In-Reply-To: <20210805153854.154066-1-islituo@gmail.com> References: <20210805153854.154066-1-islituo@gmail.com> To: Tuo Li Cc: davem@davemloft.net, kuba@kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, baijiaju1990@gmail.com, Tuo Li , TOTE Robot User-Agent: pwcli/0.1.0-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-ID: <163393357512.20318.16433402434764020686.kvalo@codeaurora.org> Date: Mon, 11 Oct 2021 06:26:19 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Tuo Li wrote: > kzalloc() is used to allocate memory for cd->detectors, and if it fails, > channel_detector_exit() behind the label fail will be called: > channel_detector_exit(dpd, cd); > > In channel_detector_exit(), cd->detectors is dereferenced through: > struct pri_detector *de = cd->detectors[i]; > > To fix this possible null-pointer dereference, check cd->detectors before > the for loop to dereference cd->detectors. > > Reported-by: TOTE Robot > Signed-off-by: Tuo Li > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 4b6012a7830b ath: dfs_pattern_detector: Fix possible null-pointer dereference in channel_detector_create() -- https://patchwork.kernel.org/project/linux-wireless/patch/20210805153854.154066-1-islituo@gmail.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches