Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fed0824a authored by Daniel Rosenberg's avatar Daniel Rosenberg Committed by Gerrit - the friendly Code Review server
Browse files

ANDROID: sdcardfs: Check stacked filesystem depth



bug: 111860541
Change-Id: Ia0a30b2b8956c4ada28981584cd8647713a1e993
Signed-off-by: default avatarDaniel Rosenberg <drosen@google.com>
(cherry picked from commit 9664bdeff388afe4749eee2332bc0cc220b6cee2)
Git-commit: 9664bdeff388afe4749eee2332bc0cc220b6cee2
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarRitesh Harjani <riteshh@codeaurora.org>
parent 0e75cda3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -295,6 +295,13 @@ static int sdcardfs_read_super(struct vfsmount *mnt, struct super_block *sb,
	atomic_inc(&lower_sb->s_active);
	sdcardfs_set_lower_super(sb, lower_sb);

	sb->s_stack_depth = lower_sb->s_stack_depth + 1;
	if (sb->s_stack_depth > FILESYSTEM_MAX_STACK_DEPTH) {
		pr_err("sdcardfs: maximum fs stacking depth exceeded\n");
		err = -EINVAL;
		goto out_sput;
	}

	/* inherit maxbytes from lower file system */
	sb->s_maxbytes = lower_sb->s_maxbytes;