Message ID | 20221221135154.427ad9f4@gandalf.local.home (mailing list archive) |
---|---|
State | Accepted |
Commit | 9e88257bf1f8d7a0029586118b11c6036bb1cbc8 |
Headers | show |
Series | trace-cmd: Make sure 32 bit works on 64 bit file systems | expand |
On Wed, Dec 21, 2022 at 01:51:54PM -0500, Steven Rostedt wrote: > 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> Tested-by: Ross Zwisler <zwisler@google.com>
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