Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1368767pxm; Thu, 24 Feb 2022 01:33:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7bx/HjuMZP+ijaAMAgApFkBazZ3jXnu285XfhTVVCCtvThen01DPhy/R+JcT2ZROQkX9k X-Received: by 2002:a63:fd11:0:b0:373:ba03:5305 with SMTP id d17-20020a63fd11000000b00373ba035305mr1599513pgh.367.1645695222607; Thu, 24 Feb 2022 01:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645695222; cv=none; d=google.com; s=arc-20160816; b=xB3rCeNZ5nWV0Xeo3+DGF6FkPLfHMF95jfiXVmdgEB8PSVIJWn2KA7ky4EgbC5gIDj sRPGDBlkCtCorSAmKZxjvGR006ujepuSPO4awPMxQ7AK7NVRPzs1mKNvNVVVxfieVsVI sK+J2wvhMQMbJ856vb2/a6e9/G4qWkNkPfsAj0Kjdt/Ukjr727Jq2C0jut1GkXJWOObE Xdtm3MP3687deqpLCAMEdXvVMVVA0gXZkMKGwne0jJ9JR9TRzOFfu5GeKe4vapHTAKbS wztnURQa3lYCuSl5GelKYk7QgWjuYYuaSAKTnn58iWNIH+YuEdS0s4H/xGH3z263X8U1 G3ZQ== 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=C0Obk6ddE0MOJIDt9pkJqoyN1lzww5qNTdMq1HuGB/4=; b=r5TqAqpm4nkkFthv6400Fur7vXkO6r9Hnim+TWL7W4th2y7X+3D71ti2MZOSRFi63c ZLXznlzqHKcsaxba79+odHTWxUm+KsQds3MUu58Fw+vAWFBtBEJZDW/PVRkNgJF6Z1d7 ufhlEgUSfIlZpVv7Vj+UHq2M774g9hKoIPpXWRW2WlVed9YmM7b5BF3uJVvJpJsai1Bi 8A4Yza2X2POOpIDvvYGIpt+bPbLZLQuUy4F6NSbnZsuPIo4hv5/g5ZdDsN+pQak9RVdT p12W7FXSpuzNSDZKzkSvh5Sq7mwHH7trKkO1EvBJCaht/u1k/EHmfzEbaA1g0qCef9Cz UrFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="n9q/7wze"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x22si1826239pll.382.2022.02.24.01.33.26; Thu, 24 Feb 2022 01:33:42 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b="n9q/7wze"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232478AbiBXJGW (ORCPT + 73 others); Thu, 24 Feb 2022 04:06:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbiBXJGV (ORCPT ); Thu, 24 Feb 2022 04:06:21 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C3BD189AA6 for ; Thu, 24 Feb 2022 01:05:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C7113B81C4A for ; Thu, 24 Feb 2022 09:05:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2947CC340E9; Thu, 24 Feb 2022 09:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645693549; bh=CC5AEFMLTxhckHWBk6hNVR6HRUe2MZlQmHha6NARgFs=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=n9q/7wze2pqaRf1hOdY60Lg8OnOyrKuLq5mrIedNfqWb/6u5LwEAkaJAXD69lOQql 1tYb9pNAuNMBh1FqdZYbiyLHbdtRRRjECR0Z5v1YvHSLEkoCAK/CzMejUdeVm746Dg Ft7WrfvXB8v88kDsCN8pJIXTKt+WDNcq6+X+3tahC/dLXmIT3IjA94O6xOJKZprECY NzB1bucdudP44mGrqs51OifgUhfZYU5X6aoWITxpNQOMErzUxVwMd0YUKWRctfwh6W qQDCIDOpjnMzQPNXpDQKP9/f4/CytMEdxBIcYu6EhiDmuWH9/f3DjrATXfyGyu9u46 EAj4GyFnCZK2g== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH v2] ath10k: fix pointer arithmetic error in trace call From: Kalle Valo In-Reply-To: <20220221122638.7971-1-franciman12@gmail.com> References: <20220221122638.7971-1-franciman12@gmail.com> To: Francesco Magliocca Cc: ath10k@lists.infradead.org, dan.carpenter@oracle.com, rmanohar@qti.qualcomm.com, linux-wireless@vger.kernel.org, Francesco Magliocca User-Agent: pwcli/0.1.0-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-ID: <164569354432.30378.1243222511176407812.kvalo@kernel.org> Date: Thu, 24 Feb 2022 09:05:47 +0000 (UTC) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Francesco Magliocca wrote: > Reading through the commit history, it looks like > there is no special need why we must skip the first 4 bytes > in this trace call: > > trace_ath10k_htt_rx_desc(ar, (void*)rx_desc + sizeof(u32), > hw->rx_desc_ops->rx_desc_size - sizeof(u32)); > > found in the function ath10k_htt_rx_amsdu_pop in the file htt_rx.c > > i think the original author > (who is also the one who added rx_desc tracing capabilities > in a0883cf7e75a) just wanted to trace the rx_desc contents, > ignoring the fw_rx_desc_base info field > (which is the part being skipped over). > But the trace_ath10k_htt_rx_desc later added > don't care about skipping it, so it may be good > to uniform this call to the others in the file. > But this would change the output of the trace and > thus it may be a problem for tools that rely on it. > Therefore I propose until further discussion > to just keep it as it is and just fix the pointer arithmetic bug. > > Add missing void* cast to rx descriptor pointer in order to > properly skip the initial 4 bytes of the rx descriptor > when passing it to trace_ath10k_htt_rx_desc trace function. > > This fixes the pointer arithmetic error detected > by Dan Carpenter's static analysis tool. > > Fixes: 6bae9de622d3 ("ath10k: abstract htt_rx_desc structure") > > Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00157-QCARMSWPZ-1 > > Signed-off-by: Francesco Magliocca > Link: https://lore.kernel.org/ath10k/20220201130900.GD22458@kili/ > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 49ffac5907a8 ath10k: fix pointer arithmetic error in trace call -- https://patchwork.kernel.org/project/linux-wireless/patch/20220221122638.7971-1-franciman12@gmail.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches