Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2219046lqt; Mon, 22 Apr 2024 05:13:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUchz6Yv/vvH4Jm3osZyhDIr720zBsm82mjCyRlnCFbaISnuaBi03y7Wgt6qQDKzZisVUrf4dD3WdwOs32tAHXyYfVWPAHolUHTTa4OVA== X-Google-Smtp-Source: AGHT+IGWPWaaN+3ZSUs1Gi0BoPnoYgrAB12ry8OUazW2CGuviRmDH/KzjffZy2DJk0JhzwKQ+QFV X-Received: by 2002:a05:6a20:9794:b0:1a9:c843:6f37 with SMTP id hx20-20020a056a20979400b001a9c8436f37mr9270435pzc.19.1713787995257; Mon, 22 Apr 2024 05:13:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713787995; cv=pass; d=google.com; s=arc-20160816; b=tO0AVsRLyjyI6RP5EwTupissVhKDzPU4jhSbVZ0+18RBoP6Nrw30f1VRDap7FHtE+f SGaJuhckhVVyIOqlQyQjqY1f3laP2yoL3xjMQDcIv8SuHDn6Tx81lWxNowBiR6mpFCdE F6xMS0wgcqHG5xKodzK8hWF9Ie5TgQyRCTC2wQmtqEIAlR3U0nKB3RufkujH26WxUS6l 8yqYM8xBTcSXjPI7LDXfg7IINdBKfNd+4+mFI9M/r4p8l8Ey5//4DKVlaDjO0vMSgOJr jHK2VQoX26o+h0n8iNPe2zrjw1LlaSL5/qQnKV06o5FkEPKeAgpCy/z/vAoggM66wIYi j/uw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=fjp1AQ9rkr7Yrkh3eZX+SphG9SdKzG7MzkdXBRALZ2M=; fh=JaIRVQDY4DmSUPRnckRzW/LCl4NIUzobPINmxwGFjOw=; b=SRkndBbd7hH7hX9HC0dGJv9YfyiAsYE/L+EMzmwz6BAW8QlncJm8viiswVOU9jM/YL nFHsNEPotqHCBjK4u3t5ZPurmNrEY89oPupgsi9vdIcRnS9a3J7ksRD78hP7snT7lyv4 bkrA/QSBQNytWeHNtkosfWUU0dYBeMqnd851B3UHzCqsU+xAuU+qUqasMGnCFk4t9CAT fLRGxlTCL36NlBFdoJvZDsPiHVbifwlPnifTMo1OVG8x8qhQfC5sQxHei6DaEeqmJogZ ++C0kqG9iISzzioWDjny7bCJVlO8QytKXDB1JPl3wLSkUCvjDUhvgPCvhXeGVHYB7Wwq H93A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c+o+JEF+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-6649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r26-20020a63205a000000b005e46720db84si7389792pgm.117.2024.04.22.05.13.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 05:13:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c+o+JEF+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-6649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2F86EB210BB for ; Mon, 22 Apr 2024 12:08:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7430E1465AB; Mon, 22 Apr 2024 12:08:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c+o+JEF+" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50815524A0 for ; Mon, 22 Apr 2024 12:08:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713787682; cv=none; b=aR+x4Aiiexsz7xr2KIiMptQIqSlh+fhqJI67/6NasWQIfEjk+HXChjUBVuitHtDvECEzUvQgPrB4hJMM2RznxdpaItR9PwEOfqlmmxrstNhhOPrejt7kIcGRxFSii6s7/Q6rLXPzPNksVshpLoWNOaTfytlKKxDSPsVNTTjRBUc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713787682; c=relaxed/simple; bh=4teQusw/frW2YkbHTwRL4Zs5nlti7cBw2MbjQWXL43Q=; h=Content-Type:MIME-Version:Subject:From:In-Reply-To:References:To: Cc:Message-ID:Date; b=rfukIoFNXPPZv89ZYbhBcNcgENIKFiReALhzv8On+EjAjVQwiFtwhBsBC6nFzoucM+JvTXgwqUiE8DNA8tc6hpubFa5dQGkBkzcQNLUK33NiXDoUIiLxFext972bRjZLOeGMVqCESp4nlZVW/9EJs130ZEq9VZEvUHkvAMlCTJA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c+o+JEF+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0378AC113CC; Mon, 22 Apr 2024 12:08:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713787682; bh=4teQusw/frW2YkbHTwRL4Zs5nlti7cBw2MbjQWXL43Q=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=c+o+JEF+3fzKamn3fQhCChUNlKOCshpHiTrfcZS+kwGlIV3KtPZ57Q/+5FpGQKZBE 035KBuEiB9838PXbYhiWzKc1ZIm0WU5o7OZ4K+uzm+oGWXzu4MYqGqc3zor+wfWHhS UJfcOFl9hY1oSeygccxbzT8edDPuiEBeAdo7qqqpBq41Ze0P3lkH6t2zDj90AUaMX3 D0eKyIJGCYoe6C2TMy9opfYsTYt1vzqUexOU1SsQIpRaDtPGgPaI9SqC8AsDH4/HGf gwJ586J1+HhZmCV36NHg6vAvioMYa3D1s9ipolRRZPuGQVPmiQOoZv/1lzffCm8Zcj e44vUc0sVFZTQ== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH v2] wifi: ath12k: fix out-of-bound access of qmi_invoke_handler() From: Kalle Valo In-Reply-To: <20240416080234.2882725-1-quic_kathirve@quicinc.com> References: <20240416080234.2882725-1-quic_kathirve@quicinc.com> To: Karthikeyan Kathirvel Cc: , , Karthikeyan Kathirvel , Jeff Johnson User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <171378767925.1358009.1322280791259157852.kvalo@kernel.org> Date: Mon, 22 Apr 2024 12:08:00 +0000 (UTC) Karthikeyan Kathirvel wrote: > Currently, there is no terminator entry for ath12k_qmi_msg_handlers hence > facing below KASAN warning, > > ================================================================== > BUG: KASAN: global-out-of-bounds in qmi_invoke_handler+0xa4/0x148 > Read of size 8 at addr ffffffd00a6428d8 by task kworker/u8:2/1273 > > CPU: 0 PID: 1273 Comm: kworker/u8:2 Not tainted 5.4.213 #0 > Workqueue: qmi_msg_handler qmi_data_ready_work > Call trace: > dump_backtrace+0x0/0x20c > show_stack+0x14/0x1c > dump_stack+0xe0/0x138 > print_address_description.isra.5+0x30/0x330 > __kasan_report+0x16c/0x1bc > kasan_report+0xc/0x14 > __asan_load8+0xa8/0xb0 > qmi_invoke_handler+0xa4/0x148 > qmi_handle_message+0x18c/0x1bc > qmi_data_ready_work+0x4ec/0x528 > process_one_work+0x2c0/0x440 > worker_thread+0x324/0x4b8 > kthread+0x210/0x228 > ret_from_fork+0x10/0x18 > > The address belongs to the variable: > ath12k_mac_mon_status_filter_default+0x4bd8/0xfffffffffffe2300 [ath12k] > [...] > ================================================================== > > Add a dummy terminator entry at the end to assist the qmi_invoke_handler() > in traversing up to the terminator entry without accessing an > out-of-boundary index. > > Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 > > Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") > Reviewed-by: Jeff Johnson > Signed-off-by: Karthikeyan Kathirvel > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. e1bdff48a1bb wifi: ath12k: fix out-of-bound access of qmi_invoke_handler() -- https://patchwork.kernel.org/project/linux-wireless/patch/20240416080234.2882725-1-quic_kathirve@quicinc.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches