Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2518004lqb; Tue, 28 May 2024 02:17:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWa2r0RIIJf2zbULNRGptDKLTuI4sOQPw+Uz45ReB29/86BLFOdjB4RdTofhyYpT5LpbcRUJrq/XNvMf6msaE2JnfFhFG6sCdPZqKF+aA== X-Google-Smtp-Source: AGHT+IFDvdDpDl/pfPVsbtmiVc6DiNvcbDBmeZNKpyyYSZx+r1XNhBLK4f0LwmEusX9NwQZ/XV0+ X-Received: by 2002:a17:906:aada:b0:a59:9eab:1630 with SMTP id a640c23a62f3a-a6265134cc0mr714628266b.69.1716887875155; Tue, 28 May 2024 02:17:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716887875; cv=pass; d=google.com; s=arc-20160816; b=XNSEK4Lgj4+dabV34cTUVNTqJvl0d+PYMhdI1tksKU2nIts63Yc92tg79MupuGn+Kp /+Fgr37QHVRLCSeG2Vi4Hz29RJ7BsoPJuW3gl/GnKuPEAFlvGaFob92PTbg5OSfvjuVs XTY+sM1RWKbxC1N80YA91yUNabCB631LGPjCIK3OxL3u05g0vl0M4fZvUb/A+4KcKgj3 9GDvtjit35o0dNbb/au+C87wbYghr0JOAdo2gI8tML5Skz2k3y8KGKLGeuArv/rsKzaN pN9/eaMU+npmBjxNKZ8N5b962N7In8UkNLySW+mZ263ETRYEzwn1pSNw6KV4sTm5wpGU t25g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:sender:message-id:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:subject:cc:to:from:references:in-reply-to :dkim-signature; bh=u6V23a4CaKODr1VkTAbDdbOLU9vRsWQDsBrqjogTQHs=; fh=9bEIRt1kFu0w5v3JaxBB4EWBt9QnAvmJsO4AZi65+Ao=; b=LZyEWTwMBtKpx+HX4j95PdIu3JXbkU2Npk70AjQH1+33ebZPvZY2w10OeeJmLX32+p zMTEwl20/PSOLlXUV2F64E/39wJaToTaBVd0XJJ+0INFMMzA+4s++3iuY8ziXQiZXhI1 prOJ8GhH6LZWEfdMl07HMg4XelVPfWk9U4WOaIBMkDNtM7YwqNpV7R8qUxGaIKv2A6XQ +r05uJbbxQAhXZD99dnD6ym2Ejca5AR4WlMjxlT3OGKmWw6OxU6RauNZlnpz3t8ao2n9 CME/f1Kgz+ccNwItnhCkyu9LDJoYiQbROC+mRDHTHVqL7pnpMhvNtB7QsaT4kF3te6Pw YJxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=bnHzTT10; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-191996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a62a0215025si400408866b.433.2024.05.28.02.17.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 02:17:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=bnHzTT10; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-191996-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk 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 am.mirrors.kernel.org (Postfix) with ESMTPS id DC73D1F21A4F for ; Tue, 28 May 2024 09:17:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0332413D8A1; Tue, 28 May 2024 09:17:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="bnHzTT10" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 6227317E8F3; Tue, 28 May 2024 09:17:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716887868; cv=none; b=SibUHkH+SJSb9Y9OGGFJTMezJb3PnynIjEGEu/f8/ns0j9girT23KX1Kj74F0BhP+R7dvc3g/sQMAya6Xb5Rzdam27AuLBDCW54FYRlSVG3L+v0BNY9dUwl4mNvfnoZQuzIKpQVfz12LPPnein6zXrgdPEokonhLhj+jgWo6WlI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716887868; c=relaxed/simple; bh=0nyQIlu5xVsGZoE/lFFn1UadS4mZECJUtykGucszjaM=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=Bu4v0/UFGwxynsTfA1D4QjRZUJmNMWjdDPDY2A/rnuvLJv30K83gP6TsbAV5MhNmwhr90LI3gpd5ks7WdGimhjKpCUxnOSCT0P9G66S5HeoLedm/FO/rN1gHABhxPSKzb45RccijFYHvcTDxnfBbaqhASvU3yg+Gtr+Ygo7xl0U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=bnHzTT10; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=u6V23a4CaKODr1VkTAbDdbOLU9vRsWQDsBrqjogTQHs=; b=bnHzTT10LQ8+Nji5i/v0CM7kp+ ryT8UToGKrFvQWN3uD2o+bCmY6fuk8peQ6Y3giK2680DaiHnyhDoRjpPAtR7XQptcJxDnDNv2D2Y9 vJJtpwRfZIM8GxSUcUgCuRGMOf4itaxsLRYIvqrMFyuRVoSTM4zL6z+Z7agen9XAeJqaO+UEnufaU r1rIohJFtDUnDszYkoSmfYsKHlVCrgjVUYdi0PWtgqAFAJ/mk3G+QHFPk8sYE974SlKyXujqWrc/k t9ZVXG/whfZjBIJ78oPdcpVZ9cKcJqkcasBuZi7yDkq5IrUBGovXJBLbzzy581MicYnwdCBRIlDFN OKY6FrLA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:37006 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sBsxf-0004XY-1s; Tue, 28 May 2024 10:17:39 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sBsxi-00E8vQ-5r; Tue, 28 May 2024 10:17:42 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Kalle Valo Cc: Johannes Berg , Michael Nemanov , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Subject: [PATCH wireless-next 1/8] wifi: wlcore: correctness fix fwlog reading Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Tue, 28 May 2024 10:17:42 +0100 Fix the calculation of clear_offset, which may overflow the end of the buffer. However, this is harmless if it does because in that case it will be recalculated when we copy the chunk of messages at the start of the buffer. Signed-off-by: Russell King (Oracle) --- drivers/net/wireless/ti/wlcore/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ti/wlcore/event.c b/drivers/net/wireless/ti/wlcore/event.c index 2499dc908305..6c3a8ea9613e 100644 --- a/drivers/net/wireless/ti/wlcore/event.c +++ b/drivers/net/wireless/ti/wlcore/event.c @@ -83,7 +83,7 @@ int wlcore_event_fw_logger(struct wl1271 *wl) /* Copy initial part up to the end of ring buffer */ len = min(actual_len, available_len); wl12xx_copy_fwlog(wl, &buffer[start_loc], len); - clear_ptr = addr_ptr + start_loc + actual_len; + clear_ptr = addr_ptr + start_loc + len; if (clear_ptr == buff_end_ptr) clear_ptr = buff_start_ptr; -- 2.30.2