From: <gregkh@linuxfoundation.org>
To: <viro@zeniv.linux.org.uk>, <gregkh@linuxfoundation.org>
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "do_last(): don't let a bogus return value from ->open() et.al. to confuse us" has been added to the 3.14-stable tree
Date: Tue, 01 Mar 2016 22:23:08 +0000 [thread overview]
Message-ID: <1456870987157212@kroah.com> (raw)
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 3.14-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-3.14 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
@@ -3085,6 +3085,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-3.14/lock_parent-don-t-step-on-stale-d_parent-of-all-but-freed-one.patch
queue-3.14/lift-the-already-marked-killed-case-into-shrink_dentry_list.patch
queue-3.14/vfs-avoid-softlockups-with-sendfile-2.patch
queue-3.14/expand-dentry_kill-dentry-0-in-shrink_dentry_list.patch
queue-3.14/bcache-fix-a-leak-in-bch_cached_dev_run.patch
queue-3.14/do_last-don-t-let-a-bogus-return-value-from-open-et.al.-to-confuse-us.patch
queue-3.14/dcache-add-missing-lockdep-annotation.patch
queue-3.14/dealing-with-the-rest-of-shrink_dentry_list-livelock.patch
queue-3.14/split-dentry_kill.patch
queue-3.14/shrink_dentry_list-take-parent-s-d_lock-earlier.patch
queue-3.14/dentry_kill-doesn-t-need-the-second-argument-now.patch
queue-3.14/uml-fix-hostfs-mknod.patch
reply other threads:[~2016-03-01 22:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456870987157212@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).