lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250529082333.655cc7a8@gandalf.local.home>
Date: Thu, 29 May 2025 08:23:33 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
 <mathieu.desnoyers@...icios.com>, Pan Taixi <pantaixi@...weicloud.com>
Subject: [for-next][PATCH] tracing: Fix compilation warning on arm32


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace/for-next

Head SHA1: 2fbdb6d8e03b70668c0876e635506540ae92ab05


Pan Taixi (1):
      tracing: Fix compilation warning on arm32

----
 kernel/trace/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---------------------------
commit 2fbdb6d8e03b70668c0876e635506540ae92ab05
Author: Pan Taixi <pantaixi@...weicloud.com>
Date:   Mon May 26 09:37:31 2025 +0800

    tracing: Fix compilation warning on arm32
    
    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@...r.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 <aha310510@...il.com>
    Signed-off-by: Pan Taixi <pantaixi@...weicloud.com>
    Signed-off-by: Steven Rostedt (Google) <rostedt@...dmis.org>

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2c1764ed87b0..b60d495c2a79 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -6891,7 +6891,7 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
 		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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ