# Re: \[PATCH 0/5\] Add \_\_alloc\_size() for better bounds checking

- From: Christoph Hellwig \<hch@infradead.org\>
- Date: 2021-08-19 09:10:21 
- List: linux-mm
- Page: https://ratatoskr.run/linux-mm/2021/08/1482666
- Thread: https://ratatoskr.run/linux-mm/2021/08/1481144/t.md

```text
On Tue, Aug 17, 2021 at 10:08:36PM -0700, Kees Cook wrote:
> Hi,
> 
> GCC and Clang both use the "alloc_size" attribute to assist with bounds
> checking around the use of allocation functions. Add the attribute,
> adjust the Makefile to silence needless warnings, and add the hints to
> the allocators where possible. These changes have been in use for a
> while now in GrapheneOS.

Can you explain how this attribute helps?  Should we flow it through
other allocating functions?

```
