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

Commit 90d26aa8 authored by Martin Brandenburg's avatar Martin Brandenburg
Browse files

Orangefs: do not finalize bufmap if it was never initialized.



Found by the infant Orangefs fuzzer...

Signed-off-by: default avatarMartin Brandenburg <martin@omnibond.com>
Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
parent ce6c414e
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -600,6 +600,7 @@ static int orangefs_devreq_release(struct inode *inode, struct file *file)
		     __func__);

	mutex_lock(&devreq_mutex);
	if (get_bufmap_init())
		orangefs_bufmap_finalize();

	open_access_count--;
@@ -692,7 +693,13 @@ static long dispatch_ioctl_command(unsigned int command, unsigned long arg)
				     (struct ORANGEFS_dev_map_desc __user *)
				     arg,
				     sizeof(struct ORANGEFS_dev_map_desc));
		return ret ? -EIO : orangefs_bufmap_initialize(&user_desc);
		if (get_bufmap_init()) {
			return -EINVAL;
		} else {
			return ret ?
			       -EIO :
			       orangefs_bufmap_initialize(&user_desc);
		}
	case ORANGEFS_DEV_REMOUNT_ALL:
		gossip_debug(GOSSIP_DEV_DEBUG,
			     "%s: got ORANGEFS_DEV_REMOUNT_ALL\n",