Skip to content

Commit

Permalink
ebpf: fix big endian issue for s390x
Browse files Browse the repository at this point in the history
Load the full 32 bits word and take the lower 16 bits, instead of
reading just 16 bits.

Same fix as containers/crun@07bae05

Signed-off-by: Alice Frosi <[email protected]>
  • Loading branch information
Alice Frosi committed May 4, 2020
1 parent 9f6a2d4 commit fdc170c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libcontainer/cgroups/ebpf/devicefilter/devicefilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ func (p *program) init() {
*/
// R2 <- type (lower 16 bit of u32 access_type at R1[0])
p.insts = append(p.insts,
asm.LoadMem(asm.R2, asm.R1, 0, asm.Half))
asm.LoadMem(asm.R2, asm.R1, 0, asm.Word),
asm.And.Imm32(asm.R2, 0xFFFF))

// R3 <- access (upper 16 bit of u32 access_type at R1[0])
p.insts = append(p.insts,
Expand Down

0 comments on commit fdc170c

Please sign in to comment.