public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Drop reference added by grab_header
@ 2017-01-05 11:33 Zhou Chengming
  2017-01-05 11:56 ` Hanjun Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Zhou Chengming @ 2017-01-05 11:33 UTC (permalink / raw)
  To: linux-kernel, viro, ebiederm, balbi
  Cc: konishi.ryusuke, jack, dmitry.torokhov, caiqian, yangshukui,
	guohanjun, dingtianhong, lizefan, zhouchengming1

Fixes CVE-2016-9191.

Reported-by: CAI Qian <caiqian@redhat.com>
Tested-by: Yang Shukui <yangshukui@huawei.com>
Signed-off-by: Zhou Chengming <zhouchengming1@huawei.com>
---
 fs/proc/proc_sysctl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 5d931bf..c4c90bd 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -718,7 +718,7 @@ static int proc_sys_readdir(struct file *file, struct dir_context *ctx)
 	ctl_dir = container_of(head, struct ctl_dir, header);
 
 	if (!dir_emit_dots(file, ctx))
-		return 0;
+		goto out;
 
 	pos = 2;
 
@@ -728,6 +728,7 @@ static int proc_sys_readdir(struct file *file, struct dir_context *ctx)
 			break;
 		}
 	}
+out:
 	sysctl_head_finish(head);
 	return 0;
 }
-- 
1.7.7

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

end of thread, other threads:[~2017-01-05 12:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-05 11:33 [PATCH] Drop reference added by grab_header Zhou Chengming
2017-01-05 11:56 ` Hanjun Guo
2017-01-05 12:14   ` zhouchengming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox