All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "devpts: return NULL pts 'priv' entry for non-devpts nodes" 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: torvalds, dvyukov, ebiederm, gregkh; +Cc: stable, stable-commits


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

    devpts: return NULL pts 'priv' entry for non-devpts nodes

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:
     devpts-return-null-pts-priv-entry-for-non-devpts-nodes.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 3e423945ea94412283eaba8bfbe9d6e0a80b434f Mon Sep 17 00:00:00 2001
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sat, 3 Sep 2016 11:02:50 -0700
Subject: devpts: return NULL pts 'priv' entry for non-devpts nodes

From: Linus Torvalds <torvalds@linux-foundation.org>

commit 3e423945ea94412283eaba8bfbe9d6e0a80b434f upstream.

In commit 8ead9dd54716 ("devpts: more pty driver interface cleanups") I
made devpts_get_priv() just return the dentry->fs_data directly.  And
because I thought it wouldn't happen, I added a warning if you ever saw
a pts node that wasn't on devpts.

And no, that warning never triggered under any actual real use, but you
can trigger it by creating nonsensical pts nodes by hand.

So just revert the warning, and make devpts_get_priv() return NULL for
that case like it used to.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Eric W Biederman" <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/devpts/inode.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -584,7 +584,8 @@ struct dentry *devpts_pty_new(struct pts
  */
 void *devpts_get_priv(struct dentry *dentry)
 {
-	WARN_ON_ONCE(dentry->d_sb->s_magic != DEVPTS_SUPER_MAGIC);
+	if (dentry->d_sb->s_magic != DEVPTS_SUPER_MAGIC)
+		return NULL;
 	return dentry->d_fsdata;
 }
 


Patches currently in stable-queue which might be from torvalds@linux-foundation.org are

queue-4.7/perf-x86-intel-pt-fix-an-off-by-one-in-address-filter-configuration.patch
queue-4.7/perf-x86-intel-fix-pebsv3-record-drain.patch
queue-4.7/rapidio-tsi721-fix-incorrect-detection-of-address-translation-condition.patch
queue-4.7/x86-paravirt-do-not-trace-_paravirt_ident_-functions.patch
queue-4.7/revert-af_unix-fix-splice-bind-deadlock.patch
queue-4.7/mm-oom-prevent-premature-oom-killer-invocation-for-high-order-request.patch
queue-4.7/mm-mempolicy-task-mempolicy-must-be-null-before-dropping-final-reference.patch
queue-4.7/perf-x86-intel-pt-do-validate-the-size-of-a-kernel-address-filter.patch
queue-4.7/af_unix-split-u-readlock-into-two-iolock-and-bindlock.patch
queue-4.7/kexec-fix-double-free-when-failing-to-relocate-the-purgatory.patch
queue-4.7/sched-core-fix-a-race-between-try_to_wake_up-and-a-woken-up-task.patch
queue-4.7/perf-x86-intel-pt-fix-kernel-address-filter-s-offset-validation.patch
queue-4.7/devpts-return-null-pts-priv-entry-for-non-devpts-nodes.patch
queue-4.7/perf-x86-amd-make-hw_cache_references-and-hw_cache_misses-measure-l2.patch

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

only message in thread, other threads:[~2016-09-22 13:34 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 "devpts: return NULL pts 'priv' entry for non-devpts nodes" has been added to the 4.7-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.