mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
bpf, seccomp: prepare for upcoming criu support
The current ongoing effort to dump existing cBPF seccomp filters back to user space requires to hold the pre-transformed instructions like we do in case of socket filters from sk_attach_filter() side, so they can be reloaded in original form at a later point in time by utilities such as criu. To prepare for this, simply extend the bpf_prog_create_from_user() API to hold a flag that tells whether we should store the original or not. Also, fanout filters could make use of that in future for things like diag. While fanout filters already use bpf_prog_destroy(), move seccomp over to them as well to handle original programs when present. Signed-off-by: Daniel Borkmann <[email protected]> Cc: Tycho Andersen <[email protected]> Cc: Pavel Emelyanov <[email protected]> Cc: Kees Cook <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Alexei Starovoitov <[email protected]> Tested-by: Tycho Andersen <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
0a15afd2ea
commit
bab1899187
4 changed files with 15 additions and 9 deletions
|
|
@ -1567,7 +1567,7 @@ static int fanout_set_data_cbpf(struct packet_sock *po, char __user *data,
|
|||
if (copy_from_user(&fprog, data, len))
|
||||
return -EFAULT;
|
||||
|
||||
ret = bpf_prog_create_from_user(&new, &fprog, NULL);
|
||||
ret = bpf_prog_create_from_user(&new, &fprog, NULL, false);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue