systm: Relax __result_use_check annotations

When compiling with gcc, functions annotated this way can not have their
return values cast away, e.g., with `(void)copyout(...)`.  clang permits
it but gcc does not.  Since we have a number of such casts for calls
which copy data out of the kernel, and since failing to check for errors
when copying *in* is a much more severe bug, remove some of the
annotations in order to make the gcc build happy.

Reviewed by:	kib
Reported by:	Jenkins
Fixes:	8e36732e6e ("systm: Annotate copyin() and related functions with __result_use_check")
Differential Revision:	https://reviews.freebsd.org/D43418
This commit is contained in:
Mark Johnston 2024-01-12 10:07:28 -05:00
parent 848a8bf3f4
commit d07acc58d8

View file

@ -289,9 +289,9 @@ int __result_use_check copyin(const void * __restrict udaddr,
void * _Nonnull __restrict kaddr, size_t len);
int __result_use_check copyin_nofault(const void * __restrict udaddr,
void * _Nonnull __restrict kaddr, size_t len);
int __result_use_check copyout(const void * _Nonnull __restrict kaddr,
int copyout(const void * _Nonnull __restrict kaddr,
void * __restrict udaddr, size_t len);
int __result_use_check copyout_nofault(const void * _Nonnull __restrict kaddr,
int copyout_nofault(const void * _Nonnull __restrict kaddr,
void * __restrict udaddr, size_t len);
#ifdef SAN_NEEDS_INTERCEPTORS
@ -313,11 +313,11 @@ int64_t fuword64(volatile const void *base);
int __result_use_check fueword(volatile const void *base, long *val);
int __result_use_check fueword32(volatile const void *base, int32_t *val);
int __result_use_check fueword64(volatile const void *base, int64_t *val);
int __result_use_check subyte(volatile void *base, int byte);
int __result_use_check suword(volatile void *base, long word);
int __result_use_check suword16(volatile void *base, int word);
int __result_use_check suword32(volatile void *base, int32_t word);
int __result_use_check suword64(volatile void *base, int64_t word);
int subyte(volatile void *base, int byte);
int suword(volatile void *base, long word);
int suword16(volatile void *base, int word);
int suword32(volatile void *base, int32_t word);
int suword64(volatile void *base, int64_t word);
uint32_t casuword32(volatile uint32_t *base, uint32_t oldval, uint32_t newval);
u_long casuword(volatile u_long *p, u_long oldval, u_long newval);
int casueword32(volatile uint32_t *base, uint32_t oldval, uint32_t *oldvalp,