Blob Blame History Raw
From: Vlastimil Babka <vbabka@suse.cz>
Subject: fs: prevent page refcount overflow in pipe_buf_get - KABI fix
References: CVE-2019-11487, bsc#1133190, KABI
Patch-mainline: Never, kABI

Hide return value change from void to bool, current callers can keep
ignoring it.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
 fs/pipe.c                 |    7 ++++++-
 include/linux/pipe_fs_i.h |   11 ++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -193,7 +193,12 @@ EXPORT_SYMBOL(generic_pipe_buf_steal);
  *	in the tee() system call, when we duplicate the buffers in one
  *	pipe into another.
  */
-bool generic_pipe_buf_get(struct pipe_inode_info *pipe, struct pipe_buffer *buf)
+#ifndef __GENKSYMS__
+bool
+#else
+void
+#endif
+generic_pipe_buf_get(struct pipe_inode_info *pipe, struct pipe_buffer *buf)
 {
 	return try_get_page(buf->page);
 }
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -107,7 +107,11 @@ struct pipe_buf_operations {
 	/*
 	 * Get a reference to the pipe buffer.
 	 */
+#ifndef __GENKSYMS__
 	bool (*get)(struct pipe_inode_info *, struct pipe_buffer *);
+#else
+	void (*get)(struct pipe_inode_info *, struct pipe_buffer *);
+#endif
 };
 
 /**
@@ -180,7 +184,12 @@ struct pipe_inode_info *alloc_pipe_info(
 void free_pipe_info(struct pipe_inode_info *);
 
 /* Generic pipe buffer ops functions */
-bool generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
+#ifndef __GENKSYMS__
+bool
+#else
+void
+#endif
+generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
 int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
 int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
 int generic_pipe_buf_nosteal(struct pipe_inode_info *, struct pipe_buffer *);