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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 12 Feb 2021 08:39:24 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     min.li.xe@...esas.com
Cc:     derek.kiernan@...inx.com, dragan.cvetic@...inx.com, arnd@...db.de,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v2] misc: Add Renesas Synchronization Management
 Unit (SMU) support

On Thu, Feb 11, 2021 at 08:16:15PM -0500, min.li.xe@...esas.com wrote:
> +static int
> +rsmu_open(struct inode *iptr, struct file *fptr)
> +{
> +	struct rsmu_cdev *rsmu;
> +
> +	rsmu = container_of(iptr->i_cdev, struct rsmu_cdev, rsmu_cdev);
> +	if (!rsmu)
> +		return -EAGAIN;
> +
> +	/* Only one open per device at a time */
> +	if (!atomic_dec_and_test(&rsmu->open_count)) {
> +		atomic_inc(&rsmu->open_count);
> +		return -EBUSY;

This does not do what you think it does, and does not prevent multiple
applications from talking to your device at the same time.

There is no need for this at all, as it does not work, sorry.  If
multiple apps talk to your device, it's their fault, not the kernel's
fault, that things go wrong.

And I thought that Arnd already told you to fix this?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ