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] [day] [month] [year] [list]
Date:   Fri, 17 Dec 2021 14:38:04 +1100
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     peterz@...radead.org, will@...nel.org, boqun.feng@...il.com,
        linux-kernel@...r.kernel.org, x86@...nel.org, mark.rutland@....com,
        elver@...gle.com, keescook@...omium.org, hch@...radead.org,
        axboe@...nel.dk
Subject: Re: [PATCH v2 8/9] atomic,x86: Alternative atomic_*_overflow() scheme

Linus Torvalds <torvalds@...ux-foundation.org> wrote:
>
> That said - it may not matter - I'm not sure a plain "dec" is even a
> valid operation on a ref in the first place. How could you ever
> validly decrement a ref without checking for it being the last entry?

There are actual spots in the network stack where we know we're
holding multiple reference counts to a given object and in those
cases an unconditional "dec" could make sense.  For example, we may
have an object that we obtained from a hash lookup, giving us a
reference count, which we then try to remove from a linked list,
also containing a referencnce count to it.  While still holding
the referencnce count from the hash lookup, the linked list
referencnce count could be dropped with a plain "dec".

Of course we might be better off redesigning things to eliminate
reference counts completely but such code does still exist.

Cheers,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ