Message ID | CAOQ4uxgK9+Nwxtj9GCHp-fFg7Gsu0HMA2-MeguBJ=BWxQATWmw@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Nov 4, 2016 at 10:29 AM, Amir Goldstein <amir73il@gmail.com> wrote: > You did not address my comment about the 'stack' allocation overflow > in ovl_lookup > I believe the (possible) overflow is demonstrated by the following debug patch: Oops, missed that. Good spotting! And there's more shit that unionfs-testsuite didn't discover (not even involving multiple layers): rm -rf /lower /upper /work mkdir -p /lower/a/b/c /upper /work mount -t overlay overlay -oupperdir=/upper,lowerdir=/lower,workdir=/work /mnt mv /mnt/a /mnt/z mv /mnt/z/b /mnt/q ls /mnt/q umount /mnt mount -t overlay overlay -oupperdir=/upper,lowerdir=/lower,workdir=/work /mnt ls /mnt/q umount /mnt Next update coming up... Thanks, Miklos -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index c7cacbb..7171bfb 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -231,5 +231,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry, goto out_put; if (redirect && poe != dentry->d_sb->s_root->d_fsdata) { + int stackroom = poe->numlower - ctr; + poe = dentry->d_sb->s_root->d_fsdata;