summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-02-06 15:40:24 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-06 18:32:46 -0800
commita1be1f3931bfe0a42b46fef77a04593c2b136e7f (patch)
treebaff9a1d4276404cd0ce63aff26846d328f4f8c1 /kernel
parent28f3a488ed83ac4a01406490941a6486806d1333 (diff)
downloadlinux-a1be1f3931bfe0a42b46fef77a04593c2b136e7f.tar.gz
linux-a1be1f3931bfe0a42b46fef77a04593c2b136e7f.tar.bz2
linux-a1be1f3931bfe0a42b46fef77a04593c2b136e7f.zip
kernel/relay.c: revert "kernel/relay.c: fix potential memory leak"
This reverts commit ba62bafe942b ("kernel/relay.c: fix potential memory leak"). This commit introduced a double free bug, because 'chan' is already freed by the line: kref_put(&chan->kref, relay_destroy_channel); This bug was found by syzkaller, using the BLKTRACESETUP ioctl. Link: http://lkml.kernel.org/r/20180127004759.101823-1-ebiggers3@gmail.com Fixes: ba62bafe942b ("kernel/relay.c: fix potential memory leak") Signed-off-by: Eric Biggers <ebiggers@google.com> Reported-by: syzbot <syzkaller@googlegroups.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Zhouyi Zhou <yizhouzhou@ict.ac.cn> Cc: Jens Axboe <axboe@kernel.dk> Cc: <stable@vger.kernel.org> [4.7+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/relay.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/kernel/relay.c b/kernel/relay.c
index 41280033a4c5..f7f40a6e6352 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -611,7 +611,6 @@ free_bufs:
kref_put(&chan->kref, relay_destroy_channel);
mutex_unlock(&relay_channels_mutex);
- kfree(chan);
return NULL;
}
EXPORT_SYMBOL_GPL(relay_open);