DivestOS/Patches/Linux_CVEs/LVT-2017-0003/3.10/0.patch
2017-10-29 22:14:37 -04:00

27 lines
923 B
Diff

From 984ee30b63ad26f934cb67ef280200fc161583c1 Mon Sep 17 00:00:00 2001
From: Alberto97 <albertop2197@gmail.com>
Date: Tue, 23 May 2017 21:47:00 +0200
Subject: [PATCH] Fix "hide su" patch for 3.10
Without this, "ls system/xbin" returns "ls: system/xbin/su: No such file or directory"
if root is disabled in Developer Settings.
This happens because EXT4 uses "readdir" instead of "iterate".
3.18 kernel, instead, unconditionally goes for the "iterate" way here
and that explains why I'm not seeing this error there.
Change-Id: I26426683df0fd199a80f053294f352e31754bec5
---
diff --git a/fs/readdir.c b/fs/readdir.c
index d52d18d..e1b7e19 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -43,6 +43,7 @@
res = file->f_op->iterate(file, ctx);
file->f_pos = ctx->pos;
} else {
+ ctx->romnt = (inode->i_sb->s_flags & MS_RDONLY);
res = file->f_op->readdir(file, ctx, ctx->actor);
ctx->pos = file->f_pos;
}