All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libtracefs: Make sure 32 bit works on 64 bit file systems
@ 2022-12-21 18:49 Steven Rostedt
  2022-12-22 17:35 ` Ross Zwisler
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2022-12-21 18:49 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 27d425c975ad..36c2076cf788 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)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libtracefs: Make sure 32 bit works on 64 bit file systems
  2022-12-21 18:49 [PATCH] libtracefs: 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:49:03PM -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:36 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:49 [PATCH] libtracefs: 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.