Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v6.14 34 lines 660 B view raw
1// SPDX-License-Identifier: GPL-2.0 2 3#include <linux/bpf.h> 4#include <bpf/bpf_helpers.h> 5#include "bpf_misc.h" 6 7SEC("socket") 8__description("scalars: find linked scalars") 9__failure 10__msg("math between fp pointer and 2147483647 is not allowed") 11__naked void scalars(void) 12{ 13 asm volatile (" \ 14 r0 = 0; \ 15 r1 = 0x80000001 ll; \ 16 r1 /= 1; \ 17 r2 = r1; \ 18 r4 = r1; \ 19 w2 += 0x7FFFFFFF; \ 20 w4 += 0; \ 21 if r2 == 0 goto l1; \ 22 exit; \ 23l1: \ 24 r4 >>= 63; \ 25 r3 = 1; \ 26 r3 -= r4; \ 27 r3 *= 0x7FFFFFFF; \ 28 r3 += r10; \ 29 *(u8*)(r3 - 1) = r0; \ 30 exit; \ 31" ::: __clobber_all); 32} 33 34char _license[] SEC("license") = "GPL";