mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-12-10 08:24:20 -05:00
25 lines
657 B
Diff
25 lines
657 B
Diff
|
From 0f29566b5fad388cc4a07402f9651d86f1fe2b45 Mon Sep 17 00:00:00 2001
|
||
|
From: Tom Marshall <tdm.code@gmail.com>
|
||
|
Date: Fri, 19 May 2017 18:24:49 +0000
|
||
|
Subject: [PATCH] kernel: Fix potential refcount leak in su check
|
||
|
|
||
|
Change-Id: I3d241ae805ba708c18bccfd5e5d6cdcc8a5bc1c8
|
||
|
---
|
||
|
|
||
|
diff --git a/fs/namei.c b/fs/namei.c
|
||
|
index 414fc51..689339e 100644
|
||
|
--- a/fs/namei.c
|
||
|
+++ b/fs/namei.c
|
||
|
@@ -1803,8 +1803,10 @@
|
||
|
if (!err) {
|
||
|
struct super_block *sb = nd->inode->i_sb;
|
||
|
if (sb->s_flags & MS_RDONLY) {
|
||
|
- if (d_is_su(nd->path.dentry) && !su_visible())
|
||
|
+ if (d_is_su(nd->path.dentry) && !su_visible()) {
|
||
|
+ path_put(&nd->path);
|
||
|
err = -ENOENT;
|
||
|
+ }
|
||
|
}
|
||
|
}
|
||
|
|