diff options
author | Wang YanQing <udknight@gmail.com> | 2019-04-27 16:28:26 +0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-05-01 23:32:16 +0200 |
commit | 711aef1bbf88212a21f7103e88f397b47a528805 (patch) | |
tree | 50251af800517ab34fff64993a758ba2d2cf3190 /Documentation/fmc/identifiers.txt | |
parent | 886b7a50100a50f1cbd08a6f8ec5884dfbe082dc (diff) | |
download | talos-op-linux-711aef1bbf88212a21f7103e88f397b47a528805.tar.gz talos-op-linux-711aef1bbf88212a21f7103e88f397b47a528805.zip |
bpf, x32: Fix bug for BPF_JMP | {BPF_JSGT, BPF_JSLE, BPF_JSLT, BPF_JSGE}
The current method to compare 64-bit numbers for conditional jump is:
1) Compare the high 32-bit first.
2) If the high 32-bit isn't the same, then goto step 4.
3) Compare the low 32-bit.
4) Check the desired condition.
This method is right for unsigned comparison, but it is buggy for signed
comparison, because it does signed comparison for low 32-bit too.
There is only one sign bit in 64-bit number, that is the MSB in the 64-bit
number, it is wrong to treat low 32-bit as signed number and do the signed
comparison for it.
This patch fixes the bug and adds a testcase in selftests/bpf for such bug.
Signed-off-by: Wang YanQing <udknight@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'Documentation/fmc/identifiers.txt')
0 files changed, 0 insertions, 0 deletions