Open kees opened 1 year ago
GCC has an attribute to help give information to __builtin_dynamic_object_size() in the form of the access() function attribute that describes a pointer and length: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
__builtin_dynamic_object_size()
access()
This could turn this:
int do_something(struct context *ctx, u32 *data, int count)
into this:
int __access(read_write, 2, 3) do_something(struct context *ctx, u32 *data, int count)
https://lore.kernel.org/lkml/202209212034.16D9025882@keescook
GCC has an attribute to help give information to
__builtin_dynamic_object_size()
in the form of theaccess()
function attribute that describes a pointer and length: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.htmlThis could turn this:
into this:
https://lore.kernel.org/lkml/202209212034.16D9025882@keescook