[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20180127004759.101823-1-ebiggers3@gmail.com>
Date: Fri, 26 Jan 2018 16:47:59 -0800
From: Eric Biggers <ebiggers3@...il.com>
To: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Zhouyi Zhou <yizhouzhou@....ac.cn>, Jens Axboe <axboe@...nel.dk>,
linux-block@...r.kernel.org, syzkaller-bugs@...glegroups.com,
Eric Biggers <ebiggers@...gle.com>, stable@...r.kernel.org
Subject: [PATCH] Revert "kernel/relay.c: fix potential memory leak"
From: Eric Biggers <ebiggers@...gle.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@...glegroups.com>
Cc: <stable@...r.kernel.org> # v4.7+
Signed-off-by: Eric Biggers <ebiggers@...gle.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);
--
2.16.0.rc1.238.g530d649a79-goog
Powered by blists - more mailing lists