summaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2016-08-29 06:28:26 +0200
committerDavid S. Miller <davem@davemloft.net>2016-09-01 06:00:19 +0200
commitc0338aff2260ea6c092806312dbb154cec07a242 (patch)
tree78da2b443e5210c8913e17fe15ad9da2ee9680c1 /net/bridge
parentMerge branch 'mediatek-fixes' (diff)
downloadlinux-c0338aff2260ea6c092806312dbb154cec07a242.tar.xz
linux-c0338aff2260ea6c092806312dbb154cec07a242.zip
kcm: fix a socket double free
Dmitry reported a double free on kcm socket, which could be easily reproduced by: #include <unistd.h> #include <sys/syscall.h> int main() { int fd = syscall(SYS_socket, 0x29ul, 0x5ul, 0x0ul, 0, 0, 0); syscall(SYS_ioctl, fd, 0x89e2ul, 0x20a98000ul, 0, 0, 0); return 0; } This is because on the error path, after we install the new socket file, we call sock_release() to clean up the socket, which leaves the fd pointing to a freed socket. Fix this by calling sys_close() on that fd directly. Fixes: ab7ac4eb9832 ("kcm: Kernel Connection Multiplexor module") Reported-by: Dmitry Vyukov <dvyukov@google.com> Cc: Tom Herbert <tom@herbertland.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
0 files changed, 0 insertions, 0 deletions