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-next>] [day] [month] [year] [list]
Date:   Sat, 1 Jul 2017 11:01:29 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Elena Reshetova <elena.reshetova@...el.com>,
        linux-kernel@...r.kernel.org
Subject: [PATCH] locking/refcounts: Remove refcount_sub() extern

CONFIG_REFCOUNT_FULL (correctly) did not provide a refcount_sub(), which
should not be part of proper refcount design patterns. This removes the
erroneous extern (and the later non-FULL accidental implementation).

Fixes: 29dee3c03abc ("locking/refcounts: Out-of-line everything")
Signed-off-by: Kees Cook <keescook@...omium.org>
---
This should be applied to locking/core for -next, please.
---
 include/linux/refcount.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/include/linux/refcount.h b/include/linux/refcount.h
index 099c32bd07b2..c31579bcf1fe 100644
--- a/include/linux/refcount.h
+++ b/include/linux/refcount.h
@@ -49,7 +49,6 @@ extern __must_check bool refcount_inc_not_zero(refcount_t *r);
 extern void refcount_inc(refcount_t *r);
 
 extern __must_check bool refcount_sub_and_test(unsigned int i, refcount_t *r);
-extern void refcount_sub(unsigned int i, refcount_t *r);
 
 extern __must_check bool refcount_dec_and_test(refcount_t *r);
 extern void refcount_dec(refcount_t *r);
@@ -81,11 +80,6 @@ static inline __must_check bool refcount_sub_and_test(unsigned int i,
 	return atomic_sub_and_test(i, &r->refs);
 }
 
-static inline void refcount_sub(unsigned int i, refcount_t *r)
-{
-	atomic_sub(i, &r->refs);
-}
-
 static inline __must_check bool refcount_dec_and_test(refcount_t *r)
 {
 	return atomic_dec_and_test(&r->refs);
-- 
2.7.4


-- 
Kees Cook
Pixel Security

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ