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:   Thu, 22 Dec 2022 06:55:01 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Deepak R Varma <drv@...lo.com>
Cc:     "Maciej W. Rozycki" <macro@...am.me.uk>,
        Jiri Slaby <jirislaby@...nel.org>,
        linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
        Saurabh Singh Sengar <ssengar@...rosoft.com>,
        Praveen Kumar <kumarpraveen@...ux.microsoft.com>
Subject: Re: [PATCH] tty: serial: convert atomic_* to refcount_* APIs

On Thu, Dec 22, 2022 at 01:27:40AM +0530, Deepak R Varma wrote:
> The refcount_* APIs are designed to address known issues with the
> atomic_t APIs for reference counting. They protect the reference
> counters from overflow/underflow, use-after-free errors, provide
> improved memory ordering guarantee schemes, are neater and safer.
> Hence, replace the atomic_* APIs by their equivalent refcount_t
> API functions.
> 
> This patch proposal address the following warnings generated by
> the atomic_as_refcounter.cocci coccinelle script
> 	atomic_add_return(-1, ...)
> 
> 
> Signed-off-by: Deepak R Varma <drv@...lo.com>
> ---
> Note: The patch is compile tested using dec_station.defconfig for
>       MIPS architecture.

Do you have this hardware?  If not, please just do
one-variable-at-a-time so that if there are real problems, we can revert
the offending change easier.  And it makes it simpler to review.

But, are you sure this is correct:

> -	irq_guard = atomic_add_return(1, &mux->irq_guard);
> -	if (irq_guard != 1)
> +	refcount_inc(&mux->irq_guard);
> +	if (refcount_read(&mux->irq_guard) != 1)

That is now different logic than before, why?  Are you sure this is ok?

I stopped reviewing here...

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ