Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpf: fix possible file descriptor leaks in verifier
The resolve_pseudo_ldimm64() function might have leaked file descriptors when BPF_MAP_TYPE_ARENA was used in a program (some error paths missed a corresponding fdput). Fix leaks and also extract code which adds maps to env->used_maps into a separate function. This simplifies code of resolve_pseudo_ldimm64 and makes it possible to reuse this code later. While at it, also add a verifier verbose message when the maps usage limit is reached. Fixes: 6082b6c ("bpf: Recognize addr_space_cast instruction in the verifier.") Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
- Loading branch information
Showing
1 changed file
with
79 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters