linux-stable/drivers/net
Xie He 8754e1379e drivers/net/wan: lapb: Corrected the usage of skb_cow
This patch fixed 2 issues with the usage of skb_cow in LAPB drivers
"lapbether" and "hdlc_x25":

1) After skb_cow fails, kfree_skb should be called to drop a reference
to the skb. But in both drivers, kfree_skb is not called.

2) skb_cow should be called before skb_push so that is can ensure the
safety of skb_push. But in "lapbether", it is incorrectly called after
skb_push.

More details about these 2 issues:

1) The behavior of calling kfree_skb on failure is also the behavior of
netif_rx, which is called by this function with "return netif_rx(skb);".
So this function should follow this behavior, too.

2) In "lapbether", skb_cow is called after skb_push. This results in 2
logical issues:
   a) skb_push is not protected by skb_cow;
   b) An extra headroom of 1 byte is ensured after skb_push. This extra
      headroom has no use in this function. It also has no use in the
      upper-layer function that this function passes the skb to
      (x25_lapb_receive_frame in net/x25/x25_dev.c).
So logically skb_cow should instead be called before skb_push.

Cc: Eric Dumazet <edumazet@google.com>
Cc: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-24 20:17:42 -07:00
..
appletalk treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
arcnet treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
bonding bonding: check return value of register_netdevice() in bond_newlink() 2020-07-23 15:17:04 -07:00
caif treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
can can: peak_canfd: Replace zero-length array with flexible-array 2020-06-15 23:08:31 -05:00
dsa net: dsa: microchip: call phy_remove_link_mode during probe 2020-07-21 15:50:02 -07:00
ethernet cxgb4: add missing release on skb in uld_send() 2020-07-22 20:04:17 -07:00
fddi treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
fjes
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-06-13 16:27:13 -07:00
hippi hippi: Fix a size used in a 'pci_free_consistent()' in an error handling path 2020-07-14 14:11:49 -07:00
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-06-03 16:27:18 -07:00
ieee802154 net: ieee802154: adf7242: Replace HTTP links with HTTPS ones 2020-07-20 08:51:38 +02:00
ipa net: ipa: include declarations in "ipa_gsi.c" 2020-07-07 12:43:18 -07:00
ipvlan
netdevsim netdevsim: fix unbalaced locking in nsim_create() 2020-07-21 16:00:43 -07:00
phy net: dp83640: fix SIOCSHWTSTAMP to update the struct with actual configuration 2020-07-16 13:27:40 -07:00
plip treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
ppp treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
slip treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
team treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
usb ax88172a: fix ax88172a_unbind() failures 2020-07-15 18:26:29 -07:00
vmxnet3 vmxnet3: allow rx flow hash ops only when rss is enabled 2020-06-02 15:12:33 -07:00
wan drivers/net/wan: lapb: Corrected the usage of skb_cow 2020-07-24 20:17:42 -07:00
wimax
wireguard wireguard: queueing: make use of ip_tunnel_parse_protocol 2020-06-30 12:29:39 -07:00
wireless wireless-drivers fixes for v5.8 2020-07-24 17:26:09 -07:00
xen-netback
bareudp.c bareudp: Fixed multiproto mode configuration 2020-06-18 20:31:11 -07:00
dummy.c
eql.c
geneve.c geneve: fix an uninitialized value in geneve_changelink() 2020-07-23 15:19:58 -07:00
gtp.c
ifb.c
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
LICENSE.SRC
loopback.c
macsec.c net: get rid of lockdep_set_class_and_subclass() 2020-06-28 21:37:23 -07:00
macvlan.c net: get rid of lockdep_set_class_and_subclass() 2020-06-28 21:37:23 -07:00
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c net_failover: fixed rollback in net_failover_open() 2020-06-02 15:35:53 -07:00
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: implement header_ops->parse_protocol for AF_PACKET 2020-06-30 12:29:39 -07:00
veth.c xdp: Rename convert_to_xdp_frame in xdp_convert_buff_to_frame 2020-06-01 15:02:53 -07:00
virtio_net.c xdp: Rename convert_to_xdp_frame in xdp_convert_buff_to_frame 2020-06-01 15:02:53 -07:00
vrf.c
vsockmon.c
vxlan.c vxlan: fix last fdb index during dump of fdb with nhid 2020-06-25 16:12:34 -07:00
xen-netfront.c xen-netfront: fix potential deadlock in xennet_remove() 2020-07-24 17:02:01 -07:00