mirror of
https://github.com/Qortal/Brooklyn.git
synced 2025-02-07 14:54:17 +00:00
Changes included (and more): 1. Dynamic RAM merge 2. Real-time page scan and allocation 3. Cache compression 4. Real-time IRQ checks 5. Dynamic I/O allocation for Java heap 6. Java page migration 7. Contiguous memory allocation 8. Idle pages tracking 9. Per CPU RAM usage tracking 10. ARM NEON scalar multiplication library 11. NEON/ARMv8 crypto extensions 12. NEON SHA, Blake, RIPEMD crypto extensions 13. Parallel NEON crypto engine for multi-algo based CPU stress reduction
38 lines
787 B
C
38 lines
787 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <linux/ptrace.h>
|
|
#include <linux/bpf.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <bpf/bpf_helpers.h>
|
|
#include <bpf/bpf_tracing.h>
|
|
#include "bpf_misc.h"
|
|
|
|
static struct sockaddr_in old;
|
|
|
|
SEC("kprobe/" SYS_PREFIX "sys_connect")
|
|
int BPF_KPROBE(handle_sys_connect)
|
|
{
|
|
#if SYSCALL_WRAPPER == 1
|
|
struct pt_regs *real_regs;
|
|
#endif
|
|
struct sockaddr_in new;
|
|
void *ptr;
|
|
|
|
#if SYSCALL_WRAPPER == 0
|
|
ptr = (void *)PT_REGS_PARM2(ctx);
|
|
#else
|
|
real_regs = (struct pt_regs *)PT_REGS_PARM1(ctx);
|
|
bpf_probe_read_kernel(&ptr, sizeof(ptr), &PT_REGS_PARM2(real_regs));
|
|
#endif
|
|
|
|
bpf_probe_read_user(&old, sizeof(old), ptr);
|
|
__builtin_memset(&new, 0xab, sizeof(new));
|
|
bpf_probe_write_user(ptr, &new, sizeof(new));
|
|
|
|
return 0;
|
|
}
|
|
|
|
char _license[] SEC("license") = "GPL";
|