* Patch "dm log writes: fix check of kthread_run() return value" has been added to the 4.7-stable tree
@ 2016-09-22 13:34 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-09-22 13:34 UTC (permalink / raw)
To: vz, gregkh, snitzer; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
dm log writes: fix check of kthread_run() return value
to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
dm-log-writes-fix-check-of-kthread_run-return-value.patch
and it can be found in the queue-4.7 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 91e630d9ae6de6f740ef7c8176736eb55366833e Mon Sep 17 00:00:00 2001
From: Vladimir Zapolskiy <vz@mleia.com>
Date: Thu, 10 Mar 2016 01:22:19 +0200
Subject: dm log writes: fix check of kthread_run() return value
From: Vladimir Zapolskiy <vz@mleia.com>
commit 91e630d9ae6de6f740ef7c8176736eb55366833e upstream.
The kthread_run() function returns either a valid task_struct or
ERR_PTR() value, check for NULL is invalid. This change fixes potential
for oops, e.g. in OOM situation.
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-log-writes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/md/dm-log-writes.c
+++ b/drivers/md/dm-log-writes.c
@@ -456,9 +456,9 @@ static int log_writes_ctr(struct dm_targ
goto bad;
}
- ret = -EINVAL;
lc->log_kthread = kthread_run(log_writes_kthread, lc, "log-write");
- if (!lc->log_kthread) {
+ if (IS_ERR(lc->log_kthread)) {
+ ret = PTR_ERR(lc->log_kthread);
ti->error = "Couldn't alloc kthread";
dm_put_device(ti, lc->dev);
dm_put_device(ti, lc->logdev);
Patches currently in stable-queue which might be from vz@mleia.com are
queue-4.7/dm-log-writes-fix-check-of-kthread_run-return-value.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-09-22 13:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-22 13:34 Patch "dm log writes: fix check of kthread_run() return value" has been added to the 4.7-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).