* [PATCH v2] libtraceevent: Make sure 32 bit works on 64 bit file systems
@ 2022-12-21 18:40 Steven Rostedt
2022-12-22 17:35 ` Ross Zwisler
0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2022-12-21 18:40 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 965ff47eae7d..a8a56b6773be 100644
--- a/Makefile
+++ b/Makefile
@@ -130,6 +130,9 @@ else
CFLAGS := -g -Wall
endif
+# Make sure 32 bit stat() works on large file systems
+CFLAGS += -D_FILE_OFFSET_BITS=64
+
LIBS ?= -ldl
export LIBS
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] libtraceevent: Make sure 32 bit works on 64 bit file systems
2022-12-21 18:40 [PATCH v2] libtraceevent: Make sure 32 bit works on 64 bit file systems Steven Rostedt
@ 2022-12-22 17:35 ` Ross Zwisler
0 siblings, 0 replies; 2+ messages in thread
From: Ross Zwisler @ 2022-12-22 17:35 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Linux Trace Devel, Mike Frysinger
On Wed, Dec 21, 2022 at 01:40:51PM -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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-12-22 17:35 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:40 [PATCH v2] libtraceevent: Make sure 32 bit works on 64 bit file systems Steven Rostedt
2022-12-22 17:35 ` 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.