Skip to content

Commit

Permalink
update(bpf): update fsconfig bpf probe reads for user/kernel
Browse files Browse the repository at this point in the history
Signed-off-by: Hendrik Brueckner <[email protected]>
  • Loading branch information
hbrueckner committed Dec 21, 2022
1 parent 2ce73fb commit b470f9b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions driver/bpf/fillers.h
Original file line number Diff line number Diff line change
Expand Up @@ -3647,7 +3647,7 @@ FILLER(sys_fsconfig_x, true)

/* Parameter 4: key (type: PT_CHARBUF) */
unsigned long key_pointer = bpf_syscall_get_argument(data, 2);
res = bpf_val_to_ring(data, key_pointer);
res = bpf_val_to_ring_mem(data, key_pointer, USER);
CHECK_RES(res);

int aux = bpf_syscall_get_argument(data, 4);
Expand Down Expand Up @@ -3675,11 +3675,11 @@ FILLER(sys_fsconfig_x, true)
/* Since `value` is NULL we send two empty params. */

/* Parameter 5: value_bytebuf (type: PT_BYTEBUF) */
res = bpf_val_to_ring(data, 0);
res = bpf_val_to_ring_mem(data, 0, KERNEL);
CHECK_RES(res);

/* Parameter 6: value_charbuf (type: PT_CHARBUF) */
res = bpf_val_to_ring(data, 0);
res = bpf_val_to_ring_mem(data, 0, KERNEL);
CHECK_RES(res);
break;

Expand All @@ -3691,11 +3691,11 @@ FILLER(sys_fsconfig_x, true)
*/

/* Parameter 5: value_bytebuf (type: PT_BYTEBUF) */
res = bpf_val_to_ring(data, 0);
res = bpf_val_to_ring_mem(data, 0, KERNEL);
CHECK_RES(res);

/* Parameter 6: value_charbuf (type: PT_CHARBUF) */
res = bpf_val_to_ring(data, value_pointer);
res = bpf_val_to_ring_mem(data, value_pointer, USER);
CHECK_RES(res);
break;

Expand All @@ -3705,22 +3705,22 @@ FILLER(sys_fsconfig_x, true)
*/

/* Parameter 5: value_bytebuf (type: PT_BYTEBUF) */
res = __bpf_val_to_ring(data, value_pointer, aux, PT_BYTEBUF, -1, true);
res = __bpf_val_to_ring(data, value_pointer, aux, PT_BYTEBUF, -1, true, USER);
CHECK_RES(res);

/* Parameter 6: value_charbuf (type: PT_CHARBUF) */
res = bpf_val_to_ring(data, 0);
res = bpf_val_to_ring_mem(data, 0, KERNEL);
CHECK_RES(res);

break;

default:
/* Parameter 5: value_bytebuf (type: PT_BYTEBUF) */
res = bpf_val_to_ring(data, 0);
res = bpf_val_to_ring_mem(data, 0, KERNEL);
CHECK_RES(res);

/* Parameter 6: value_charbuf (type: PT_CHARBUF) */
res = bpf_val_to_ring(data, 0);
res = bpf_val_to_ring_mem(data, 0, KERNEL);
CHECK_RES(res);
break;
}
Expand Down

0 comments on commit b470f9b

Please sign in to comment.