Skip to content

Commit 00247cb

Browse files
committed
refcount: Remove unused __signed_wrap function annotations
With CONFIG_UBSAN_INTEGER_WRAP being replaced by Overflow Behavior Types, remove the __signed_wrap function annotation as it is already unused, and any future work here will use OBT annotations instead. Link: https://patch.msgid.link/20260331163725.2765789-1-kees@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
1 parent a96ef58 commit 00247cb

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

include/linux/compiler_types.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -432,18 +432,11 @@ struct ftrace_likely_data {
432432
#define at_least
433433
#endif
434434

435-
/* Do not trap wrapping arithmetic within an annotated function. */
436-
#ifdef CONFIG_UBSAN_INTEGER_WRAP
437-
# define __signed_wrap __attribute__((no_sanitize("signed-integer-overflow")))
438-
#else
439-
# define __signed_wrap
440-
#endif
441-
442435
/* Section for code which can't be instrumented at all */
443436
#define __noinstr_section(section) \
444437
noinline notrace __attribute((__section__(section))) \
445438
__no_kcsan __no_sanitize_address __no_profile __no_sanitize_coverage \
446-
__no_sanitize_memory __signed_wrap
439+
__no_sanitize_memory
447440

448441
#define noinstr __noinstr_section(".noinstr.text")
449442

include/linux/refcount.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static inline unsigned int refcount_read(const refcount_t *r)
170170
return atomic_read(&r->refs);
171171
}
172172

173-
static inline __must_check __signed_wrap
173+
static inline __must_check
174174
bool __refcount_add_not_zero(int i, refcount_t *r, int *oldp)
175175
{
176176
int old = refcount_read(r);
@@ -212,7 +212,7 @@ static inline __must_check bool refcount_add_not_zero(int i, refcount_t *r)
212212
return __refcount_add_not_zero(i, r, NULL);
213213
}
214214

215-
static inline __must_check __signed_wrap
215+
static inline __must_check
216216
bool __refcount_add_not_zero_limited_acquire(int i, refcount_t *r, int *oldp,
217217
int limit)
218218
{
@@ -244,7 +244,7 @@ __refcount_inc_not_zero_limited_acquire(refcount_t *r, int *oldp, int limit)
244244
return __refcount_add_not_zero_limited_acquire(1, r, oldp, limit);
245245
}
246246

247-
static inline __must_check __signed_wrap
247+
static inline __must_check
248248
bool __refcount_add_not_zero_acquire(int i, refcount_t *r, int *oldp)
249249
{
250250
return __refcount_add_not_zero_limited_acquire(i, r, oldp, INT_MAX);
@@ -277,7 +277,7 @@ static inline __must_check bool refcount_add_not_zero_acquire(int i, refcount_t
277277
return __refcount_add_not_zero_acquire(i, r, NULL);
278278
}
279279

280-
static inline __signed_wrap
280+
static inline
281281
void __refcount_add(int i, refcount_t *r, int *oldp)
282282
{
283283
int old = atomic_fetch_add_relaxed(i, &r->refs);
@@ -383,7 +383,7 @@ static inline void refcount_inc(refcount_t *r)
383383
__refcount_inc(r, NULL);
384384
}
385385

386-
static inline __must_check __signed_wrap
386+
static inline __must_check
387387
bool __refcount_sub_and_test(int i, refcount_t *r, int *oldp)
388388
{
389389
int old = atomic_fetch_sub_release(i, &r->refs);

0 commit comments

Comments
 (0)