aboutsummaryrefslogtreecommitdiffstats
path: root/samples/bpf/task_fd_query_user.c
diff options
context:
space:
mode:
authorToke Høiland-Jørgensen <[email protected]>2020-10-26 23:36:23 +0000
committerDaniel Borkmann <[email protected]>2020-10-27 21:46:17 +0000
commitc66dca98a24cb5f3493dd08d40bcfa94a220fa92 (patch)
tree2a3cdc8a19c1861cfceb41575634337fa10c3f69 /samples/bpf/task_fd_query_user.c
parentbpf: Fix -Wshadow warnings (diff)
downloadkernel-c66dca98a24cb5f3493dd08d40bcfa94a220fa92.tar.gz
kernel-c66dca98a24cb5f3493dd08d40bcfa94a220fa92.zip
samples/bpf: Set rlimit for memlock to infinity in all samples
The memlock rlimit is a notorious source of failure for BPF programs. Most of the samples just set it to infinity, but a few used a lower limit. The problem with unconditionally setting a lower limit is that this will also override the limit if the system-wide setting is *higher* than the limit being set, which can lead to failures on systems that lock a lot of memory, but set 'ulimit -l' to unlimited before running a sample. One fix for this is to only conditionally set the limit if the current limit is lower, but it is simpler to just unify all the samples and have them all set the limit to infinity. Signed-off-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Acked-by: Jesper Dangaard Brouer <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'samples/bpf/task_fd_query_user.c')
-rw-r--r--samples/bpf/task_fd_query_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/bpf/task_fd_query_user.c b/samples/bpf/task_fd_query_user.c
index 4a74531dc403..b68bd2f8fdc9 100644
--- a/samples/bpf/task_fd_query_user.c
+++ b/samples/bpf/task_fd_query_user.c
@@ -290,7 +290,7 @@ static int test_debug_fs_uprobe(char *binary_path, long offset, bool is_return)
int main(int argc, char **argv)
{
- struct rlimit r = {1024*1024, RLIM_INFINITY};
+ struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
extern char __executable_start;
char filename[256], buf[256];
__u64 uprobe_file_offset;