diff options
author | Hou Tao <[email protected]> | 2023-11-11 12:38:21 +0800 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2023-11-26 18:00:26 -0800 |
commit | 75a442581d05edaee168222ffbe00d4389785636 (patch) | |
tree | 6e7f8564ef1db21b3c0ab3e335142df1d53a6065 /net/unix/unix_bpf.c | |
parent | c0c6bde586c7dce82719b4ff32a2db6af9ee3d65 (diff) |
bpf: Add missed allocation hint for bpf_mem_cache_alloc_flags()
bpf_mem_cache_alloc_flags() may call __alloc() directly when there is no
free object in free list, but it doesn't initialize the allocation hint
for the returned pointer. It may lead to bad memory dereference when
freeing the pointer, so fix it by initializing the allocation hint.
Fixes: 822fb26bdb55 ("bpf: Add a hint to allocated objects.")
Signed-off-by: Hou Tao <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'net/unix/unix_bpf.c')
0 files changed, 0 insertions, 0 deletions