linux_dsm_epyc7002/drivers
Jiong Wang 69e168ebdc nfp: bpf: fix static check error through tightening shift amount adjustment
NFP shift instruction has something special. If shift direction is left
then shift amount of 1 to 31 is specified as 32 minus the amount to shift.

But no need to do this for indirect shift which has shift amount be 0. Even
after we do this subtraction, shift amount 0 will be turned into 32 which
will eventually be encoded the same as 0 because only low 5 bits are
encoded, but shift amount be 32 will fail the FIELD_PREP check done later
on shift mask (0x1f), due to 32 is out of mask range. Such error has been
observed when compiling nfp/bpf/jit.c using gcc 8.3 + O3.

This issue has started when indirect shift support added after which the
incoming shift amount to __emit_shf could be 0, therefore it is at that
time shift amount adjustment inside __emit_shf should have been tightened.

Fixes: 991f5b3651 ("nfp: bpf: support logic indirect shifts (BPF_[L|R]SH | BPF_X)")
Reported-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Reported-by: Pablo Cascón <pablo.cascon@netronome.com
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-05-09 15:54:30 -07:00
..
accessibility
acpi Driver core/kobject patches for 5.2-rc1 2019-05-07 13:01:40 -07:00
amba
android Char/Misc patches for 5.2-rc1 - part 2 2019-05-07 13:39:22 -07:00
ata
atm
auxdisplay
base Driver core/kobject patches for 5.2-rc1 2019-05-07 13:01:40 -07:00
bcma
block Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
bluetooth
bus
cdrom
char Initialize the random driver earler; fix CRNG initialization when we 2019-05-07 21:42:23 -07:00
clk
clocksource Staging / IIO driver patches for 5.2-rc1 2019-05-07 13:31:29 -07:00
connector
counter
cpufreq Printk changes for 5.2 2019-05-07 09:18:12 -07:00
cpuidle
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-05-06 20:15:06 -07:00
dax
dca
devfreq
dio
dma Remove Mysterious Macro Intended to Obscure Weird Behaviours (mmiowb()) 2019-05-06 16:57:52 -07:00
dma-buf
edac Merge branch 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-05-06 19:54:57 -07:00
eisa
extcon Char/Misc patches for 5.2-rc1 - part 2 2019-05-07 13:39:22 -07:00
firewire stream_open related patches for Linux 5.2 2019-05-07 12:15:13 -07:00
firmware Char/Misc patches for 5.2-rc1 - part 2 2019-05-07 13:39:22 -07:00
fmc
fpga
fsi
gnss Char/Misc patches for 5.2-rc1 - part 2 2019-05-07 13:39:22 -07:00
gpio pidfd patches for v5.2-rc1 2019-05-07 12:30:24 -07:00
gpu Merge branch 'work.file' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-05-07 20:34:21 -07:00
hid stream_open related patches for Linux 5.2 2019-05-07 12:15:13 -07:00
hsi
hv
hwmon stream_open related patches for Linux 5.2 2019-05-07 12:15:13 -07:00
hwspinlock
hwtracing Char/Misc patches for 5.2-rc1 - part 2 2019-05-07 13:39:22 -07:00
i2c
i3c * Fix a shift wrap bug in the core 2019-05-07 08:50:40 -07:00
ide for-5.2/block-20190507 2019-05-07 18:14:36 -07:00
idle
iio Staging / IIO driver patches for 5.2-rc1 2019-05-07 13:31:29 -07:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
input *: convert stream-like files from nonseekable_open -> stream_open 2019-05-06 17:46:41 +03:00
interconnect
iommu
ipack
irqchip Driver core/kobject patches for 5.2-rc1 2019-05-07 13:01:40 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
leds LED updates for 5.2-rc1. 2019-05-07 18:02:51 -07:00
lightnvm
macintosh
mailbox
mcb
md for-5.2/block-20190507 2019-05-07 18:14:36 -07:00
media Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
memory
memstick MMC core: 2019-05-07 12:56:19 -07:00
message
mfd LED updates for 5.2-rc1. 2019-05-07 18:02:51 -07:00
misc Char/Misc patches for 5.2-rc1 - part 2 2019-05-07 13:39:22 -07:00
mmc MMC core: 2019-05-07 12:56:19 -07:00
mtd Remove Mysterious Macro Intended to Obscure Weird Behaviours (mmiowb()) 2019-05-06 16:57:52 -07:00
mux
net nfp: bpf: fix static check error through tightening shift amount adjustment 2019-05-09 15:54:30 -07:00
nfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
ntb
nubus
nvdimm for-5.2/block-20190507 2019-05-07 18:14:36 -07:00
nvme for-5.2/block-20190507 2019-05-07 18:14:36 -07:00
nvmem
of Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
opp
oprofile
parisc
parport
pci stream_open related patches for Linux 5.2 2019-05-07 12:15:13 -07:00
pcmcia
perf
phy
pinctrl
platform *: convert stream-like files from nonseekable_open -> stream_open 2019-05-06 17:46:41 +03:00
pnp
power
powercap
pps
ps3
ptp ptp_qoriq: fix NULL access if ptp dt node missing 2019-05-09 09:19:26 -07:00
pwm
rapidio
ras
regulator Merge branch 'regulator-5.2' into regulator-next 2019-05-06 22:52:14 +09:00
remoteproc
reset
rpmsg
rtc *: convert stream-like files from nonseekable_open -> stream_open 2019-05-06 17:46:41 +03:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
sbus
scsi for-5.2/block-20190507 2019-05-07 18:14:36 -07:00
sfi
sh
siox
slimbus
sn
soc
soundwire
spi Staging / IIO driver patches for 5.2-rc1 2019-05-07 13:31:29 -07:00
spmi
ssb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
target Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
tc
tee
thermal
thunderbolt Char/Misc patches for 5.2-rc1 - part 2 2019-05-07 13:39:22 -07:00
tty Staging / IIO driver patches for 5.2-rc1 2019-05-07 13:31:29 -07:00
uio
usb stream_open related patches for Linux 5.2 2019-05-07 12:15:13 -07:00
uwb
vfio
vhost
video
virt
virtio
visorbus
vlynq
vme
w1 Char/Misc patches for 5.2-rc1 - part 2 2019-05-07 13:39:22 -07:00
watchdog stream_open related patches for Linux 5.2 2019-05-07 12:15:13 -07:00
xen Merge branch 'stable/for-linus-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb 2019-05-07 18:45:27 -07:00
zorro
Kconfig
Makefile