Skip to content

Commit 96bf431

Browse files
committed
more lint!
1 parent a332ea3 commit 96bf431

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

internal/pkg/daemon/enricher/auditsource/bpf/enricher.bpf.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#include <vmlinux.h>
2-
#include <linux/limits.h>
31
#include <bpf/bpf_core_read.h>
42
#include <bpf/bpf_helpers.h>
53
#include <bpf/bpf_tracing.h>
4+
#include <linux/limits.h>
5+
#include <vmlinux.h>
66

77
char LICENSE[] SEC("license") = "Dual BSD/GPL";
88

@@ -13,8 +13,8 @@ char LICENSE[] SEC("license") = "Dual BSD/GPL";
1313
#define MAX_NAMESPACES 8096
1414

1515
struct {
16-
__uint(type, BPF_MAP_TYPE_RINGBUF);
17-
__uint(max_entries, 256 * 1024 /* 256 KB */);
16+
__uint(type, BPF_MAP_TYPE_RINGBUF);
17+
__uint(max_entries, 256 * 1024 /* 256 KB */);
1818
} audit_log SEC(".maps");
1919

2020
static __always_inline u32 get_mntns()
@@ -23,20 +23,23 @@ static __always_inline u32 get_mntns()
2323
return BPF_CORE_READ(task, nsproxy, mnt_ns, ns.inum);
2424
}
2525

26-
static __always_inline long read_kernel_str(char * stack_ptr, u32 size, const char * kernel_ptr) {
26+
static __always_inline long read_kernel_str(char * stack_ptr, u32 size,
27+
const char * kernel_ptr)
28+
{
2729
long len = 0;
28-
if(kernel_ptr) {
30+
if (kernel_ptr) {
2931
len = bpf_probe_read_kernel_str(stack_ptr, size, kernel_ptr);
3032
}
31-
if(len < 1) {
33+
if (len < 1) {
3234
stack_ptr[0] = 0;
3335
len = 1;
3436
}
3537
return len;
3638
}
3739

3840
SEC("kprobe/aa_audit")
39-
int BPF_KPROBE(kprobe__aa_audit, int type, struct aa_profile * profile, struct apparmor_audit_data *ad)
41+
int BPF_KPROBE(kprobe__aa_audit, int type, struct aa_profile * profile,
42+
struct apparmor_audit_data * ad)
4043
{
4144
const int error = BPF_CORE_READ(ad, error);
4245
if (likely(!error)) {
@@ -52,7 +55,7 @@ int BPF_KPROBE(kprobe__aa_audit, int type, struct aa_profile * profile, struct a
5255
u8 complain = (BPF_CORE_READ(profile, mode) == APPARMOR_COMPLAIN);
5356
const char * name_ptr = BPF_CORE_READ(ad, name);
5457
const char * op_ptr = BPF_CORE_READ(ad, op);
55-
struct task_struct *task = (void *)bpf_get_current_task();
58+
struct task_struct * task = (void *)bpf_get_current_task();
5659
const char * comm_ptr = BPF_CORE_READ(task, comm);
5760

5861
char op[16];

0 commit comments

Comments
 (0)