Use data_size_out as a size hint when copying test output to user space. ENOSPC is returned if the output buffer is too small. Callers which so far did not set data_size_out are not affected.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -374,8 +374,11 @@ union bpf_attr { · 373 unmodified lines | ||
| 374 | 374 | struct { /* anonymous struct used by BPF_PROG_TEST_RUN command */ |
| 375 | 375 | __u32 prog_fd; |
| 376 | 376 | __u32 retval; |
| 377 | − __u32 data_size_in; | |
| 378 | − __u32 data_size_out; | |
| 377 | + __u32 data_size_in; /* input: len of data_in */ | |
| 378 | + __u32 data_size_out; /* input/output: len of data_out | |
| 379 | + * returns ENOSPC if data_out | |
| 380 | + * is too small. | |
| 381 | + */ | |
| 379 | 382 | __aligned_u64 data_in; |
| 380 | 383 | __aligned_u64 data_out; |
| 381 | 384 | __u32 repeat; |