From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> 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@xxxxxxxxxx> Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> --- Changes since v2: https://lore.kernel.org/linux-trace-devel/20221221134051.53aad658@xxxxxxxxxxxxxxxxxx/ - Add "override" otherwise it can get lost if CFLAGS is defined externally Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 965ff47eae7d..746aedb528de 100644 --- a/Makefile +++ b/Makefile @@ -164,6 +164,9 @@ override CFLAGS += -fPIC override CFLAGS += $(CONFIG_FLAGS) $(INCLUDES) $(PLUGIN_DIR_SQ) override CFLAGS += $(udis86-flags) -D_GNU_SOURCE +# Make sure 32 bit stat() works on large file systems +override CFLAGS += -D_FILE_OFFSET_BITS=64 + ifeq ($(VERBOSE),1) Q = else -- 2.35.1