]> git.ipfire.org Git - thirdparty/gcc.git/commit
btf: Protect BTF_KIND_INFO against invalid kind
authorWill Hawkins <hawkinsw@obs.cr>
Mon, 29 Jul 2024 14:42:48 +0000 (10:42 -0400)
committerDavid Faust <david.faust@oracle.com>
Fri, 9 Aug 2024 15:55:23 +0000 (08:55 -0700)
commitd0bc1cbf6a8938220f42d8102031fd6f6644e171
treed410fde5c6894a13c09dd609d39562bb98533948
parent786ebbd6058540b2110da16a693f0c582c11413c
btf: Protect BTF_KIND_INFO against invalid kind

If the user provides a kind value that is more than 5 bits, the
BTF_KIND_INFO macro would emit incorrect values for info (by clobbering
values of the kind flag).

Tested on x86_64-redhat-linux.

include/ChangeLog:

* btf.h (BTF_TYPE_INFO): Protect against user providing invalid
kind.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
include/btf.h