aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2022-12-21 13:49:03 -0500
committerSteven Rostedt (Google) <rostedt@goodmis.org>2023-01-03 18:33:45 -0500
commit6476bc3b39f3e4dad6d2d9baa0e7a491fa08d8fc (patch)
tree4d58e8b0959ba02bed12d46b401a558913f9562c
parenta053233c583fe3e7c53e99a233c3bfac0a828a3b (diff)
downloadlibtracefs-6476bc3b39f3e4dad6d2d9baa0e7a491fa08d8fc.tar.gz
libtracefs: Make sure 32 bit works on 64 bit file systems
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. Link: https://lore.kernel.org/linux-trace-devel/20221221134903.4520c983@gandalf.local.home Reported-by: Mike Frysinger <vapier@google.com> Tested-by: Ross Zwisler <zwisler@google.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 27d425c..36c2076 100644
--- a/Makefile
+++ b/Makefile
@@ -164,6 +164,9 @@ export INCLUDES
# Append required CFLAGS
override CFLAGS += -D_GNU_SOURCE $(LIBTRACEEVENT_INCLUDES) $(INCLUDES)
+# Make sure 32 bit stat() works on large file systems
+override CFLAGS += -D_FILE_OFFSET_BITS=64
+
all: all_cmd
LIB_TARGET = libtracefs.a libtracefs.so.$(TRACEFS_VERSION)