[bug report] fuse: move fget() to fuse_get_tree()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Miklos Szeredi,

The patch ff12b2314569: "fuse: move fget() to fuse_get_tree()" from
Aug 4, 2021, leads to the following static checker warning:

	fs/fuse/inode.c:1557 fuse_fill_super()
	error: uninitialized symbol 'err'.

fs/fuse/inode.c
    1508 static int fuse_fill_super(struct super_block *sb, struct fs_context *fsc)
    1509 {
    1510 	struct fuse_fs_context *ctx = fsc->fs_private;
    1511 	int err;
                ^^^^^^^

    1512 	struct fuse_conn *fc;
    1513 	struct fuse_mount *fm;
    1514 
    1515 	if (!ctx->file || !ctx->rootmode_present ||
    1516 	    !ctx->user_id_present || !ctx->group_id_present)
    1517 		return -EINVAL;
    1518 
    1519 	/*
    1520 	 * Require mount to happen from the same user namespace which
    1521 	 * opened /dev/fuse to prevent potential attacks.
    1522 	 */
    1523 	if ((ctx->file->f_op != &fuse_dev_operations) ||
    1524 	    (ctx->file->f_cred->user_ns != sb->s_user_ns))
    1525 		goto err;

This should be -EINVAL, right?

    1526 	ctx->fudptr = &ctx->file->private_data;
    1527 
    1528 	fc = kmalloc(sizeof(*fc), GFP_KERNEL);
    1529 	err = -ENOMEM;
    1530 	if (!fc)
    1531 		goto err;
    1532 
    1533 	fm = kzalloc(sizeof(*fm), GFP_KERNEL);
    1534 	if (!fm) {
    1535 		kfree(fc);
    1536 		goto err;
    1537 	}
    1538 
    1539 	fuse_conn_init(fc, fm, sb->s_user_ns, &fuse_dev_fiq_ops, NULL);
    1540 	fc->release = fuse_free_conn;
    1541 
    1542 	sb->s_fs_info = fm;
    1543 
    1544 	err = fuse_fill_super_common(sb, ctx);
    1545 	if (err)
    1546 		goto err_put_conn;
    1547 	/* file->private_data shall be visible on all CPUs after this */
    1548 	smp_mb();
    1549 	fuse_send_init(get_fuse_mount_super(sb));
    1550 	return 0;
    1551 
    1552  err_put_conn:
    1553 	fuse_conn_put(fc);
    1554 	kfree(fm);
    1555 	sb->s_fs_info = NULL;
    1556  err:
--> 1557 	return err;
    1558 }

regards,
dan carpenter



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux