Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1343236rdb; Wed, 20 Sep 2023 06:47:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFobZLRGiqfcjdYMZpAGUcrJbXbmu31McPnCWwdCMHATr1+BQWdL4Hf1ouuQT/VfYlpkz5+ X-Received: by 2002:a05:6a21:81a4:b0:140:a6ec:b56a with SMTP id pd36-20020a056a2181a400b00140a6ecb56amr2369216pzb.3.1695217619810; Wed, 20 Sep 2023 06:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695217619; cv=none; d=google.com; s=arc-20160816; b=UpD7/IAJELpNvUp1/aQ6/0mxIkpCbjrWXHP1jRh8R9ERAvliVCY/40W9e1Ss4S6XBT r5R7NLs1e6I3HVZhVhKc9xsvQnl2hPyM9T8okiHZ13td89jspFu+b1Bi/B3mpQBWDGi2 KmWrRClskraoKJ7BVPnrHSK/50o3grhmfA0e6WEzVnPB3SDPX1d7PmG65/k6uevhicXJ 4JRg7XX4lrYtB/JAy0LmWTDHAHGhhaYYpsxp12A6zkXBWsTucp0qyzfCIhDBsiqGAFKA 5yxEHO/oRC/US0r7KLz9SW4Runxd/h/Uqy4xCypGqBnWcjMHZVV2SlqeeihcIMp0HXgD 5CiQ== 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 :dkim-signature; bh=1OJzBXwC3fehbgT25c1II3mPFuCSM6MkiOQ9HlZQ9XQ=; fh=2UGyKc87B52f7sIwEYl9g+SBtVnXUiLMuSlEko54uMQ=; b=x5oT2T5Of3wSaCsnc1PLAT2zZez6v3j1rHhSEIFlX6tipEbeD8F98avjCKyTMAJEei rFSvNq/G6priTdRYJcqMvrGbAqVRV8ZCF3WW/4byvi6k7JLotYKddaaFL/uHJ7Fv4gNe ElZTung1+4sthTQXmv/XtPM1s8lENXFh/Ttmn4dY8YyuxpJVjzG6U5Q1QEgbnxGrh/iz JoCCqmkTt8x8z3N+CaTAqDOHGwoIKLwH9p+Ky6yO/B6qvIEB3TdLReeX5/yE9Qn/nkB+ mhwd8xf5DpUdhStnRD4de4WcE+2NoPCxO5M7Ip1XhMhgawdrW6zYzOkG16VXTWz+dOjo 200A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VzCeMHxV; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id kb14-20020a170903338e00b001a677821130si11426517plb.13.2023.09.20.06.46.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 06:46:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@kernel.org header.s=k20201202 header.b=VzCeMHxV; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B094581FD297; Wed, 20 Sep 2023 06:38:49 -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 S235970AbjITNim (ORCPT + 56 others); Wed, 20 Sep 2023 09:38:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235925AbjITNik (ORCPT ); Wed, 20 Sep 2023 09:38:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7D6CDE for ; Wed, 20 Sep 2023 06:38:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5D35C433C8; Wed, 20 Sep 2023 13:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695217114; bh=XauREkdUDckz8leh4QeQjsODnulH8uUzRvYFx3cwuv4=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=VzCeMHxVM5XJimhQFHEEhmZ0PPfCAr4P8XqbawZLIpLZFHIG4SdGjFC8oeYEcvlqm wsZJr/TW/RsS6iN/Us86qfBizt3riShY5walDgFYAGXG2qfxkDWbCsZpbZ765UNoFx TPGxmkcCvkjmXVKjCfMN5fvHYi3i8M0UPGn+KVLg7F4jYT8P8TtLTrASey/2BIf3Ou aIyJ7JfHmQzJtYwkZgDhAFupEGQDMoCZoH/oejBcG48+Ni3E5zNRV8UiTtTyYO16Dm 4bMxnS8dEqS4g3f2KU2AK0ddSIIdmAvwz5QPImx+gZGFNKOZrfEG2A6vkplZjDi+Rl xUwWYQCG6Cw8Q== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] wifi: ath12k: fix possible out-of-bound read in ath12k_htt_pull_ppdu_stats() From: Kalle Valo In-Reply-To: <20230901015602.45112-1-quic_bqiang@quicinc.com> References: <20230901015602.45112-1-quic_bqiang@quicinc.com> To: Baochen Qiang Cc: , User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <169521711198.1118199.13181861616088470480.kvalo@kernel.org> Date: Wed, 20 Sep 2023 13:38:33 +0000 (UTC) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 20 Sep 2023 06:38:49 -0700 (PDT) Baochen Qiang wrote: > len is extracted from HTT message and could be an unexpected value in > case errors happen, so add validation before using to avoid possible > out-of-bound read in the following message iteration and parsing. > > The same issue also applies to ppdu_info->ppdu_stats.common.num_users, > so validate it before using too. > > These are found during code review. > > Compile test only. > > Signed-off-by: Baochen Qiang > Acked-by: Jeff Johnson > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 1bc44a505a22 wifi: ath12k: fix possible out-of-bound read in ath12k_htt_pull_ppdu_stats() -- https://patchwork.kernel.org/project/linux-wireless/patch/20230901015602.45112-1-quic_bqiang@quicinc.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches