Skip to contentSkip to conversation

spufs: fix a crash in spufs_create_root()

PATCH Applied Emmanuel Nicolet 3 participants 3 messages Oct 8, 2019 – Oct 11, 2019

Subsystems (3)
lore
Share & tools
lore
Acked-by on v1 1/1
#1 lore raw
In reply to Emmanuel Nicolet
Quoted 5 lines · Emmanuel Nicolet

The spu_fs_context was not set in fc->fs_private, this caused a crash when accessing ctx->mode in spufs_create_root().

Fixes d2e0981c3b9a ("vfs: Convert spufs to use the new mount API")
Quoted 18 lines
 arch/powerpc/platforms/cell/spufs/inode.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/platforms/cell/spufs/inode.c +1 -1
index 1d93e55a2de1..2dd452a047cd 100644
@@ -761,6 +761,7 @@ static int spufs_init_fs_context(struct fs_context *fc)
        ctx->gid = current_gid();
        ctx->mode = 0755;
 
+       fc->fs_private = ctx;
        fc->s_fs_info = sbi;
        fc->ops = &spufs_context_ops;
        return 0;
--

2.23.0

#0 lore raw

PATCH 1/1 spufs: fix a crash in spufs_create_root()

The spu_fs_context was not set in fc->fs_private, this caused a crash when accessing ctx->mode in spufs_create_root().

---
 arch/powerpc/platforms/cell/spufs/inode.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/platforms/cell/spufs/inode.c +1 -0
index 1d93e55a2de1..2dd452a047cd 100644
@@ -761,6 +761,7 @@ static int spufs_init_fs_context(struct fs_context *fc)
 	ctx->gid = current_gid();
 	ctx->mode = 0755;
 
+	fc->fs_private = ctx;
 	fc->s_fs_info = sbi;
 	fc->ops = &spufs_context_ops;
 	return 0;
Signature · 1 line
2.23.0