From: Eric Biggers ebiggers@google.com
This reverts commit ba62bafe942b159a6109cbec780d36496e06b6c5.
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.
Fixes: ba62bafe942b ("kernel/relay.c: fix potential memory leak") Reported-by: syzbot syzkaller@googlegroups.com Cc: stable@vger.kernel.org # v4.7+ Signed-off-by: Eric Biggers ebiggers@google.com --- kernel/relay.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/kernel/relay.c b/kernel/relay.c index 39a9dfc69486..55da824f4adc 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -611,7 +611,6 @@ struct rchan *relay_open(const char *base_filename,
kref_put(&chan->kref, relay_destroy_channel); mutex_unlock(&relay_channels_mutex); - kfree(chan); return NULL; } EXPORT_SYMBOL_GPL(relay_open);
linux-stable-mirror@lists.linaro.org