linux/drivers/net/ethernet
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
..
3com 3c515: fix integer overflow warning 2019-03-19 15:07:49 -07:00
8390 mac8390: Fix mmio access size probe 2019-03-18 16:56:57 -07:00
adaptec
aeroflex Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
agere
alacritech drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
allwinner net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
alteon
altera net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
amazon Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
amd amd-xgbe: Mark expected switch fall-throughs 2019-04-26 11:28:47 -04:00
apm
apple
aquantia net: aquantia: fix undefined devm_hwmon_device_register_with_info reference 2019-05-09 09:48:44 -07:00
arc net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
atheros Remove Mysterious Macro Intended to Obscure Weird Behaviours (mmiowb()) 2019-05-06 16:57:52 -07:00
aurora net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
broadcom Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
brocade
cadence Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-05-07 17:22:09 -07:00
calxeda
cavium Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
chelsio Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-05-07 17:22:09 -07:00
cirrus
cisco net: move skb->xmit_more hint to softnet data 2019-04-01 18:35:02 -07:00
cortina net: gemini: remove unnecessary assert 2019-04-18 17:06:15 -07:00
davicom net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
dec
dlink
emulex net: move skb->xmit_more hint to softnet data 2019-04-01 18:35:02 -07:00
ezchip net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
faraday drivers: net: Remove unnecessary semicolon 2019-03-01 23:13:49 -08:00
freescale Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-05-07 17:22:09 -07:00
fujitsu net: fujitsu: fix a potential NULL pointer dereference 2019-03-12 14:48:35 -07:00
hisilicon net: hns3: remove redundant assignment of l2_hdr to itself 2019-05-08 09:44:37 -07:00
hp
huawei net: move skb->xmit_more hint to softnet data 2019-04-01 18:35:02 -07:00
i825xx parisc: Tune LASI LAN for QEMU 2019-05-03 23:47:38 +02:00
ibm ibmvnic: Add device identification to requested IRQs 2019-04-27 20:20:06 -04:00
intel Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
marvell Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
mediatek net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
mellanox Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
micrel net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
microchip enc28j60: Convert to use SPDX identifier 2019-03-19 14:59:32 -07:00
moxa
mscc ocelot: Clean up stats update deferred work 2019-04-16 21:43:53 -07:00
myricom drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
natsemi
neterion Remove Mysterious Macro Intended to Obscure Weird Behaviours (mmiowb()) 2019-05-06 16:57:52 -07:00
netronome nfp: bpf: fix static check error through tightening shift amount adjustment 2019-05-09 15:54:30 -07:00
ni
nuvoton
nvidia
nxp net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
oki-semi pci-v5.1-changes 2019-03-09 14:57:08 -08:00
packetengines
pasemi net: pasemi: remove set but not used variable 'cpyhdr' 2019-04-04 17:36:23 -07:00
qlogic Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
qualcomm net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
rdc net: move skb->xmit_more hint to softnet data 2019-04-01 18:35:02 -07:00
realtek r8169: add rtl8168g_set_pause_thresholds 2019-05-05 21:58:36 -07:00
renesas Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
rocker ipv4: Flag fib_info with a fib_nh using IPv6 gateway 2019-04-08 15:22:41 -07:00
samsung net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
seeq
sfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
sgi
silan net/ethernet/silan/sc92031: Remove stale comment about mmiowb() 2019-04-08 12:09:18 +01:00
sis net: sis900: fix indentation issues, remove some spaces 2019-03-15 11:59:00 -07:00
smsc
socionext net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
stmicro dwmac4_prog_mtl_tx_algorithms() missing write operation 2019-05-09 09:20:32 -07:00
sun net: remove 'fallback' argument from dev->ndo_select_queue() 2019-03-20 11:18:55 -07:00
synopsys net: move skb->xmit_more hint to softnet data 2019-04-01 18:35:02 -07:00
tehuti
ti net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
toshiba
tundra
via drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
wiznet Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
xilinx net: ll_temac: Improve error message on error IRQ 2019-05-07 12:24:45 -07:00
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
fealnx.c
jme.c
jme.h
Kconfig
korina.c
lantiq_etop.c
lantiq_xrx200.c net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
Makefile
netx-eth.c