All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "do_last(): don't let a bogus return value from ->open() et.al. to confuse us" has been added to the 4.4-stable tree
@ 2016-03-01 22:23 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-03-01 22:23 UTC (permalink / raw)
  To: viro, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    do_last(): don't let a bogus return value from ->open() et.al. to confuse us

to the 4.4-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:
     do_last-don-t-let-a-bogus-return-value-from-open-et.al.-to-confuse-us.patch
and it can be found in the queue-4.4 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 c80567c82ae4814a41287618e315a60ecf513be6 Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Sat, 27 Feb 2016 19:17:33 -0500
Subject: do_last(): don't let a bogus return value from ->open() et.al. to confuse us

From: Al Viro <viro@zeniv.linux.org.uk>

commit c80567c82ae4814a41287618e315a60ecf513be6 upstream.

... into returning a positive to path_openat(), which would interpret that
as "symlink had been encountered" and proceed to corrupt memory, etc.
It can only happen due to a bug in some ->open() instance or in some LSM
hook, etc., so we report any such event *and* make sure it doesn't trick
us into further unpleasantness.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/namei.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3210,6 +3210,10 @@ opened:
 			goto exit_fput;
 	}
 out:
+	if (unlikely(error > 0)) {
+		WARN_ON(1);
+		error = -EINVAL;
+	}
 	if (got_write)
 		mnt_drop_write(nd->path.mnt);
 	path_put(&save_parent);


Patches currently in stable-queue which might be from viro@zeniv.linux.org.uk are

queue-4.4/make-sure-that-freeing-shmem-fast-symlinks-is-rcu-delayed.patch
queue-4.4/do_last-eloop-failure-exit-should-be-done-after-leaving-rcu-mode.patch
queue-4.4/bcache-fix-a-leak-in-bch_cached_dev_run.patch
queue-4.4/do_last-don-t-let-a-bogus-return-value-from-open-et.al.-to-confuse-us.patch
queue-4.4/locks-fix-unlock-when-fcntl_setlk-races-with-a-close.patch
queue-4.4/namei-d_inode-of-a-pinned-dentry-is-stable-only-for-positives.patch
queue-4.4/should_follow_link-validate-d_seq-after-having-decided-to-follow.patch
queue-4.4/uml-fix-hostfs-mknod.patch
queue-4.4/hpfs-don-t-truncate-the-file-when-delete-fails.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-01 22:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 22:23 Patch "do_last(): don't let a bogus return value from ->open() et.al. to confuse us" has been added to the 4.4-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.