From mboxrd@z Thu Jan 1 00:00:00 1970 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 3152924A06B; Mon, 23 Jun 2025 13:09:49 +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=1750684189; cv=none; b=VOOk/DTMgLJqKJjEgFvKKrn9xs8QFiSrKclxt41T6qyXclyLDOZ71xwkI293tpRiXUX/+28zJQkP+O2dN+sp4nIQU7i90Ol7TICblVd36Z+opCl08Eo9cvW0K6QO7pW4zChRFW3c8/2evE8wgxuPoZVwmAdeDm60ysuYTi2a4f8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750684189; c=relaxed/simple; bh=nvMEiMBod2AI/COApO+A5gbiyXJm0kkJZ1JuYvywK0s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KvKVEkwoYJQR/ni7d2fCzdzCr7LkinXg2NDNMcSgZEehp4PC1mNPUf4O1dq+62WJutdCvB/vyBA1p/I21Dkv5OEOMcB+yYJlKPvz+186fFoT2qQZs2Ne1XAYgq5SHVFLKXZ4c/xVcJ2z8jKkpcRGMMV6vF3vvWSSIOCfXAP0QY0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=u5w4vUHd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="u5w4vUHd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7CDDC4CEEA; Mon, 23 Jun 2025 13:09:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750684189; bh=nvMEiMBod2AI/COApO+A5gbiyXJm0kkJZ1JuYvywK0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u5w4vUHdGTkWKNjYX6n9mXOmTp98XElkfI/z/j2NLDwrHPa4sfsa4Fvcb67oVejFl EtC4F2a7RJ60JYsfaDYr2ODs/7e1A8PTxiDA4YQHJLZUO4wIXQOKusrWKfSi3d4r4k 9fcxCuLAiYOCVv6VmpwxgnlCy2Y7crGVvnJjVGfY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jeongjun Park , Pan Taixi , "Steven Rostedt (Google)" Subject: [PATCH 5.15 001/411] tracing: Fix compilation warning on arm32 Date: Mon, 23 Jun 2025 15:02:25 +0200 Message-ID: <20250623130633.039939418@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130632.993849527@linuxfoundation.org> References: <20250623130632.993849527@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pan Taixi commit 2fbdb6d8e03b70668c0876e635506540ae92ab05 upstream. On arm32, size_t is defined to be unsigned int, while PAGE_SIZE is unsigned long. This hence triggers a compilation warning as min() asserts the type of two operands to be equal. Casting PAGE_SIZE to size_t solves this issue and works on other target architectures as well. Compilation warning details: kernel/trace/trace.c: In function 'tracing_splice_read_pipe': ./include/linux/minmax.h:20:28: warning: comparison of distinct pointer types lacks a cast (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) ^ ./include/linux/minmax.h:26:4: note: in expansion of macro '__typecheck' (__typecheck(x, y) && __no_side_effects(x, y)) ^~~~~~~~~~~ ... kernel/trace/trace.c:6771:8: note: in expansion of macro 'min' min((size_t)trace_seq_used(&iter->seq), ^~~ Cc: stable@vger.kernel.org Link: https://lore.kernel.org/20250526013731.1198030-1-pantaixi@huaweicloud.com Fixes: f5178c41bb43 ("tracing: Fix oob write in trace_seq_to_buffer()") Reviewed-by: Jeongjun Park Signed-off-by: Pan Taixi Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -7030,7 +7030,7 @@ static ssize_t tracing_splice_read_pipe( ret = trace_seq_to_buffer(&iter->seq, page_address(spd.pages[i]), min((size_t)trace_seq_used(&iter->seq), - PAGE_SIZE)); + (size_t)PAGE_SIZE)); if (ret < 0) { __free_page(spd.pages[i]); break;