All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trace-cmd: Make sure 32 bit works on 64 bit file systems
@ 2022-12-21 18:51 Steven Rostedt
  2022-12-22 17:36 ` Ross Zwisler
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2022-12-21 18:51 UTC (permalink / raw)
  To: Linux Trace Devel; +Cc: Mike Frysinger, Ross Zwisler

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

As stat() can overflow if a 32 bit user space reads a file on a file
system that has inodes greater than MAX_INT. Compile with
_FILE_OFFSET_BITS=64 that mitigates this problem on 32 bit user space.

Reported-by: Mike Frysinger <vapier@google.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile b/Makefile
index bda49dd9b3d8..1f2797604392 100644
--- a/Makefile
+++ b/Makefile
@@ -350,6 +350,9 @@ export INCLUDES
 # Required CFLAGS
 override CFLAGS += -D_GNU_SOURCE
 
+# Make sure 32 bit stat() works on large file systems
+override CFLAGS += -D_FILE_OFFSET_BITS=64
+
 ifndef NO_PTRACE
 ifneq ($(call try-cc,$(SOURCE_PTRACE),),y)
 	NO_PTRACE = 1
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-22 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-21 18:51 [PATCH] trace-cmd: Make sure 32 bit works on 64 bit file systems Steven Rostedt
2022-12-22 17:36 ` Ross Zwisler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.