android_kernel_sony_sdm845/drivers/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Taehee Yoo c368df30c8 bonding: fix unexpected IFF_BONDING bit unset
[ Upstream commit 65de65d9033750d2cf1b336c9d6e9da3a8b5cc6e ]

The IFF_BONDING means bonding master or bonding slave device.
->ndo_add_slave() sets IFF_BONDING flag and ->ndo_del_slave() unsets
IFF_BONDING flag.

bond0<--bond1

Both bond0 and bond1 are bonding device and these should keep having
IFF_BONDING flag until they are removed.
But bond1 would lose IFF_BONDING at ->ndo_del_slave() because that routine
do not check whether the slave device is the bonding type or not.
This patch adds the interface type check routine before removing
IFF_BONDING flag.

Test commands:
    ip link add bond0 type bond
    ip link add bond1 type bond
    ip link set bond1 master bond0
    ip link set bond1 nomaster
    ip link del bond1 type bond
    ip link add bond1 type bond

Splat looks like:
[  226.665555] proc_dir_entry 'bonding/bond1' already registered
[  226.666440] WARNING: CPU: 0 PID: 737 at fs/proc/generic.c:361 proc_register+0x2a9/0x3e0
[  226.667571] Modules linked in: bonding af_packet sch_fq_codel ip_tables x_tables unix
[  226.668662] CPU: 0 PID: 737 Comm: ip Not tainted 5.4.0-rc3+ #96
[  226.669508] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
[  226.670652] RIP: 0010:proc_register+0x2a9/0x3e0
[  226.671612] Code: 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 39 01 00 00 48 8b 04 24 48 89 ea 48 c7 c7 a0 0b 14 9f 48 8b b0 e
0 00 00 00 e8 07 e7 88 ff <0f> 0b 48 c7 c7 40 2d a5 9f e8 59 d6 23 01 48 8b 4c 24 10 48 b8 00
[  226.675007] RSP: 0018:ffff888050e17078 EFLAGS: 00010282
[  226.675761] RAX: dffffc0000000008 RBX: ffff88805fdd0f10 RCX: ffffffff9dd344e2
[  226.676757] RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff88806c9f6b8c
[  226.677751] RBP: ffff8880507160f3 R08: ffffed100d940019 R09: ffffed100d940019
[  226.678761] R10: 0000000000000001 R11: ffffed100d940018 R12: ffff888050716008
[  226.679757] R13: ffff8880507160f2 R14: dffffc0000000000 R15: ffffed100a0e2c1e
[  226.680758] FS:  00007fdc217cc0c0(0000) GS:ffff88806c800000(0000) knlGS:0000000000000000
[  226.681886] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  226.682719] CR2: 00007f49313424d0 CR3: 0000000050e46001 CR4: 00000000000606f0
[  226.683727] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  226.684725] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  226.685681] Call Trace:
[  226.687089]  proc_create_seq_private+0xb3/0xf0
[  226.687778]  bond_create_proc_entry+0x1b3/0x3f0 [bonding]
[  226.691458]  bond_netdev_event+0x433/0x970 [bonding]
[  226.692139]  ? __module_text_address+0x13/0x140
[  226.692779]  notifier_call_chain+0x90/0x160
[  226.693401]  register_netdevice+0x9b3/0xd80
[  226.694010]  ? alloc_netdev_mqs+0x854/0xc10
[  226.694629]  ? netdev_change_features+0xa0/0xa0
[  226.695278]  ? rtnl_create_link+0x2ed/0xad0
[  226.695849]  bond_newlink+0x2a/0x60 [bonding]
[  226.696422]  __rtnl_newlink+0xb9f/0x11b0
[  226.696968]  ? rtnl_link_unregister+0x220/0x220
[ ... ]

Fixes: 0b680e7537 ("[PATCH] bonding: Add priv_flag to avoid event mishandling")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-11-12 19:15:58 +01:00
..
appletalk net/appletalk: fix minor pointer leak to userspace in SIOCFINDIPDDPRT 2018-09-29 03:07:32 -07:00
arcnet arcnet: provide a buffer big enough to actually receive packets 2019-10-05 12:30:12 +02:00
bonding bonding: fix unexpected IFF_BONDING bit unset 2019-11-12 19:15:58 +01:00
caif caif-hsi: fix possible deadlock in cfhsi_exit_module() 2019-08-04 09:33:33 +02:00
can can: peak_usb: fix slab info leak 2019-11-12 19:15:48 +01:00
cris
dsa net: dsa: mv88e6xxx: wait after reset deactivation 2019-08-04 09:33:33 +02:00
ethernet qede: fix NULL pointer deref in __qede_remove() 2019-11-12 19:15:40 +01:00
fddi
fjes fjes: Fix wrong netdevice feature flags 2017-12-20 10:07:22 +01:00
hamradio net: hamradio: use eth_broadcast_addr 2018-08-24 13:12:30 +02:00
hippi hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close 2018-02-25 11:05:50 +01:00
hyperv hv_netvsc: Fix IP header checksum for coalesced packets 2019-03-13 14:04:53 -07:00
ieee802154 ieee802154: atusb: fix use-after-free at disconnect 2019-10-17 13:42:07 -07:00
ipvlan ipvlan: disallow userns cap_net_admin to change global mode/flags 2019-03-19 13:14:10 +01:00
irda irda: vlsi_ir: fix check for DMA mapping errors 2017-12-25 14:23:41 +01:00
phy net/phy: fix DP83865 10 Mbps HDX loopback disable function 2019-10-05 12:30:13 +02:00
plip
ppp ppp: Fix memory leak in ppp_write 2019-10-05 12:30:13 +02:00
slip slip: make slhc_free() silently accept an error pointer 2019-05-02 09:32:03 +02:00
team team: Add vlan tx offload to hw_enc_features 2019-08-25 10:51:52 +02:00
usb net: usb: qmi_wwan: add support for DW5821e with eSIM support 2019-11-12 19:15:38 +01:00
vmxnet3 vmxnet3: use DMA memory barriers where required 2018-05-25 16:12:56 +02:00
wan net/wan: fix a double free in x25_asy_open_tty() 2019-01-09 16:16:40 +01:00
wimax wimax/i2400m: fix a memory leak bug 2019-09-10 10:31:01 +01:00
wireless rtlwifi: Fix potential overflow on P2P code 2019-11-06 12:18:22 +01:00
xen-netback xen/netback: fix error path of xenvif_connect_data() 2019-10-29 09:15:26 +01:00
dummy.c
eql.c
geneve.c geneve: add missing rx stats accounting 2018-04-13 19:48:26 +02:00
gtp.c gtp: fix use-after-free in gtp_newlink() 2019-08-04 09:33:25 +02:00
ifb.c
Kconfig vmxnet3: prevent building with 64K pages 2018-02-25 11:05:51 +01:00
LICENSE.SRC
loopback.c
macsec.c macsec: drop skb sk before calling gro_cells_receive 2019-10-05 12:30:12 +02:00
macvlan.c macvlan: fix use-after-free in macvlan_common_newlink() 2018-05-30 07:50:30 +02:00
macvtap.c tap: double-free in error path in tap_open() 2017-11-18 11:22:22 +01:00
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c rapidio/rionet: do not free skb before reading its length 2018-12-05 19:42:38 +01:00
sb1000.c
Space.c
sungem_phy.c
tun.c tun: fix use-after-free when register netdev failed 2019-09-21 07:14:03 +02:00
veth.c veth: set peer GSO values 2018-03-22 09:17:57 +01:00
virtio_net.c virtio-net: Fix operstate for virtio when no VIRTIO_NET_F_STATUS 2018-05-30 07:50:44 +02:00
vrf.c vrf: make sure skb->data contains ip header to make routing 2019-08-04 09:33:34 +02:00
vxlan.c vxlan: check tun_info options_len properly 2019-11-10 11:23:28 +01:00
xen-netfront.c xen-netfront: do not use ~0U as error return value for xennet_fill_frags() 2019-10-07 18:53:23 +02:00