lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190102091731.GB3781@kadam>
Date:   Wed, 2 Jan 2019 12:17:31 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Christian Brauner <christian@...uner.io>
Cc:     gregkh@...uxfoundation.org, tkjos@...roid.com,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        joel@...lfernandes.org, arve@...roid.com, maco@...roid.com,
        Todd Kjos <tkjos@...gle.com>
Subject: Re: [PATCH v1 1/2] binderfs: implement "max" mount option

On Sun, Dec 23, 2018 at 03:35:49PM +0100, Christian Brauner wrote:
>  static inline struct binderfs_info *BINDERFS_I(const struct inode *inode)
> @@ -110,10 +132,16 @@ static int binderfs_binder_device_create(struct inode *ref_inode,
>  
>  	/* Reserve new minor number for the new device. */
>  	mutex_lock(&binderfs_minors_mutex);
> -	minor = ida_alloc_max(&binderfs_minors, BINDERFS_MAX_MINOR, GFP_KERNEL);
> +	if (++info->device_count <= info->mount_opts.max)
> +		minor = ida_alloc_max(&binderfs_minors, BINDERFS_MAX_MINOR,
> +				      GFP_KERNEL);
> +	else
> +		minor = -ENOSPC;
>  	mutex_unlock(&binderfs_minors_mutex);
> -	if (minor < 0)
> +	if (minor < 0) {
> +		--info->device_count;

Isn't this decrement supposed to happen under binderfs_minors_mutex?

>  		return minor;
> +	}


regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ