Skip to content

fix uninitialised r0 register in the bpf program#383

Draft
tariq1890 wants to merge 1 commit into
NVIDIA:mainfrom
tariq1890:fix-uninitialised-r0
Draft

fix uninitialised r0 register in the bpf program#383
tariq1890 wants to merge 1 commit into
NVIDIA:mainfrom
tariq1890:fix-uninitialised-r0

Conversation

@tariq1890

Copy link
Copy Markdown

No description provided.

Signed-off-by: Tariq Ibrahim <tibrahim@nvidia.com>
@tariq1890
tariq1890 requested a review from henry118 July 17, 2026 19:56
@tariq1890 tariq1890 self-assigned this Jul 17, 2026
var newProgs []*ebpf.Program
if len(oldProgs) == 0 {
oldInsts := asm.Instructions{asm.Return()}
oldInsts := asm.Instructions{asm.Mov.Imm32(asm.R0, 1), asm.Return()}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

iiuc the return here is the no-match fallthrough (default rule).
Given we are doing a whitelist filter here, the default rule should be 0 (deny).

@tariq1890 tariq1890 Jul 17, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I tried it with 0 initially. That led to a container create failed: open /dev/null: Operation not permitted

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that sounds incomplete whitelist. default with 1 essentially means no filter at all

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that makes me wonder if a race condition exists here since it's runc/crun who should have already whitelisted the common devices such as /dev/null. so in theory we shouldn't hit this code branch.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Got it. Right now, I've been testing this on an environment that uses cri-o and crun. Let me restart this cluster with cri-o+ runc instead.

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