Skip to contentSkip to conversation

libtracefs: Make sure 32 bit works on 64 bit file systems

PATCH In review Steven Rostedt 2 participants 2 messages Dec 21, 2022 – Dec 22, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtracefs: Make sure 32 bit works on 64 bit file systems

From: "Steven Rostedt (Google)" <[email protected]>

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.

---
 Makefile | 3 +++
 1 file changed, 3 insertions(+)
Makefile +3 -0
index 27d425c975ad..36c2076cf788 100644
@@ -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)
Signature · 1 line
2.35.1