Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 43807eba authored by Slava Pestov's avatar Slava Pestov Committed by Greg Kroah-Hartman
Browse files

tracing: Fix panic when lseek() called on "trace" opened for writing

commit 364829b1

 upstream.

The file_ops struct for the "trace" special file defined llseek as seq_lseek().
However, if the file was opened for writing only, seq_open() was not called,
and the seek would dereference a null pointer, file->private_data.

This patch introduces a new wrapper for seq_lseek() which checks if the file
descriptor is opened for reading first. If not, it does nothing.

Signed-off-by: default avatarSlava Pestov <slavapestov@google.com>
LKML-Reference: <1290640396-24179-1-git-send-email-slavapestov@google.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 21f29a80
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment