diff options
| author | Thomas Zimmermann <[email protected]> | 2023-10-11 09:50:59 +0200 | 
|---|---|---|
| committer | Thomas Zimmermann <[email protected]> | 2023-10-11 09:50:59 +0200 | 
| commit | 57390019b68b83f96eb98f490367b9df1f2d77cb (patch) | |
| tree | e6d4b6c75efdd2d7fb7d37f980688c491be3ff6a /tools/testing/selftests/bpf/progs/nested_trust_failure.c | |
| parent | e5f9d543419c78ac58f3b3557bc5a76b20ff600b (diff) | |
| parent | 389af786f92ecdff35883551d54bf4e507ffcccb (diff) | |
Merge drm/drm-next into drm-misc-next
Updating drm-misc-next to the state of Linux v6.6-rc2.
Signed-off-by: Thomas Zimmermann <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/nested_trust_failure.c')
| -rw-r--r-- | tools/testing/selftests/bpf/progs/nested_trust_failure.c | 16 | 
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/nested_trust_failure.c b/tools/testing/selftests/bpf/progs/nested_trust_failure.c index 0d1aa6bbace4..ea39497f11ed 100644 --- a/tools/testing/selftests/bpf/progs/nested_trust_failure.c +++ b/tools/testing/selftests/bpf/progs/nested_trust_failure.c @@ -10,6 +10,13 @@  char _license[] SEC("license") = "GPL"; +struct { +	__uint(type, BPF_MAP_TYPE_SK_STORAGE); +	__uint(map_flags, BPF_F_NO_PREALLOC); +	__type(key, int); +	__type(value, u64); +} sk_storage_map SEC(".maps"); +  /* Prototype for all of the program trace events below:   *   * TRACE_EVENT(task_newtask, @@ -31,3 +38,12 @@ int BPF_PROG(test_invalid_nested_offset, struct task_struct *task, u64 clone_fla  	bpf_cpumask_first_zero(&task->cpus_mask);  	return 0;  } + +/* Although R2 is of type sk_buff but sock_common is expected, we will hit untrusted ptr first. */ +SEC("tp_btf/tcp_probe") +__failure __msg("R2 type=untrusted_ptr_ expected=ptr_, trusted_ptr_, rcu_ptr_") +int BPF_PROG(test_invalid_skb_field, struct sock *sk, struct sk_buff *skb) +{ +	bpf_sk_storage_get(&sk_storage_map, skb->next, 0, 0); +	return 0; +}  |