android_kernel_motorola_sm6375/drivers/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Kees Cook 4030effab8 sky2: Make sure there is at least one frag_addr available
[ Upstream commit 6a70e5cbedaf8ad10528ac9ac114f3ec20f422df ]

In the pathological case of building sky2 with 16k PAGE_SIZE, the
frag_addr[] array would never be used, so the original code was correct
that size should be 0. But the compiler now gets upset with 0 size arrays
in places where it hasn't eliminated the code that might access such an
array (it can't figure out that in this case an rx skb with fragments
would never be created). To keep the compiler happy, make sure there is
at least 1 frag_addr in struct rx_ring_info:

   In file included from include/linux/skbuff.h:28,
                    from include/net/net_namespace.h:43,
                    from include/linux/netdevice.h:38,
                    from drivers/net/ethernet/marvell/sky2.c:18:
   drivers/net/ethernet/marvell/sky2.c: In function 'sky2_rx_unmap_skb':
   include/linux/dma-mapping.h:416:36: warning: array subscript i is outside array bounds of 'dma_addr_t[0]' {aka 'long long unsigned int[]'} [-Warray-bounds=]
     416 | #define dma_unmap_page(d, a, s, r) dma_unmap_page_attrs(d, a, s, r, 0)
         |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/sky2.c:1257:17: note: in expansion of macro 'dma_unmap_page'
    1257 |                 dma_unmap_page(&pdev->dev, re->frag_addr[i],
         |                 ^~~~~~~~~~~~~~
   In file included from drivers/net/ethernet/marvell/sky2.c:41:
   drivers/net/ethernet/marvell/sky2.h:2198:25: note: while referencing 'frag_addr'
    2198 |         dma_addr_t      frag_addr[ETH_JUMBO_MTU >> PAGE_SHIFT];
         |                         ^~~~~~~~~

With CONFIG_PAGE_SIZE_16KB=y, PAGE_SHIFT == 14, so:

  #define ETH_JUMBO_MTU   9000

causes "ETH_JUMBO_MTU >> PAGE_SHIFT" to be 0. Use "?: 1" to solve this build warning.

Cc: Mirko Lindner <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: [email protected]
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Reviewed-by: Alexander Lobakin <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Reviewed-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2023-10-25 11:53:23 +02:00
..
appletalk
arcnet net: arcnet: Do not call kfree_skb() under local_irq_disable() 2023-09-23 10:59:43 +02:00
bonding bonding: fix macvlan over alb bond support 2023-08-30 16:27:24 +02:00
caif
can can: gs_usb: gs_usb_receive_bulk_callback(): count RX overflow errors also in case of OOM 2023-09-23 10:59:41 +02:00
dsa net: dsa: mv88e6xxx: Avoid EEPROM timeout when EEPROM is absent 2023-10-10 21:46:44 +02:00
ethernet sky2: Make sure there is at least one frag_addr available 2023-10-25 11:53:23 +02:00
fddi net: defxx: Fix missing err handling in dfx_init() 2023-01-18 11:41:13 +01:00
fjes
hamradio hamradio: baycom_epp: Fix return type of baycom_send_packet() 2023-01-18 11:41:35 +01:00
hippi
hyperv
ieee802154 ieee802154: ca8210: Fix a potential UAF in ca8210_probe 2023-10-25 11:53:18 +02:00
ipvlan ipvlan: Fix a reference count leak warning in ipvlan_ns_exit() 2023-08-30 16:27:23 +02:00
netdevsim
phy net: phy: broadcom: stub c45 read/write for 54810 2023-08-30 16:27:20 +02:00
plip net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() 2022-12-14 11:30:48 +01:00
ppp ppp: associate skb with a device at tx 2023-01-18 11:41:37 +01:00
slip
team team: fix null-ptr-deref when team device type is changed 2023-10-10 21:46:37 +02:00
usb net: usb: smsc95xx: Fix an error code in smsc95xx_reset() 2023-10-25 11:53:21 +02:00
vmxnet3
wan drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close() 2023-10-10 21:46:43 +02:00
wimax
wireless wifi: mt76: mt76x02: fix MT76x0 external LNA gain handling 2023-10-10 21:46:43 +02:00
xen-netback xen-netback: use default TX queue size for vifs 2023-10-25 11:53:18 +02:00
dummy.c
eql.c
geneve.c
gtp.c gtp: Fix use-after-free in __gtp_encap_destroy(). 2023-07-27 08:37:11 +02:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c net: loopback: use NET_NAME_PREDICTABLE for name_assign_type 2023-01-18 11:40:49 +01:00
macsec.c Revert "net: macsec: preserve ingress frame ordering" 2023-09-23 10:59:40 +02:00
macvlan.c macvlan: enforce a consistent minimal mtu 2022-11-25 17:42:21 +01:00
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c net/net_failover: fix txq exceeding warning 2023-04-05 11:16:44 +02:00
netconsole.c
nlmon.c
ntb_netdev.c ntb_netdev: Use dev_kfree_skb_any() in interrupt context 2023-01-18 11:41:16 +01:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c net: tap_open(): set sk_uid from current_fsuid() 2023-08-11 11:53:59 +02:00
thunderbolt.c net: thunderbolt: Fix TCPv6 GSO checksum calculation 2023-10-10 21:46:41 +02:00
tun.c tun: prevent negative ifindex 2023-10-25 11:53:21 +02:00
veth.c veth: Fixing transmit return status for dropped packets 2023-09-23 10:59:58 +02:00
virtio_net.c virtio-net: set queues after driver_ok 2023-08-30 16:27:19 +02:00
vrf.c
vsockmon.c
vxlan.c vxlan: generalize vxlan_parse_gpe_hdr and remove unused args 2023-09-23 10:59:38 +02:00
xen-netfront.c xen-netfront: Fix NULL sring after live migration 2022-12-14 11:30:45 +01:00