Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable new line removal #1808

Merged
merged 1 commit into from
Aug 21, 2024
Merged

Conversation

erthalion
Copy link
Contributor

@erthalion erthalion commented Aug 21, 2024

Description

Since 52f9b30f2e falco has changed the way how verifier errors (or general libpman output) is processed, making it via a single buffer. This means that removing new lines from the log message mangles the verifier log, squashing all the lines like:

[WARNING 2024/08/21 09:34:47] (Logging.cpp:120) libbpf: prog 'capset_x': -- BEGIN PROG LOAD LOG --reg type unsupported for arg#0 function capset_x#9850: R1=ctx(off=0,imm=    0) R10=fp0; int BPF_PROG(capset_x,0: (bf) r7 = r1                       ; R1=ctx(off=0,imm=0) R7_w=ctx(off=0,imm=0); int BPF_PROG(capset_x,1: (79) r9 = *(u64 *)(r7 +8)              ; R7_w=ctx(off=0,imm=0) R9_w=scalar(); uint32_t cpu_id = (uint32_t)bpf_get_smp_processor_id();2: (85) call bpf_get_smp_processor_id#8       ; R0_w=scalar(umax=1,va    r_off=(0x0; 0x1)); uint32_t cpu_id = (uint32_t)bpf_get_smp_processor_id();3: (63) *(u32 *)(r10 -8) = r0         ; R0_w=scalar(umax=1,var_off=(0x0; 0x1)) R10=fp0 fp-8=4: (    bf) r2 = r10                      ; R2_w=fp0 R10=fp0; 5: (07) r2 += -8                      ; R2_w=fp-8; return (struct ringbuf_map *)bpf_map_lookup_elem(&ringbuf_maps, &    cpu_id);6: (18) r1 = 0xffff88814b90ce00       ; R1_w=map_ptr(off=0,ks=4,vs=4,imm=0)8: (85) call bpf_map_lookup_elem#1    ; R0=map_value_or_null(id=1,off=0,ks=4,vs=4,imm=0    )9: (bf) r6 = r0                       ; R0=map_value_or_null(id=1,off=0,ks=4,vs=4,imm=0) R6_w=map_value_or_null(id=1,off=0,ks=4,vs=4,imm=0); if(!rb)10: (55) if r6 != 0x0

Having extra empty lines is not so bad, so remove this logic.

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

Log output is not tested and doesn't have to be tested, so CI is sufficient.

Testing Performed

Manual triggering a verifier error and inspecting the output.

Since 52f9b30f2e falco has changed the way how verifier errors (or
general libpman output) is processed, making it via a single buffer.
This means that removing new lines from the log message mangles the
verifier log, squashing all the lines like. Having extra empty lines is
not so bad, so remove this logic.
@erthalion erthalion marked this pull request as ready for review August 21, 2024 14:03
@erthalion erthalion requested a review from a team as a code owner August 21, 2024 14:03
Copy link
Collaborator

@Molter73 Molter73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this one, it was driving me insane!

We might consider a patch upstream so that the newlines are not added when using the callback method.

@erthalion erthalion merged commit 70b81d2 into master Aug 21, 2024
74 of 93 checks passed
@erthalion erthalion deleted the feature/disable-new-line-cleanup branch August 21, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants