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

Commit 236c0765 authored by Daniel Rosenberg's avatar Daniel Rosenberg
Browse files

ANDROID: sdcardfs: Check stacked filesystem depth



bug: 111860541
Change-Id: Ia0a30b2b8956c4ada28981584cd8647713a1e993
Signed-off-by: default avatarDaniel Rosenberg <drosen@google.com>
parent f0874564
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;