-
Notifications
You must be signed in to change notification settings - Fork 711
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
map,prog,link: verify object type in LoadPinned*()
Before this patch, LoadPinned{Map,Prog,Link} all succeeded when called on a pin of the wrong type, leading to garbage in the object's info. This patch adds an ObjGetTyped() wrapper around ObjGet() to obtain a file descriptor's bpf object type. Despite the warnings in https://dxuuu.xyz/filecaps.html, this works for unprivileged processes with file caps as well. /proc/self/fd/ contains symlinks whose underlying fds remain accessible by the user, presumably since they're still owned by the process owner. Kernel patches are underway for adding a bpf_type field to ObjGetAttr to provide future proofing in case new bpf objects are added to the kernel. The current checks were designed to make this addition as straightforward as possible. Signed-off-by: Timo Beckers <timo@isovalent.com> Co-authored-by: Mahe Tardy <mahe.tardy@gmail.com>
- Loading branch information
Showing
6 changed files
with
125 additions
and
6 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
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
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
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
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
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