Revert "selftests/bpf: test for changing packet data from global functions"
This reverts commit 85a30a4639
which is
commit 3f23ee5590d9605dbde9a5e1d4b97637a4803329 upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: I451125cd4bcf9152b13bbd536e74fab6e6fdbe9f
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -977,32 +977,4 @@ l1_%=: r0 = *(u8*)(r7 + 0); \
|
||||
: __clobber_all);
|
||||
}
|
||||
|
||||
__noinline
|
||||
long skb_pull_data2(struct __sk_buff *sk, __u32 len)
|
||||
{
|
||||
return bpf_skb_pull_data(sk, len);
|
||||
}
|
||||
|
||||
__noinline
|
||||
long skb_pull_data1(struct __sk_buff *sk, __u32 len)
|
||||
{
|
||||
return skb_pull_data2(sk, len);
|
||||
}
|
||||
|
||||
/* global function calls bpf_skb_pull_data(), which invalidates packet
|
||||
* pointers established before global function call.
|
||||
*/
|
||||
SEC("tc")
|
||||
__failure __msg("invalid mem access")
|
||||
int invalidate_pkt_pointers_from_global_func(struct __sk_buff *sk)
|
||||
{
|
||||
int *p = (void *)(long)sk->data;
|
||||
|
||||
if ((void *)(p + 1) > (void *)(long)sk->data_end)
|
||||
return TCX_DROP;
|
||||
skb_pull_data1(sk, 0);
|
||||
*p = 42; /* this is unsafe */
|
||||
return TCX_PASS;
|
||||
}
|
||||
|
||||
char _license[] SEC("license") = "GPL";
|
||||
|
Reference in New Issue
Block a user