OSDN Git Service

[PATCH] Lost sockfd_put() in routing_ioctl()
authorKirill Korotaev <dev@sw.ru>
Fri, 9 Sep 2005 09:59:48 +0000 (13:59 +0400)
committerMarcelo Tosatti <marcelo@dmt.cnet>
Mon, 19 Sep 2005 14:57:19 +0000 (11:57 -0300)
commitec2ca6b5fd078e712cd0b053df94406ab1028417
treec89262f5acd9e91e07a4e382c29f3bb51f7e9964
parent04eca707e6e8de6d4542c61081225a984e0e3b3d
[PATCH] Lost sockfd_put() in routing_ioctl()

This patch adds lost sockfd_put() in 32bit compat rounting_ioctl() on
64bit platforms

I believe this is a security issues, since user can fget() file as many
times as he wants to. So file refcounter can be overlapped and first
fput() will free resources though there will be still structures
pointing to the file, mnt, dentry etc.
Also fput() sets f_dentry and f_vfsmnt to NULL,
so other file users will OOPS.

The oops can be done under files_lock and others, so this can be an
exploitable DoS on SMP. Didn't checked it on practice actually.

Signed-Off-By: Kirill Korotaev <dev@sw.ru>
Signed-Off-By: Maxim Giryaev <gem@sw.ru>
diff --git a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c
arch/ppc64/kernel/ioctl32.c
arch/sparc64/kernel/ioctl32.c
arch/x86_64/ia32/ia32_ioctl.c