Skip to contentSkip to conversation

Patch "devpts: return NULL pts 'priv' entry for non-devpts nodes" has been added to the 4.7-stable tree

PATCH [email protected] 1 participant 1 message Sep 22, 2016 Stable branch

lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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 <[email protected]> know about it.

Quoted 1 line

From 3e423945ea94412283eaba8bfbe9d6e0a80b434f Mon Sep 17 00:00:00 2001

From: Linus Torvalds <[email protected]>
Date: Sat, 3 Sep 2016 11:02:50 -0700
Subject: devpts: return NULL pts 'priv' entry for non-devpts nodes

From: Linus Torvalds <[email protected]>

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.

---
 fs/devpts/inode.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/devpts/inode.c +2 -1
@@ -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 [email protected] 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