Re: [PATCH bpf] bpf: Fix possible out of bound write in narrow load handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/19/21 12:11 AM, Andrey Ignatov wrote:
Fix a verifier bug found by smatch static checker in [0].

When narrow load is handled, one or two new instructions are added to
insn_buf array, but before it was only checked that

	cnt >= ARRAY_SIZE(insn_buf)

And it's safe to add a new instruction to insn_buf[cnt++] only once. The
second try will lead to out of bound write. And this is what can happen
if `shift` is set.

Afaik, the insn_buf[] should always be large enough, could you add something to
the commit message of this fix whether this created an actual issue in practice
where we do oob overrun insn_buf[] (or whether it's 'only' the static checker
report ... from above paragraph I read you saw the former in practice)?

Thanks,
Daniel



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux