3.18.120-stable review
Greg Kroah-Hartman
maintainercover 3.18.120-stable review
This is the start of the stable review cycle for the 3.18.120 release. There are 56 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Aug 28 06:42:19 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.120-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.18.120-rc1
Jann Horn <[email protected]>
reiserfs: fix broken xattr handling (heap corruption, bad retval)
Lukas Wunner <[email protected]>
PCI: hotplug: Don't leak pci_slot on registration failure
Willem de Bruijn <[email protected]>
packet: refine ring v3 block size test to hold one frame
Florian Westphal <[email protected]>
netfilter: conntrack: dccp: treat SYNC/SYNCACK as invalid if no prior state
Eric Dumazet <[email protected]>
xfrm_user: prevent leaking 2 bytes of kernel memory
Daniel Rosenberg <[email protected]>
staging: android: ion: check for kref overflow
Randy Dunlap <[email protected]>
tcp: identify cryptic messages as TCP seq # bugs
Stefan Wahren <[email protected]>
net: qca_spi: Make sure the QCA7000 reset is triggered
Stefan Wahren <[email protected]>
net: qca_spi: Avoid packet drop during initial sync
David Lechner <[email protected]>
net: usb: rtl8150: demote allmulti message to dev_dbg()
Dan Carpenter <[email protected]>
qlogic: check kstrtoul() for errors
Alexander Duyck <[email protected]>
ixgbe: Be more careful when modifying MAC filters
Adam Ford <[email protected]>
ARM: dts: am3517.dtsi: Disable reference to OMAP3 OTG controller
Russell King <[email protected]>
drm/armada: fix colorkey mode property
Daniel Mack <[email protected]>
ARM: pxa: irq: fix handling of ICMR registers in suspend/resume
Florian Westphal <[email protected]>
netfilter: x_tables: set module owner for icmp(6) matches
Yuiko Oshino <[email protected]>
smsc75xx: Add workaround for gigabit link up hardware errata.
Mathieu Malaterre <[email protected]>
tracing: Use __printf markup to silence compiler
Fabio Estevam <[email protected]>
ARM: imx_v4_v5_defconfig: Select ULPI support
Greg Ungerer <[email protected]>
m68k: fix "bad page state" oops on ColdFire boot
Sudarsana Reddy Kalluru <[email protected]>
bnx2x: Fix receiving tx-timeout in error or recovery state.
Marek Szyprowski <[email protected]>
drm/exynos: gsc: Fix support for NV16/61, YUV420/YVU420 and YUV422 modes
BingJing Chang <[email protected]>
md/raid10: fix that replacement cannot complete recovery after reassemble
Dan Carpenter <[email protected]>
dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate()
Keerthy <[email protected]>
ARM: dts: da850: Fix interrups property for gpio
Sandipan Das <[email protected]>
perf report powerpc: Fix crash if callchain is empty
Daniel Mack <[email protected]>
ARM: dts: am437x: make edt-ft5x06 a wakeup source
Michael Trimarchi <[email protected]>
brcmfmac: stop watchdog before detach and free everything
Ganesh Goudar <[email protected]>
cxgb4: when disabling dcb set txq dcb priority to 0
Casey Schaufler <[email protected]>
Smack: Mark inode instant in smack_task_to_inode
Hangbin Liu <[email protected]>
ipv6: mcast: fix unsolicited report interval after receiving querys
Steven Rostedt (VMware) <[email protected]>
locking/lockdep: Do not record IRQ state within lockdep code
Bartosz Golaszewski <[email protected]>
net: davinci_emac: match the mdio device against its compatible if possible
Li RongQing <[email protected]>
net: propagate dev_get_valid_name return code
Stefan Agner <[email protected]>
net: hamradio: use eth_broadcast_addr
Govindarajulu Varadarajan <[email protected]>
enic: initialize enic->rfs_h.lock in enic_probe
Zhizhou Zhang <[email protected]>
arm64: make secondary_start_kernel() notrace
Chunfeng Yun <[email protected]>
usb: gadget: composite: fix delayed_status race condition when set_interface
William Wu <[email protected]>
usb: dwc2: fix isoc split in transfer with no data
Fathi Boudra <[email protected]>
selftests: sync: add config fragment for testing sync framework
Eric Dumazet <[email protected]>
netfilter: ipv6: nf_defrag: reduce struct net memory waste
Kees Cook <[email protected]>
isdn: Disable IIOCDBGVAR
Sudip Mukherjee <[email protected]>
Bluetooth: avoid killing an already killed socket
Chen Hu <[email protected]>
serial: 8250_dw: always set baud rate in dw8250_set_termios
John Ogness <[email protected]>
USB: serial: sierra: fix potential deadlock at close
Takashi Iwai <[email protected]>
ALSA: vxpocket: Fix invalid endian conversions
Takashi Iwai <[email protected]>
ALSA: memalloc: Don't exceed over the requested size
Takashi Iwai <[email protected]>
ALSA: cs5535audio: Fix invalid endian conversion
Takashi Iwai <[email protected]>
ALSA: virmidi: Fix too long output trigger loop
Takashi Iwai <[email protected]>
ALSA: vx222: Fix invalid endian conversions
Cong Wang <[email protected]>
vsock: split dwork to avoid reinitializations
Hangbin Liu <[email protected]>
net_sched: fix NULL pointer dereference when delete tcindex filter
Hangbin Liu <[email protected]>
net_sched: Fix missing res info when create new tc_index filter
Cong Wang <[email protected]>
llc: use refcount_inc_not_zero() for llc_sap_find()
Wei Wang <[email protected]>
l2tp: use sk_dst_check() to avoid race on sk->sk_dst_cache
Alexey Kodanev <[email protected]>
dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart()
-------------
Diffstat:
Makefile | 4 +- arch/arm/boot/dts/am3517.dtsi | 5 ++ arch/arm/boot/dts/am437x-sk-evm.dts | 2 + arch/arm/boot/dts/da850.dtsi | 6 +-- arch/arm/configs/imx_v4_v5_defconfig | 2 + arch/arm/mach-pxa/irq.c | 4 +- arch/arm64/kernel/smp.c | 2 +- arch/m68k/include/asm/mcf_pgalloc.h | 4 +- drivers/dma/k3dma.c | 2 +- drivers/gpu/drm/armada/armada_hw.h | 1 + drivers/gpu/drm/armada/armada_overlay.c | 30 ++++++++--- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 29 ++++++---- drivers/gpu/drm/exynos/regs-gsc.h | 1 + drivers/isdn/i4l/isdn_common.c | 8 +-- drivers/md/raid10.c | 7 +++ drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 +++ drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 +++ drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- drivers/net/ethernet/cisco/enic/enic_clsf.c | 3 +- drivers/net/ethernet/cisco/enic/enic_main.c | 3 +- drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 12 ++++- drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | 2 + drivers/net/ethernet/qualcomm/qca_spi.c | 5 +- drivers/net/ethernet/ti/davinci_emac.c | 4 ++ drivers/net/hamradio/bpqether.c | 8 +-- drivers/net/usb/rtl8150.c | 2 +- drivers/net/usb/smsc75xx.c | 62 ++++++++++++++++++++++ drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 7 +++ drivers/pci/hotplug/pci_hotplug_core.c | 9 ++++ drivers/staging/android/ion/ion.c | 17 ++++-- drivers/tty/serial/8250/8250_dw.c | 2 +- drivers/usb/dwc2/hcd_intr.c | 3 +- drivers/usb/gadget/composite.c | 3 ++ drivers/usb/serial/sierra.c | 4 +- fs/reiserfs/xattr.c | 4 +- include/net/af_vsock.h | 4 +- include/net/llc.h | 5 ++ include/net/net_namespace.h | 1 + include/net/netns/ipv6.h | 1 - kernel/locking/lockdep.c | 12 ++--- kernel/trace/trace.c | 5 ++ net/bluetooth/sco.c | 3 +- net/core/dev.c | 4 +- net/dccp/ccids/ccid2.c | 6 ++- net/ipv4/netfilter/ip_tables.c | 1 + net/ipv4/tcp.c | 4 +- net/ipv6/mcast.c | 9 ++-- net/ipv6/netfilter/ip6_tables.c | 1 + net/ipv6/netfilter/nf_conntrack_reasm.c | 6 +-- net/l2tp/l2tp_core.c | 2 +- net/llc/llc_core.c | 4 +- net/netfilter/nf_conntrack_proto_dccp.c | 8 +-- net/packet/af_packet.c | 10 ++-- net/sched/cls_tcindex.c | 8 ++- net/vmw_vsock/af_vsock.c | 15 +++--- net/vmw_vsock/vmci_transport.c | 3 +- net/xfrm/xfrm_user.c | 8 +-- security/smack/smack_lsm.c | 1 + sound/core/memalloc.c | 8 +-- sound/core/seq/seq_virmidi.c | 10 ++++ sound/pci/cs5535audio/cs5535audio.h | 6 +-- sound/pci/cs5535audio/cs5535audio_pcm.c | 4 +- sound/pci/vx222/vx222_ops.c | 8 +-- sound/pcmcia/vx/vxp_ops.c | 10 ++-- tools/perf/arch/powerpc/util/skip-callchain-idx.c | 2 +- tools/testing/selftests/sync/config | 4 ++ 67 files changed, 316 insertions(+), 129 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/56 dccp: fix undefined behavior with cwnd shift in ccid2_cwnd_restart()
3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Kodanev <[email protected]>
[ Upstream commit 61ef4b07fcdc30535889990cf4229766502561cf ]
The shift of 'cwnd' with '(now - hc->tx_lsndtime) / hc->tx_rto' value can lead to undefined behavior [1].
In order to fix this use a gradual shift of the window with a 'while' loop, similar to what tcp_cwnd_restart() is doing.
When comparing delta and RTO there is a minor difference between TCP and DCCP, the last one also invokes dccp_cwnd_restart() and reduces 'cwnd' if delta equals RTO. That case is preserved in this change.
[1]:
[40850.963623] UBSAN: Undefined behaviour in net/dccp/ccids/ccid2.c:237:7 [40851.043858] shift exponent 67 is too large for 32-bit type 'unsigned int' [40851.127163] CPU: 3 PID: 15940 Comm: netstress Tainted: G W E 4.18.0-rc7.x86_64 #1 ... [40851.377176] Call Trace: [40851.408503] dump_stack+0xf1/0x17b [40851.451331] ? show_regs_print_info+0x5/0x5 [40851.503555] ubsan_epilogue+0x9/0x7c [40851.548363] __ubsan_handle_shift_out_of_bounds+0x25b/0x2b4 [40851.617109] ? __ubsan_handle_load_invalid_value+0x18f/0x18f [40851.686796] ? xfrm4_output_finish+0x80/0x80 [40851.739827] ? lock_downgrade+0x6d0/0x6d0 [40851.789744] ? xfrm4_prepare_output+0x160/0x160 [40851.845912] ? ip_queue_xmit+0x810/0x1db0 [40851.895845] ? ccid2_hc_tx_packet_sent+0xd36/0x10a0 [dccp] [40851.963530] ccid2_hc_tx_packet_sent+0xd36/0x10a0 [dccp] [40852.029063] dccp_xmit_packet+0x1d3/0x720 [dccp] [40852.086254] dccp_write_xmit+0x116/0x1d0 [dccp] [40852.142412] dccp_sendmsg+0x428/0xb20 [dccp] [40852.195454] ? inet_dccp_listen+0x200/0x200 [dccp] [40852.254833] ? sched_clock+0x5/0x10 [40852.298508] ? sched_clock+0x5/0x10 [40852.342194] ? inet_create+0xdf0/0xdf0 [40852.388988] sock_sendmsg+0xd9/0x160
...
--- net/dccp/ccids/ccid2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/dccp/ccids/ccid2.c +4 -2
@@ -228,14 +228,16 @@ static void ccid2_cwnd_restart(struct sostruct ccid2_hc_tx_sock *hc =ccid2_hc_tx_sk (sk);u32 cwnd = hc->tx_cwnd, restart_cwnd, iwnd =rfc3390_bytes_to_packets (dccp_sk (sk)->dccps_mss_cache); +s32 delta = now - hc->tx_lsndtime; hc->tx_ssthresh =max (hc->tx_ssthresh, (cwnd >>1 ) + (cwnd >>2 ));/* don't reduce cwnd below the initial window (IW) */ restart_cwnd =min (cwnd, iwnd); - cwnd >>= (now - hc->tx_lsndtime) / hc->tx_rto; - hc->tx_cwnd =max (cwnd, restart_cwnd); +while ((delta -= hc->tx_rto) >=0 && cwnd > restart_cwnd) + cwnd >>=1 ; + hc->tx_cwnd =max (cwnd, restart_cwnd); hc->tx_cwnd_stamp = now; hc->tx_cwnd_used =0 ;
Greg Kroah-Hartman
maintainerPATCH 2/56 l2tp: use sk_dst_check() to avoid race on sk->sk_dst_cache
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Wang <[email protected]>
[ Upstream commit 6d37fa49da1e8db8fb1995be22ac837ca41ac8a8 ]
In l2tp code, if it is a L2TP_UDP_ENCAP tunnel, tunnel->sk points to a UDP socket. User could call sendmsg() on both this tunnel and the UDP socket itself concurrently. As l2tp_xmit_skb() holds socket lock and call __sk_dst_check() to refresh sk->sk_dst_cache, while udpv6_sendmsg() is lockless and call sk_dst_check() to refresh sk->sk_dst_cache, there could be a race and cause the dst cache to be freed multiple times. So we fix l2tp side code to always call sk_dst_check() to garantee xchg() is called when refreshing sk->sk_dst_cache to avoid race conditions.
Syzkaller reported stack trace:
BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:21 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_unless include/linux/atomic.h:575 [inline] BUG: KASAN: use-after-free in atomic_add_unless include/linux/atomic.h:597 [inline] BUG: KASAN: use-after-free in dst_hold_safe include/net/dst.h:308 [inline] BUG: KASAN: use-after-free in ip6_hold_safe+0xe6/0x670 net/ipv6/route.c:1029 Read of size 4 at addr ffff8801aea9a880 by task syz-executor129/4829 CPU: 0 PID: 4829 Comm: syz-executor129 Not tainted 4.18.0-rc7-next-20180802+ #30 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x30d mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 kasan_check_read+0x11/0x20 mm/kasan/kasan.c:272 atomic_read include/asm-generic/atomic-instrumented.h:21 [inline] atomic_fetch_add_unless include/linux/atomic.h:575 [inline] atomic_add_unless include/linux/atomic.h:597 [inline] dst_hold_safe include/net/dst.h:308 [inline] ip6_hold_safe+0xe6/0x670 net/ipv6/route.c:1029 rt6_get_pcpu_route net/ipv6/route.c:1249 [inline] ip6_pol_route+0x354/0xd20 net/ipv6/route.c:1922 ip6_pol_route_output+0x54/0x70 net/ipv6/route.c:2098 fib6_rule_lookup+0x283/0x890 net/ipv6/fib6_rules.c:122 ip6_route_output_flags+0x2c5/0x350 net/ipv6/route.c:2126 ip6_dst_lookup_tail+0x1278/0x1da0 net/ipv6/ip6_output.c:978 ip6_dst_lookup_flow+0xc8/0x270 net/ipv6/ip6_output.c:1079 ip6_sk_dst_lookup_flow+0x5ed/0xc50 net/ipv6/ip6_output.c:1117 udpv6_sendmsg+0x2163/0x36b0 net/ipv6/udp.c:1354 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:632 ___sys_sendmsg+0x51d/0x930 net/socket.c:2115 __sys_sendmmsg+0x240/0x6f0 net/socket.c:2210 __do_sys_sendmmsg net/socket.c:2239 [inline] __se_sys_sendmmsg net/socket.c:2236 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2236 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x446a29 Code: e8 ac b8 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 eb 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f4de5532db8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00000000006dcc38 RCX: 0000000000446a29 RDX: 00000000000000b8 RSI: 0000000020001b00 RDI: 0000000000000003 RBP: 00000000006dcc30 R08: 00007f4de5533700 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dcc3c R13: 00007ffe2b830fdf R14: 00007f4de55339c0 R15: 0000000000000001
--- net/l2tp/l2tp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/l2tp/l2tp_core.c +1 -1
@@ -1141,7 +1141,7 @@ int l2tp_xmit_skb(struct l2tp_session *s/* Get routing info from the tunnel socket */ skb_dst_drop (skb); -skb_dst_set (skb,dst_clone (__sk_dst_check (sk,0 ))); +skb_dst_set (skb,sk_dst_check (sk,0 )); inet =inet_sk (sk); fl = &inet->cork.fl;
Greg Kroah-Hartman
maintainerPATCH 3/56 llc: use refcount_inc_not_zero() for llc_sap_find()
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit 0dcb82254d65f72333aa50ad626d1e9665ad093b ]
llc_sap_put() decreases the refcnt before deleting sap from the global list. Therefore, there is a chance llc_sap_find() could find a sap with zero refcnt in this global list.
Close this race condition by checking if refcnt is zero or not in llc_sap_find(), if it is zero then it is being removed so we can just treat it as gone.
--- include/net/llc.h | 5 +++++ net/llc/llc_core.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)
include/net/llc.h +5 -0
@@ -116,6 +116,11 @@ static inline void llc_sap_hold(struct latomic_inc (&sap->refcnt); } +static inline bool llc_sap_hold_safe (struct llc_sap *sap) +{ +return atomic_inc_not_zero (&sap->refcnt); +} +void llc_sap_close (struct llc_sap *sap);static inline void llc_sap_put (struct llc_sap *sap)
net/llc/llc_core.c +2 -2
@@ -73,8 +73,8 @@ struct llc_sap *llc_sap_find(unsigned chrcu_read_lock_bh (); sap =__llc_sap_find (sap_value); -if (sap) -llc_sap_hold (sap); +if (!sap || !llc_sap_hold_safe (sap)) + sap =NULL ;rcu_read_unlock_bh ();return sap; }
Greg Kroah-Hartman
maintainerPATCH 4/56 net_sched: Fix missing res info when create new tc_index filter
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangbin Liu <[email protected]>
[ Upstream commit 008369dcc5f7bfba526c98054f8525322acf0ea3 ]
Li Shuang reported the following warn:
[ 733.484610] WARNING: CPU: 6 PID: 21123 at net/sched/sch_cbq.c:1418 cbq_destroy_class+0x5d/0x70 [sch_cbq] [ 733.495190] Modules linked in: sch_cbq cls_tcindex sch_dsmark rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs lockd grace fscache xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat l [ 733.574155] syscopyarea sysfillrect sysimgblt fb_sys_fops ttm drm igb ixgbe ahci libahci i2c_algo_bit libata i40e i2c_core dca mdio megaraid_sas dm_mirror dm_region_hash dm_log dm_mod [ 733.592500] CPU: 6 PID: 21123 Comm: tc Not tainted 4.18.0-rc8.latest+ #131 [ 733.600169] Hardware name: Dell Inc. PowerEdge R730/0WCJNT, BIOS 2.1.5 04/11/2016 [ 733.608518] RIP: 0010:cbq_destroy_class+0x5d/0x70 [sch_cbq] [ 733.614734] Code: e7 d9 d2 48 8b 7b 48 e8 61 05 da d2 48 8d bb f8 00 00 00 e8 75 ae d5 d2 48 39 eb 74 0a 48 89 df 5b 5d e9 16 6c 94 d2 5b 5d c3 <0f> 0b eb b6 0f 1f 44 00 00 66 2e 0f 1f 84 [ 733.635798] RSP: 0018:ffffbfbb066bb9d8 EFLAGS: 00010202 [ 733.641627] RAX: 0000000000000001 RBX: ffff9cdd17392800 RCX: 000000008010000f [ 733.649588] RDX: ffff9cdd1df547e0 RSI: ffff9cdd17392800 RDI: ffff9cdd0f84c800 [ 733.657547] RBP: ffff9cdd0f84c800 R08: 0000000000000001 R09: 0000000000000000 [ 733.665508] R10: ffff9cdd0f84d000 R11: 0000000000000001 R12: 0000000000000001 [ 733.673469] R13: 0000000000000000 R14: 0000000000000001 R15: ffff9cdd17392200 [ 733.681430] FS: 00007f911890a740(0000) GS:ffff9cdd1f8c0000(0000) knlGS:0000000000000000 [ 733.690456] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 733.696864] CR2: 0000000000b5544c CR3: 0000000859374002 CR4: 00000000001606e0 [ 733.704826] Call Trace: [ 733.707554] cbq_destroy+0xa1/0xd0 [sch_cbq] [ 733.712318] qdisc_destroy+0x62/0x130 [ 733.716401] dsmark_destroy+0x2a/0x70 [sch_dsmark] [ 733.721745] qdisc_destroy+0x62/0x130 [ 733.725829] qdisc_graft+0x3ba/0x470 [ 733.729817] tc_get_qdisc+0x2a6/0x2c0 [ 733.733901] ? cred_has_capability+0x7d/0x130 [ 733.738761] rtnetlink_rcv_msg+0x263/0x2d0 [ 733.743330] ? rtnl_calcit.isra.30+0x110/0x110 [ 733.748287] netlink_rcv_skb+0x4d/0x130 [ 733.752576] netlink_unicast+0x1a3/0x250 [ 733.756949] netlink_sendmsg+0x2ae/0x3a0 [ 733.761324] sock_sendmsg+0x36/0x40 [ 733.765213] ___sys_sendmsg+0x26f/0x2d0 [ 733.769493] ? handle_pte_fault+0x586/0xdf0 [ 733.774158] ? __handle_mm_fault+0x389/0x500 [ 733.778919] ? __sys_sendmsg+0x5e/0xa0 [ 733.783099] __sys_sendmsg+0x5e/0xa0 [ 733.787087] do_syscall_64+0x5b/0x180 [ 733.791171] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 733.796805] RIP: 0033:0x7f9117f23f10 [ 733.800791] Code: c3 48 8b 05 82 6f 2c 00 f7 db 64 89 18 48 83 cb ff eb dd 0f 1f 80 00 00 00 00 83 3d 8d d0 2c 00 00 75 10 b8 2e 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 [ 733.821873] RSP: 002b:00007ffe96818398 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 733.830319] RAX: ffffffffffffffda RBX: 000000005b71244c RCX: 00007f9117f23f10 [ 733.838280] RDX: 0000000000000000 RSI: 00007ffe968183e0 RDI: 0000000000000003 [ 733.846241] RBP: 00007ffe968183e0 R08: 000000000000ffff R09: 0000000000000003 [ 733.854202] R10: 00007ffe96817e20 R11: 0000000000000246 R12: 0000000000000000 [ 733.862161] R13: 0000000000662ee0 R14: 0000000000000000 R15: 0000000000000000 [ 733.870121] ---[ end trace 28edd4aad712ddca ]---
This is because we didn't update f->result.res when create new filter. Then in tcindex_delete() -> tcf_unbind_filter(), we will failed to find out the res and unbind filter, which will trigger the WARN_ON() in cbq_destroy_class().
Fix it by updating f->result.res when create new filter.
--- net/sched/cls_tcindex.c | 1 + 1 file changed, 1 insertion(+)
net/sched/cls_tcindex.c +1 -0
@@ -384,6 +384,7 @@ tcindex_set_parms(struct net *net, strucstruct tcindex_filter *nfp;struct tcindex_filter __rcu **fp; + f->result.res = r->res;tcf_exts_change (tp, &f->result.exts, &r->exts); fp = cp->h + (handle % cp->hash);
Greg Kroah-Hartman
maintainerPATCH 5/56 net_sched: fix NULL pointer dereference when delete tcindex filter
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangbin Liu <[email protected]>
[ Upstream commit 2df8bee5654bb2b7312662ca6810d4dc16b0b67f ]
Li Shuang reported the following crash:
[ 71.267724] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004 [ 71.276456] PGD 800000085d9bd067 P4D 800000085d9bd067 PUD 859a0b067 PMD 0 [ 71.284127] Oops: 0000 [#1] SMP PTI [ 71.288015] CPU: 12 PID: 2386 Comm: tc Not tainted 4.18.0-rc8.latest+ #131 [ 71.295686] Hardware name: Dell Inc. PowerEdge R730/0WCJNT, BIOS 2.1.5 04/11/2016 [ 71.304037] RIP: 0010:tcindex_delete+0x72/0x280 [cls_tcindex] [ 71.310446] Code: 00 31 f6 48 87 75 20 48 85 f6 74 11 48 8b 47 18 48 8b 40 08 48 8b 40 50 e8 fb a6 f8 fc 48 85 db 0f 84 dc 00 00 00 48 8b 73 18 <8b> 56 04 48 8d 7e 04 85 d2 0f 84 7b 01 00 [ 71.331517] RSP: 0018:ffffb45207b3f898 EFLAGS: 00010282 [ 71.337345] RAX: ffff8ad3d72d6360 RBX: ffff8acc84393680 RCX: 000000000000002e [ 71.345306] RDX: ffff8ad3d72c8570 RSI: 0000000000000000 RDI: ffff8ad847a45800 [ 71.353277] RBP: ffff8acc84393688 R08: ffff8ad3d72c8400 R09: 0000000000000000 [ 71.361238] R10: ffff8ad3de786e00 R11: 0000000000000000 R12: ffffb45207b3f8c7 [ 71.369199] R13: ffff8ad3d93bd2a0 R14: 000000000000002e R15: ffff8ad3d72c9600 [ 71.377161] FS: 00007f9d3ec3e740(0000) GS:ffff8ad3df980000(0000) knlGS:0000000000000000 [ 71.386188] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 71.392597] CR2: 0000000000000004 CR3: 0000000852f06003 CR4: 00000000001606e0 [ 71.400558] Call Trace: [ 71.403299] tcindex_destroy_element+0x25/0x40 [cls_tcindex] [ 71.409611] tcindex_walk+0xbb/0x110 [cls_tcindex] [ 71.414953] tcindex_destroy+0x44/0x90 [cls_tcindex] [ 71.420492] ? tcindex_delete+0x280/0x280 [cls_tcindex] [ 71.426323] tcf_proto_destroy+0x16/0x40 [ 71.430696] tcf_chain_flush+0x51/0x70 [ 71.434876] tcf_block_put_ext.part.30+0x8f/0x1b0 [ 71.440122] tcf_block_put+0x4d/0x70 [ 71.444108] cbq_destroy+0x4d/0xd0 [sch_cbq] [ 71.448869] qdisc_destroy+0x62/0x130 [ 71.452951] dsmark_destroy+0x2a/0x70 [sch_dsmark] [ 71.458300] qdisc_destroy+0x62/0x130 [ 71.462373] qdisc_graft+0x3ba/0x470 [ 71.466359] tc_get_qdisc+0x2a6/0x2c0 [ 71.470443] ? cred_has_capability+0x7d/0x130 [ 71.475307] rtnetlink_rcv_msg+0x263/0x2d0 [ 71.479875] ? rtnl_calcit.isra.30+0x110/0x110 [ 71.484832] netlink_rcv_skb+0x4d/0x130 [ 71.489109] netlink_unicast+0x1a3/0x250 [ 71.493482] netlink_sendmsg+0x2ae/0x3a0 [ 71.497859] sock_sendmsg+0x36/0x40 [ 71.501748] ___sys_sendmsg+0x26f/0x2d0 [ 71.506029] ? handle_pte_fault+0x586/0xdf0 [ 71.510694] ? __handle_mm_fault+0x389/0x500 [ 71.515457] ? __sys_sendmsg+0x5e/0xa0 [ 71.519636] __sys_sendmsg+0x5e/0xa0 [ 71.523626] do_syscall_64+0x5b/0x180 [ 71.527711] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 71.533345] RIP: 0033:0x7f9d3e257f10 [ 71.537331] Code: c3 48 8b 05 82 6f 2c 00 f7 db 64 89 18 48 83 cb ff eb dd 0f 1f 80 00 00 00 00 83 3d 8d d0 2c 00 00 75 10 b8 2e 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 [ 71.558401] RSP: 002b:00007fff6f893398 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 71.566848] RAX: ffffffffffffffda RBX: 000000005b71274d RCX: 00007f9d3e257f10 [ 71.574810] RDX: 0000000000000000 RSI: 00007fff6f8933e0 RDI: 0000000000000003 [ 71.582770] RBP: 00007fff6f8933e0 R08: 000000000000ffff R09: 0000000000000003 [ 71.590729] R10: 00007fff6f892e20 R11: 0000000000000246 R12: 0000000000000000 [ 71.598689] R13: 0000000000662ee0 R14: 0000000000000000 R15: 0000000000000000 [ 71.606651] Modules linked in: sch_cbq cls_tcindex sch_dsmark xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_coni [ 71.685425] libahci i2c_algo_bit i2c_core i40e libata dca mdio megaraid_sas dm_mirror dm_region_hash dm_log dm_mod [ 71.697075] CR2: 0000000000000004 [ 71.700792] ---[ end trace f604eb1acacd978b ]---
Reproducer:
tc qdisc add dev lo handle 1:0 root dsmark indices 64 set_tc_index
tc filter add dev lo parent 1:0 protocol ip prio 1 tcindex mask 0xfc shift 2
tc qdisc add dev lo parent 1:0 handle 2:0 cbq bandwidth 10Mbit cell 8 avpkt 1000 mpu 64
tc class add dev lo parent 2:0 classid 2:1 cbq bandwidth 10Mbit rate 1500Kbit avpkt 1000 prio 1 bounded isolated allot 1514 weight 1 maxburst 10 tc filter add dev lo parent 2:0 protocol ip prio 1 handle 0x2e tcindex classid 2:1 pass_on
tc qdisc add dev lo parent 2:1 pfifo limit 5
tc qdisc del dev lo root
This is because in tcindex_set_parms, when there is no old_r, we set new exts to cr.exts. And we didn't set it to filter when r == &new_filter_result.
Then in tcindex_delete() -> tcf_exts_get_net(), we will get NULL pointer dereference as we didn't init exts.
Fix it by moving tcf_exts_change() after "if (old_r && old_r != r)" check. Then we don't need "cr" as there is no errout after that.
--- net/sched/cls_tcindex.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
net/sched/cls_tcindex.c +2 -5
@@ -368,16 +368,13 @@ tcindex_set_parms(struct net *net, structcf_bind_filter (tp, &cr.res, base); } -if (old_r) -tcf_exts_change (tp, &r->exts, &e); -else -tcf_exts_change (tp, &cr.exts, &e); -if (old_r && old_r != r)tcindex_filter_result_init (old_r); oldp = p; r->res = cr.res; +tcf_exts_change (tp, &r->exts, &e); +rcu_assign_pointer (tp->root, cp);if (r == &new_filter_result) {
Greg Kroah-Hartman
maintainerPATCH 6/56 vsock: split dwork to avoid reinitializations
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit 455f05ecd2b219e9a216050796d30c830d9bc393 ]
syzbot reported that we reinitialize an active delayed work in vsock_stream_connect():
ODEBUG: init active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x90 kernel/workqueue.c:1414 WARNING: CPU: 1 PID: 11518 at lib/debugobjects.c:329 debug_print_object+0x16a/0x210 lib/debugobjects.c:326
The pattern is apparently wrong, we should only initialize the dealyed work once and could repeatly schedule it. So we have to move out the initializations to allocation side. And to avoid confusion, we can split the shared dwork into two, instead of re-using the same one.
--- include/net/af_vsock.h | 4 ++-- net/vmw_vsock/af_vsock.c | 15 ++++++++------- net/vmw_vsock/vmci_transport.c | 3 +-- 3 files changed, 11 insertions(+), 11 deletions(-)
include/net/af_vsock.h +2 -2
@@ -59,7 +59,8 @@ struct vsock_sock {struct list_head pending_links;struct list_head accept_queue;bool rejected; -struct delayed_work dwork; +struct delayed_work connect_work; +struct delayed_work pending_work;u32 peer_shutdown;bool sent_request;bool ignore_connecting_rst;
@@ -70,7 +71,6 @@ struct vsock_sock {s64 vsock_stream_has_data (struct vsock_sock *vsk);s64 vsock_stream_has_space (struct vsock_sock *vsk); -void vsock_pending_work (struct work_struct *work); struct sock *__vsock_create(struct net *net, struct socket *sock, struct sock *parent,
net/vmw_vsock/af_vsock.c +8 -7
@@ -431,14 +431,14 @@ static int vsock_send_shutdown(struct soreturn transport->shutdown (vsock_sk (sk), mode); } -void vsock_pending_work (struct work_struct *work) +static void vsock_pending_work (struct work_struct *work) {struct sock *sk;struct sock *listener;struct vsock_sock *vsk;bool cleanup; - vsk = container_of(work, struct vsock_sock, dwork.work); + vsk = container_of(work, struct vsock_sock, pending_work.work); sk =sk_vsock (vsk); listener = vsk->listener; cleanup = true;
@@ -478,7 +478,6 @@ out:sock_put (sk);sock_put (listener); } -EXPORT_SYMBOL_GPL (vsock_pending_work);/**** SOCKET OPERATIONS ****/
@@ -577,6 +576,8 @@ static int __vsock_bind(struct sock *sk,return retval; } +static void vsock_connect_timeout (struct work_struct *work); + struct sock *__vsock_create(struct net *net, struct socket *sock, struct sock *parent,
@@ -618,6 +619,8 @@ struct sock *__vsock_create(struct net * vsk->sent_request = false; vsk->ignore_connecting_rst = false; vsk->peer_shutdown =0 ; +INIT_DELAYED_WORK (&vsk->connect_work, vsock_connect_timeout); +INIT_DELAYED_WORK (&vsk->pending_work, vsock_pending_work); psk = parent ?vsock_sk (parent) :NULL ;if (parent) {
@@ -1095,7 +1098,7 @@ static void vsock_connect_timeout(structstruct sock *sk;struct vsock_sock *vsk; - vsk = container_of(work, struct vsock_sock, dwork.work); + vsk = container_of(work, struct vsock_sock, connect_work.work); sk =sk_vsock (vsk);lock_sock (sk);
@@ -1196,9 +1199,7 @@ static int vsock_stream_connect(struct s* timeout fires. */ sock_hold (sk); -INIT_DELAYED_WORK (&vsk->dwork, - vsock_connect_timeout); -schedule_delayed_work (&vsk->dwork, timeout); +schedule_delayed_work (&vsk->connect_work, timeout);/* Skip ahead to preserve error code set above. */ goto out_wait;
net/vmw_vsock/vmci_transport.c +1 -2
@@ -1127,8 +1127,7 @@ static int vmci_transport_recv_listen(st vpending->listener = sk;sock_hold (sk);sock_hold (pending); -INIT_DELAYED_WORK (&vpending->dwork, vsock_pending_work); -schedule_delayed_work (&vpending->dwork,HZ ); +schedule_delayed_work (&vpending->pending_work,HZ ); out:return err;
Greg Kroah-Hartman
maintainerPATCH 7/56 ALSA: vx222: Fix invalid endian conversions
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit fff71a4c050ba46e305d910c837b99ba1728135e upstream.
The endian conversions used in vx2_dma_read() and vx2_dma_write() are superfluous and even wrong on big-endian machines, as inl() and outl() already do conversions. Kill them.
Spotted by sparse, a warning like:
sound/pci/vx222/vx222_ops.c:278:30: warning: incorrect type in argument 1 (different base types)
--- sound/pci/vx222/vx222_ops.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/pci/vx222/vx222_ops.c +4 -4
@@ -270,7 +270,7 @@ static void vx2_dma_write(struct vx_core length >>=2 ;/* in 32bit words */ /* Transfer using pseudo-dma. */ for (; length >0 ; length--) { -outl (cpu_to_le32 (*addr), port); +outl (*addr, port); addr++; } addr = (u32 *)runtime->dma_area;
@@ -280,7 +280,7 @@ static void vx2_dma_write(struct vx_core count >>=2 ;/* in 32bit words */ /* Transfer using pseudo-dma. */ for (; count >0 ; count--) { -outl (cpu_to_le32 (*addr), port); +outl (*addr, port); addr++; }
@@ -308,7 +308,7 @@ static void vx2_dma_read(struct vx_core length >>=2 ;/* in 32bit words */ /* Transfer using pseudo-dma. */ for (; length >0 ; length--) - *addr++ =le32_to_cpu (inl (port)); + *addr++ =inl (port); addr = (u32 *)runtime->dma_area; pipe->hw_ptr =0 ; }
@@ -316,7 +316,7 @@ static void vx2_dma_read(struct vx_core count >>=2 ;/* in 32bit words */ /* Transfer using pseudo-dma. */ for (; count >0 ; count--) - *addr++ =le32_to_cpu (inl (port)); + *addr++ =inl (port);vx2_release_pseudo_dma (chip); }
Greg Kroah-Hartman
maintainerPATCH 8/56 ALSA: virmidi: Fix too long output trigger loop
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 50e9ffb1996a5d11ff5040a266585bad4ceeca0a upstream.
The virmidi output trigger tries to parse the all available bytes and process sequencer events as much as possible. In a normal situation, this is supposed to be relatively short, but a program may give a huge buffer and it'll take a long time in a single spin lock, which may eventually lead to a soft lockup.
This patch simply adds a workaround, a cond_resched() call in the loop if applicable. A better solution would be to move the event processor into a work, but let's put a duct-tape quickly at first.
--- sound/core/seq/seq_virmidi.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/core/seq/seq_virmidi.c +10 -0
@@ -163,6 +163,7 @@ static void snd_virmidi_output_trigger(sint count, res;unsigned char buf[32 ], *pbuf;unsigned long flags; +bool check_resched = !in_atomic ();if (up) { vmidi->trigger =1 ;
@@ -200,6 +201,15 @@ static void snd_virmidi_output_trigger(s vmidi->event.type =SNDRV_SEQ_EVENT_NONE ; } } +if (!check_resched) +continue ; +/* do temporary unlock & cond_resched() for avoiding +* CPU soft lockup, which may happen via a write from +* a huge rawmidi buffer +*/ +spin_unlock_irqrestore (&substream->runtime->lock, flags); +cond_resched (); +spin_lock_irqsave (&substream->runtime->lock, flags); } out:spin_unlock_irqrestore (&substream->runtime->lock, flags);
Greg Kroah-Hartman
maintainerPATCH 9/56 ALSA: cs5535audio: Fix invalid endian conversion
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 69756930f2de0457d51db7d505a1e4f40e9fd116 upstream.
One place in cs5535audio_build_dma_packets() does an extra conversion via cpu_to_le32(); namely jmpprd_addr is passed to setup_prd() ops, which writes the value via cs_writel(). That is, the callback does the conversion by itself, and we don't need to convert beforehand.
This patch fixes that bogus conversion.
--- sound/pci/cs5535audio/cs5535audio.h | 6 +++--- sound/pci/cs5535audio/cs5535audio_pcm.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
sound/pci/cs5535audio/cs5535audio.h +3 -3
@@ -66,9 +66,9 @@ struct cs5535audio_dma_ops { };struct cs5535audio_dma_desc { -u32 addr; -u16 size; -u16 ctlreserved; +__le32 addr; +__le16 size; +__le16 ctlreserved; };struct cs5535audio_dma {
sound/pci/cs5535audio/cs5535audio_pcm.c +2 -2
@@ -158,8 +158,8 @@ static int cs5535audio_build_dma_packets lastdesc->addr =cpu_to_le32 ((u32 ) dma->desc_buf.addr); lastdesc->size =0 ; lastdesc->ctlreserved =cpu_to_le16 (PRD_JMP ); - jmpprd_addr =cpu_to_le32 (lastdesc->addr + - (sizeof (struct cs5535audio_dma_desc )*periods)); + jmpprd_addr = (u32 )dma->desc_buf.addr + +sizeof (struct cs5535audio_dma_desc ) * periods; dma->substream = substream; dma->period_bytes = period_bytes;
Greg Kroah-Hartman
maintainerPATCH 10/56 ALSA: memalloc: Dont exceed over the requested size
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit dfef01e150824b0e6da750cacda8958188d29aea upstream.
snd_dma_alloc_pages_fallback() tries to allocate pages again when the allocation fails with reduced size. But the first try actually *increases* the size to power-of-two, which may give back a larger chunk than the requested size. This confuses the callers, e.g. sgbuf assumes that the size is equal or less, and it may result in a bad loop due to the underflow and eventually lead to Oops.
The code of this function seems incorrectly assuming the usage of get_order(). We need to decrease at first, then align to power-of-two.
--- sound/core/memalloc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
sound/core/memalloc.c +2 -6
@@ -239,16 +239,12 @@ int snd_dma_alloc_pages_fallback(int typint err;while ((err =snd_dma_alloc_pages (type, device, size, dmab)) <0 ) { -size_t aligned_size;if (err != -ENOMEM )return err;if (size <=PAGE_SIZE )return -ENOMEM ; - aligned_size =PAGE_SIZE <<get_order (size); -if (size != aligned_size) - size = aligned_size; -else - size >>=1 ; + size >>=1 ; + size =PAGE_SIZE <<get_order (size); }if (! dmab->area)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 11/56 ALSA: vxpocket: Fix invalid endian conversions
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 3acd3e3bab95ec3622ff98da313290ee823a0f68 upstream.
The endian conversions used in vxp_dma_read() and vxp_dma_write() are superfluous and even wrong on big-endian machines, as inw() and outw() already do conversions. Kill them.
--- sound/pcmcia/vx/vxp_ops.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
sound/pcmcia/vx/vxp_ops.c +5 -5
@@ -375,7 +375,7 @@ static void vxp_dma_write(struct vx_core length >>=1 ;/* in 16bit words */ /* Transfer using pseudo-dma. */ for (; length >0 ; length--) { -outw (cpu_to_le16 (*addr), port); +outw (*addr, port); addr++; } addr = (unsigned short *)runtime->dma_area;
@@ -385,7 +385,7 @@ static void vxp_dma_write(struct vx_core count >>=1 ;/* in 16bit words */ /* Transfer using pseudo-dma. */ for (; count >0 ; count--) { -outw (cpu_to_le16 (*addr), port); +outw (*addr, port); addr++; }vx_release_pseudo_dma (chip);
@@ -417,7 +417,7 @@ static void vxp_dma_read(struct vx_core length >>=1 ;/* in 16bit words */ /* Transfer using pseudo-dma. */ for (; length >0 ; length--) - *addr++ =le16_to_cpu (inw (port)); + *addr++ =inw (port); addr = (unsigned short *)runtime->dma_area; pipe->hw_ptr =0 ; }
@@ -425,12 +425,12 @@ static void vxp_dma_read(struct vx_core count >>=1 ;/* in 16bit words */ /* Transfer using pseudo-dma. */ for (; count >1 ; count--) - *addr++ =le16_to_cpu (inw (port)); + *addr++ =inw (port);/* Disable DMA */ pchip->regDIALOG &= ~VXP_DLG_DMAREAD_SEL_MASK ;vx_outb (chip,DIALOG , pchip->regDIALOG);/* Read the last word (16 bits) */ - *addr =le16_to_cpu (inw (port)); + *addr =inw (port);/* Disable 16-bit accesses */ pchip->regDIALOG &= ~VXP_DLG_DMA16_SEL_MASK ;vx_outb (chip,DIALOG , pchip->regDIALOG);
Greg Kroah-Hartman
maintainerPATCH 12/56 USB: serial: sierra: fix potential deadlock at close
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Ogness <[email protected]>
commit e60870012e5a35b1506d7b376fddfb30e9da0b27 upstream.
The portdata spinlock can be taken in interrupt context (via sierra_outdat_callback()).
Disable interrupts when taking the portdata spinlock when discarding deferred URBs during close to prevent a possible deadlock.
--- drivers/usb/serial/sierra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/serial/sierra.c +2 -2
@@ -790,9 +790,9 @@ static void sierra_close(struct usb_serikfree (urb->transfer_buffer);usb_free_urb (urb);usb_autopm_put_interface_async (serial->interface); -spin_lock (&portdata->lock); +spin_lock_irq (&portdata->lock); portdata->outstanding_urbs--; -spin_unlock (&portdata->lock); +spin_unlock_irq (&portdata->lock); }sierra_stop_rx_urbs (port);
Greg Kroah-Hartman
maintainerPATCH 13/56 serial: 8250_dw: always set baud rate in dw8250_set_termios
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Hu <[email protected]>
commit dfcab6ba573445c703235ab6c83758eec12d7f28 upstream.
dw8250_set_termios() doesn't set baud rate if the arg "old ktermios" is NULL. This happens during resume.
Call Trace: ... [ 54.928108] dw8250_set_termios+0x162/0x170 [ 54.928114] serial8250_set_termios+0x17/0x20 [ 54.928117] uart_change_speed+0x64/0x160 [ 54.928119] uart_resume_port
...
So the baud rate is not restored after S3 and breaks the apps who use UART, for example, console and bluetooth etc.
We address this issue by setting the baud rate irrespective of arg "old", just like the drivers for other 8250 IPs. This is tested with Intel Broxton platform.
--- drivers/tty/serial/8250/8250_dw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_dw.c +1 -1
@@ -202,7 +202,7 @@ static void dw8250_set_termios(struct uaunsigned int rate;int ret; -if (IS_ERR (d->clk) || !old) +if (IS_ERR (d->clk)) goto out;/* Not requesting clock rates below 1.8432Mhz */
Greg Kroah-Hartman
maintainerPATCH 14/56 Bluetooth: avoid killing an already killed socket
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudip Mukherjee <[email protected]>
commit 4e1a720d0312fd510699032c7694a362a010170f upstream.
slub debug reported:
[ 440.648642] ============================================================================= [ 440.648649] BUG kmalloc-1024 (Tainted: G BU O ): Poison overwritten [ 440.648651] -----------------------------------------------------------------------------
[ 440.648655] INFO: 0xe70f4bec-0xe70f4bec. First byte 0x6a instead of 0x6b [ 440.648665] INFO: Allocated in sk_prot_alloc+0x6b/0xc6 age=33155 cpu=1 pid=1047 [ 440.648671] ___slab_alloc.constprop.24+0x1fc/0x292 [ 440.648675] __slab_alloc.isra.18.constprop.23+0x1c/0x25 [ 440.648677] __kmalloc+0xb6/0x17f [ 440.648680] sk_prot_alloc+0x6b/0xc6 [ 440.648683] sk_alloc+0x1e/0xa1 [ 440.648700] sco_sock_alloc.constprop.6+0x26/0xaf [bluetooth] [ 440.648716] sco_connect_cfm+0x166/0x281 [bluetooth] [ 440.648731] hci_conn_request_evt.isra.53+0x258/0x281 [bluetooth] [ 440.648746] hci_event_packet+0x28b/0x2326 [bluetooth] [ 440.648759] hci_rx_work+0x161/0x291 [bluetooth] [ 440.648764] process_one_work+0x163/0x2b2 [ 440.648767] worker_thread+0x1a9/0x25c [ 440.648770] kthread+0xf8/0xfd [ 440.648774] ret_from_fork+0x2e/0x38 [ 440.648779] INFO: Freed in __sk_destruct+0xd3/0xdf age=3815 cpu=1 pid=1047 [ 440.648782] __slab_free+0x4b/0x27a [ 440.648784] kfree+0x12e/0x155 [ 440.648787] __sk_destruct+0xd3/0xdf [ 440.648790] sk_destruct+0x27/0x29 [ 440.648793] __sk_free+0x75/0x91 [ 440.648795] sk_free+0x1c/0x1e [ 440.648810] sco_sock_kill+0x5a/0x5f [bluetooth] [ 440.648825] sco_conn_del+0x8e/0xba [bluetooth] [ 440.648840] sco_disconn_cfm+0x3a/0x41 [bluetooth] [ 440.648855] hci_event_packet+0x45e/0x2326 [bluetooth] [ 440.648868] hci_rx_work+0x161/0x291 [bluetooth] [ 440.648872] process_one_work+0x163/0x2b2 [ 440.648875] worker_thread+0x1a9/0x25c [ 440.648877] kthread+0xf8/0xfd [ 440.648880] ret_from_fork+0x2e/0x38 [ 440.648884] INFO: Slab 0xf4718580 objects=27 used=27 fp=0x (null) flags=0x40008100 [ 440.648886] INFO: Object 0xe70f4b88 @offset=19336 fp=0xe70f54f8
When KASAN was enabled, it reported:
[ 210.096613] ================================================================== [ 210.096634] BUG: KASAN: use-after-free in ex_handler_refcount+0x5b/0x127 [ 210.096641] Write of size 4 at addr ffff880107e17160 by task kworker/u9:1/2040
[ 210.096651] CPU: 1 PID: 2040 Comm: kworker/u9:1 Tainted: G U O 4.14.47-20180606+ #2 [ 210.096654] Hardware name: , BIOS 2017.01-00087-g43e04de 08/30/2017 [ 210.096693] Workqueue: hci0 hci_rx_work [bluetooth] [ 210.096698] Call Trace: [ 210.096711] dump_stack+0x46/0x59 [ 210.096722] print_address_description+0x6b/0x23b [ 210.096729] ? ex_handler_refcount+0x5b/0x127 [ 210.096736] kasan_report+0x220/0x246 [ 210.096744] ex_handler_refcount+0x5b/0x127 [ 210.096751] ? ex_handler_clear_fs+0x85/0x85 [ 210.096757] fixup_exception+0x8c/0x96 [ 210.096766] do_trap+0x66/0x2c1 [ 210.096773] do_error_trap+0x152/0x180 [ 210.096781] ? fixup_bug+0x78/0x78 [ 210.096817] ? hci_debugfs_create_conn+0x244/0x26a [bluetooth] [ 210.096824] ? __schedule+0x113b/0x1453 [ 210.096830] ? sysctl_net_exit+0xe/0xe [ 210.096837] ? __wake_up_common+0x343/0x343 [ 210.096843] ? insert_work+0x107/0x163 [ 210.096850] invalid_op+0x1b/0x40 [ 210.096888] RIP: 0010:hci_debugfs_create_conn+0x244/0x26a [bluetooth] [ 210.096892] RSP: 0018:ffff880094a0f970 EFLAGS: 00010296 [ 210.096898] RAX: 0000000000000000 RBX: ffff880107e170e8 RCX: ffff880107e17160 [ 210.096902] RDX: 000000000000002f RSI: ffff88013b80ed40 RDI: ffffffffa058b940 [ 210.096906] RBP: ffff88011b2b0578 R08: 00000000852f0ec9 R09: ffffffff81cfcf9b [ 210.096909] R10: 00000000d21bdad7 R11: 0000000000000001 R12: ffff8800967b0488 [ 210.096913] R13: ffff880107e17168 R14: 0000000000000068 R15: ffff8800949c0008 [ 210.096920] ? __sk_destruct+0x2c6/0x2d4 [ 210.096959] hci_event_packet+0xff5/0x7de2 [bluetooth] [ 210.096969] ? __local_bh_enable_ip+0x43/0x5b [ 210.097004] ? l2cap_sock_recv_cb+0x158/0x166 [bluetooth] [ 210.097039] ? hci_le_meta_evt+0x2bb3/0x2bb3 [bluetooth] [ 210.097075] ? l2cap_ertm_init+0x94e/0x94e [bluetooth] [ 210.097093] ? xhci_urb_enqueue+0xbd8/0xcf5 [xhci_hcd] [ 210.097102] ? __accumulate_pelt_segments+0x24/0x33 [ 210.097109] ? __accumulate_pelt_segments+0x24/0x33 [ 210.097115] ? __update_load_avg_se.isra.2+0x217/0x3a4 [ 210.097122] ? set_next_entity+0x7c3/0x12cd [ 210.097128] ? pick_next_entity+0x25e/0x26c [ 210.097135] ? pick_next_task_fair+0x2ca/0xc1a [ 210.097141] ? switch_mm_irqs_off+0x346/0xb4f [ 210.097147] ? __switch_to+0x769/0xbc4 [ 210.097153] ? compat_start_thread+0x66/0x66 [ 210.097188] ? hci_conn_check_link_mode+0x1cd/0x1cd [bluetooth] [ 210.097195] ? finish_task_switch+0x392/0x431 [ 210.097228] ? hci_rx_work+0x154/0x487 [bluetooth] [ 210.097260] hci_rx_work+0x154/0x487 [bluetooth] [ 210.097269] process_one_work+0x579/0x9e9 [ 210.097277] worker_thread+0x68f/0x804 [ 210.097285] kthread+0x31c/0x32b [ 210.097292] ? rescuer_thread+0x70c/0x70c [ 210.097299] ? kthread_create_on_node+0xa3/0xa3 [ 210.097306] ret_from_fork+0x35/0x40
[ 210.097314] Allocated by task 2040: [ 210.097323] kasan_kmalloc.part.1+0x51/0xc7 [ 210.097328] __kmalloc+0x17f/0x1b6 [ 210.097335] sk_prot_alloc+0xf2/0x1a3 [ 210.097340] sk_alloc+0x22/0x297 [ 210.097375] sco_sock_alloc.constprop.7+0x23/0x202 [bluetooth] [ 210.097410] sco_connect_cfm+0x2d0/0x566 [bluetooth] [ 210.097443] hci_conn_request_evt.isra.53+0x6d3/0x762 [bluetooth] [ 210.097476] hci_event_packet+0x85e/0x7de2 [bluetooth] [ 210.097507] hci_rx_work+0x154/0x487 [bluetooth] [ 210.097512] process_one_work+0x579/0x9e9 [ 210.097517] worker_thread+0x68f/0x804 [ 210.097523] kthread+0x31c/0x32b [ 210.097529] ret_from_fork+0x35/0x40
[ 210.097533] Freed by task 2040: [ 210.097539] kasan_slab_free+0xb3/0x15e [ 210.097544] kfree+0x103/0x1a9 [ 210.097549] __sk_destruct+0x2c6/0x2d4 [ 210.097584] sco_conn_del.isra.1+0xba/0x10e [bluetooth] [ 210.097617] hci_event_packet+0xff5/0x7de2 [bluetooth] [ 210.097648] hci_rx_work+0x154/0x487 [bluetooth] [ 210.097653] process_one_work+0x579/0x9e9 [ 210.097658] worker_thread+0x68f/0x804 [ 210.097663] kthread+0x31c/0x32b [ 210.097670] ret_from_fork+0x35/0x40
[ 210.097676] The buggy address belongs to the object at ffff880107e170e8 which belongs to the cache kmalloc-1024 of size 1024 [ 210.097681] The buggy address is located 120 bytes inside of 1024-byte region [ffff880107e170e8, ffff880107e174e8) [ 210.097683] The buggy address belongs to the page: [ 210.097689] page:ffffea00041f8400 count:1 mapcount:0 mapping: (null) index:0xffff880107e15b68 compound_mapcount: 0 [ 210.110194] flags: 0x8000000000008100(slab|head) [ 210.115441] raw: 8000000000008100 0000000000000000 ffff880107e15b68 0000000100170016 [ 210.115448] raw: ffffea0004a47620 ffffea0004b48e20 ffff88013b80ed40 0000000000000000 [ 210.115451] page dumped because: kasan: bad access detected
[ 210.115454] Memory state around the buggy address: [ 210.115460] ffff880107e17000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 210.115465] ffff880107e17080: fc fc fc fc fc fc fc fc fc fc fc fc fc fb fb fb [ 210.115469] >ffff880107e17100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 210.115472] ^ [ 210.115477] ffff880107e17180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 210.115481] ffff880107e17200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 210.115483] ==================================================================
And finally when BT_DBG() and ftrace was enabled it showed:
<...>-14979 [001] .... 186.104191: sco_sock_kill <-sco_sock_close
<...>-14979 [001] .... 186.104191: sco_sock_kill <-sco_sock_release
<...>-14979 [001] .... 186.104192: sco_sock_kill: sk ef0497a0 state 9
<...>-14979 [001] .... 186.104193: bt_sock_unlink <-sco_sock_kill
kworker/u9:2-792 [001] .... 186.104246: sco_sock_kill <-sco_conn_del
kworker/u9:2-792 [001] .... 186.104248: sco_sock_kill: sk ef0497a0 state 9
kworker/u9:2-792 [001] .... 186.104249: bt_sock_unlink <-sco_sock_kill
kworker/u9:2-792 [001] .... 186.104250: sco_sock_destruct <-__sk_destruct
kworker/u9:2-792 [001] .... 186.104250: sco_sock_destruct: sk ef0497a0
kworker/u9:2-792 [001] .... 186.104860: hci_conn_del <-hci_event_packet
kworker/u9:2-792 [001] .... 186.104864: hci_conn_del: hci0 hcon ef0484c0 handle 266Only in the failed case, sco_sock_kill() gets called with the same sock pointer two times. Add a check for SOCK_DEAD to avoid continue killing a socket which has already been killed.
--- net/bluetooth/sco.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/bluetooth/sco.c +2 -1
@@ -390,7 +390,8 @@ static void sco_sock_cleanup_listen(stru*/ static void sco_sock_kill (struct sock *sk) { -if (!sock_flag (sk,SOCK_ZAPPED ) || sk->sk_socket) +if (!sock_flag (sk,SOCK_ZAPPED ) || sk->sk_socket || +sock_flag (sk,SOCK_DEAD ))return ;BT_DBG ("sk %p state %d" , sk, sk->sk_state);
Greg Kroah-Hartman
maintainerPATCH 15/56 isdn: Disable IIOCDBGVAR
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
[ Upstream commit 5e22002aa8809e2efab2da95855f73f63e14a36c ]
It was possible to directly leak the kernel address where the isdn_dev structure pointer was stored. This is a kernel ASLR bypass for anyone with access to the ioctl. The code had been present since the beginning of git history, though this shouldn't ever be needed for normal operation, therefore remove it.
--- drivers/isdn/i4l/isdn_common.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/isdn/i4l/isdn_common.c +1 -7
@@ -1655,13 +1655,7 @@ isdn_ioctl(struct file *file, uint cmd, }else return -EINVAL ;case IIOCDBGVAR : -if (arg) { -if (copy_to_user (argp, &dev,sizeof (ulong))) -return -EFAULT ; -return 0 ; - }else -return -EINVAL ; -break ; +return -EINVAL ;default :if ((cmd &IIOCDRVCTL ) ==IIOCDRVCTL ) cmd = ((cmd >> _IOC_NRSHIFT) & _IOC_NRMASK) &ISDN_DRVIOCTL_MASK ;
Greg Kroah-Hartman
maintainerPATCH 16/56 netfilter: ipv6: nf_defrag: reduce struct net memory waste
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 9ce7bc036ae4cfe3393232c86e9e1fea2153c237 ]
It is a waste of memory to use a full "struct netns_sysctl_ipv6" while only one pointer is really used, considering netns_sysctl_ipv6 keeps growing.
Also, since "struct netns_frags" has cache line alignment, it is better to move the frags_hdr pointer outside, otherwise we spend a full cache line for this pointer.
This saves 192 bytes of memory per netns.
--- include/net/net_namespace.h | 1 + include/net/netns/ipv6.h | 1 - net/ipv6/netfilter/nf_conntrack_reasm.c | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-)
include/net/net_namespace.h +1 -0
@@ -112,6 +112,7 @@ struct net {#endif #if IS_ENABLED (CONFIG_NF_DEFRAG_IPV6 )struct netns_nf_frag nf_frag; +struct ctl_table_header *nf_frag_frags_hdr;#endif struct sock *nfnl;struct sock *nfnl_stash;
include/net/netns/ipv6.h +0 -1
@@ -81,7 +81,6 @@ struct netns_ipv6 {#if IS_ENABLED (CONFIG_NF_DEFRAG_IPV6 )struct netns_nf_frag { -struct netns_sysctl_ipv6 sysctl;struct netns_frags frags; };#endif
net/ipv6/netfilter/nf_conntrack_reasm.c +3 -3
@@ -118,7 +118,7 @@ static int nf_ct_frag6_sysctl_register(sif (hdr ==NULL ) goto err_reg; - net->nf_frag.sysctl.frags_hdr = hdr; + net->nf_frag_frags_hdr = hdr;return 0 ; err_reg:
@@ -132,8 +132,8 @@ static void __net_exit nf_ct_frags6_sysc {struct ctl_table *table; - table = net->nf_frag.sysctl.frags_hdr->ctl_table_arg; -unregister_net_sysctl_table (net->nf_frag.sysctl.frags_hdr); + table = net->nf_frag_frags_hdr->ctl_table_arg; +unregister_net_sysctl_table (net->nf_frag_frags_hdr);if (!net_eq (net, &init_net))kfree (table); }
Greg Kroah-Hartman
maintainerPATCH 17/56 selftests: sync: add config fragment for testing sync framework
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fathi Boudra <[email protected]>
[ Upstream commit d6a3e55131fcb1e5ca1753f4b6f297a177b2fc91 ]
Unless the software synchronization objects (CONFIG_SW_SYNC) is enabled, the sync test will be skipped:
TAP version 13
1..0 # Skipped: Sync framework not supported by kernel
Add a config fragment file to be able to run "make kselftest-merge" to enable relevant configuration required in order to run the sync test.
--- tools/testing/selftests/sync/config | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tools/testing/selftests/sync/config
tools/testing/selftests/sync/config new file +4 -0
@@ -0,0 +1,4 @@ +CONFIG_STAGING=y +CONFIG_ANDROID=y +CONFIG_SYNC=y +CONFIG_SW_SYNC=y
Greg Kroah-Hartman
maintainerPATCH 18/56 usb: dwc2: fix isoc split in transfer with no data
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: William Wu <[email protected]>
[ Upstream commit 70c3c8cb83856758025c2a211dd022bc0478922a ]
If isoc split in transfer with no data (the length of DATA0 packet is zero), we can't simply return immediately. Because the DATA0 can be the first transaction or the second transaction for the isoc split in transaction. If the DATA0 packet with no data is in the first transaction, we can return immediately. But if the DATA0 packet with no data is in the second transaction of isoc split in transaction sequence, we need to increase the qtd->isoc_frame_index and giveback urb to device driver if needed, otherwise, the MDATA packet will be lost.
A typical test case is that connect the dwc2 controller with an usb hs Hub (GL852G-12), and plug an usb fs audio device (Plantronics headset) into the downstream port of Hub. Then use the usb mic to record, we can find noise when playback.
In the case, the isoc split in transaction sequence like this:
- SSPLIT IN transaction
- CSPLIT IN transaction
- MDATA packet (176 bytes)
- CSPLIT IN transaction
- DATA0 packet (0 byte)
This patch use both the length of DATA0 and qtd->isoc_split_offset to check if the DATA0 is in the second transaction.
--- drivers/usb/dwc2/hcd_intr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/dwc2/hcd_intr.c +1 -2
@@ -913,9 +913,8 @@ static int dwc2_xfercomp_isoc_split_in(s frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index]; len =dwc2_get_actual_xfer_length (hsotg, chan, chnum, qtd,DWC2_HC_XFER_COMPLETE ,NULL ); -if (!len) { +if (!len && !qtd->isoc_split_offset) { qtd->complete_split =0 ; - qtd->isoc_split_offset =0 ;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 19/56 usb: gadget: composite: fix delayed_status race condition when set_interface
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chunfeng Yun <[email protected]>
[ Upstream commit 980900d6318066b9f8314bfb87329a20fd0d1ca4 ]
It happens when enable debug log, if set_alt() returns USB_GADGET_DELAYED_STATUS and usb_composite_setup_continue() is called before increasing count of @delayed_status, so fix it by using spinlock of @cdev->lock.
--- drivers/usb/gadget/composite.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/gadget/composite.c +3 -0
@@ -1530,6 +1530,8 @@ composite_setup(struct usb_gadget *gadgebreak ;if (w_value && !f->set_alt)break ; + +spin_lock (&cdev->lock); value = f->set_alt (f, w_index, w_value);if (value ==USB_GADGET_DELAYED_STATUS ) { DBG(cdev,
@@ -1539,6 +1541,7 @@ composite_setup(struct usb_gadget *gadgeDBG (cdev,"delayed_status count %d\n" , cdev->delayed_status); } +spin_unlock (&cdev->lock);break ;case USB_REQ_GET_INTERFACE :if (ctrl->bRequestType != (USB_DIR_IN |USB_RECIP_INTERFACE ))
Greg Kroah-Hartman
maintainerPATCH 20/56 arm64: make secondary_start_kernel() notrace
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhizhou Zhang <[email protected]>
[ Upstream commit b154886f7892499d0d3054026e19dfb9a731df61 ]
We can't call function trace hook before setup percpu offset. When entering secondary_start_kernel(), percpu offset has not been initialized. So this lead hotplug malfunction. Here is the flow to reproduce this bug:
echo 0 > /sys/devices/system/cpu/cpu1/online echo function > /sys/kernel/debug/tracing/current_tracer echo 1 > /sys/kernel/debug/tracing/tracing_on echo 1 > /sys/devices/system/cpu/cpu1/online
--- arch/arm64/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/smp.c +1 -1
@@ -130,7 +130,7 @@ static void smp_store_cpu_info(unsigned* This is the secondary CPU boot entry. We're using this CPUs * idle thread stack, but a set of temporary page tables. */ -asmlinkage void secondary_start_kernel(void) +asmlinkage notrace void secondary_start_kernel(void) {struct mm_struct *mm = &init_mm;unsigned int cpu =smp_processor_id ();
Greg Kroah-Hartman
maintainerPATCH 21/56 enic: initialize enic->rfs_h.lock in enic_probe
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Govindarajulu Varadarajan <[email protected]>
[ Upstream commit 3256d29fc7aecdf99feb1cb9475ed2252769a8a7 ]
lockdep spotted that we are using rfs_h.lock in enic_get_rxnfc() without initializing. rfs_h.lock is initialized in enic_open(). But ethtool_ops can be called when interface is down.
Move enic_rfs_flw_tbl_init to enic_probe.
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 18 PID: 1189 Comm: ethtool Not tainted 4.17.0-rc7-devel+ #27 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-20171110_100015-anatol 04/01/2014 Call Trace: dump_stack+0x85/0xc0 register_lock_class+0x550/0x560 ? __handle_mm_fault+0xa8b/0x1100 __lock_acquire+0x81/0x670 lock_acquire+0xb9/0x1e0 ? enic_get_rxnfc+0x139/0x2b0 [enic] _raw_spin_lock_bh+0x38/0x80 ? enic_get_rxnfc+0x139/0x2b0 [enic] enic_get_rxnfc+0x139/0x2b0 [enic] ethtool_get_rxnfc+0x8d/0x1c0 dev_ethtool+0x16c8/0x2400 ? __mutex_lock+0x64d/0xa00 ? dev_load+0x6a/0x150 dev_ioctl+0x253/0x4b0 sock_do_ioctl+0x9a/0x130 sock_ioctl+0x1af/0x350 do_vfs_ioctl+0x8e/0x670 ? syscall_trace_enter+0x1e2/0x380 ksys_ioctl+0x60/0x90 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x5a/0x170 entry_SYSCALL_64_after_hwframe+0x49/0xbe
--- drivers/net/ethernet/cisco/enic/enic_clsf.c | 3 +-- drivers/net/ethernet/cisco/enic/enic_main.c | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/cisco/enic/enic_clsf.c +1 -2
@@ -78,7 +78,6 @@ void enic_rfs_flw_tbl_init(struct enic * enic->rfs_h.max = enic->config.num_arfs; enic->rfs_h.free = enic->rfs_h.max; enic->rfs_h.toclean =0 ; -enic_rfs_timer_start (enic); }void enic_rfs_flw_tbl_free (struct enic *enic)
@@ -87,7 +86,6 @@ void enic_rfs_flw_tbl_free(struct enic *enic_rfs_timer_stop (enic);spin_lock_bh (&enic->rfs_h.lock); - enic->rfs_h.free =0 ;for (i =0 ; i < (1 <<ENIC_RFS_FLW_BITSHIFT ); i++) {struct hlist_head *hhead;struct hlist_node *tmp;
@@ -98,6 +96,7 @@ void enic_rfs_flw_tbl_free(struct enic *enic_delfltr (enic, n->fltr_id);hlist_del (&n->node);kfree (n); + enic->rfs_h.free++; } }spin_unlock_bh (&enic->rfs_h.lock);
drivers/net/ethernet/cisco/enic/enic_main.c +2 -1
@@ -1643,7 +1643,7 @@ static int enic_open(struct net_device *vnic_intr_unmask (&enic->intr[i]);enic_notify_timer_start (enic); -enic_rfs_flw_tbl_init (enic); +enic_rfs_timer_start (enic);return 0 ;
@@ -2508,6 +2508,7 @@ static int enic_probe(struct pci_dev *pd enic->notify_timer.function = enic_notify_timer; enic->notify_timer.data = (unsigned long )enic; +enic_rfs_flw_tbl_init (enic);enic_set_rx_coal_setting (enic);INIT_WORK (&enic->reset, enic_reset);INIT_WORK (&enic->change_mtu_work, enic_change_mtu_work);
Greg Kroah-Hartman
maintainerPATCH 22/56 net: hamradio: use eth_broadcast_addr
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Agner <[email protected]>
[ Upstream commit 4e8439aa34802deab11cee68b0ecb18f887fb153 ]
The array bpq_eth_addr is only used to get the size of an address, whereas the bcast_addr is used to set the broadcast address. This leads to a warning when using clang:drivers/net/hamradio/bpqether.c:94:13: warning: variable 'bpq_eth_addr' is not
needed and will not be emitted [-Wunneeded-internal-declaration]
static char bpq_eth_addr[6];
^Remove both variables and use the common eth_broadcast_addr to set the broadcast address.
--- drivers/net/hamradio/bpqether.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/hamradio/bpqether.c +2 -6
@@ -90,10 +90,6 @@ static const char banner[] __initconst = KERN_INFO \"AX.25: bpqether driver version 004\n" ; -static char bcast_addr[6 ]={0xFF ,0xFF ,0xFF ,0xFF ,0xFF ,0xFF }; - -static char bpq_eth_addr[6 ]; -static int bpq_rcv (struct sk_buff *,struct net_device *,struct packet_type *,struct net_device *);static int bpq_device_event (struct notifier_block *,unsigned long ,void *);
@@ -512,8 +508,8 @@ static int bpq_new_device(struct net_dev bpq->ethdev = edev; bpq->axdev = ndev; -memcpy (bpq->dest_addr, bcast_addr,sizeof (bpq_eth_addr)); -memcpy (bpq->acpt_addr, bcast_addr,sizeof (bpq_eth_addr)); +eth_broadcast_addr (bpq->dest_addr); +eth_broadcast_addr (bpq->acpt_addr); err =register_netdevice (ndev);if (err)
Greg Kroah-Hartman
maintainerPATCH 23/56 net: propagate dev_get_valid_name return code
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <[email protected]>
[ Upstream commit 7892bd081045222b9e4027fec279a28d6fe7aa66 ]
if dev_get_valid_name failed, propagate its return code
and remove the setting err to ENODEV, it will be set to 0 again before dev_change_net_namespace exits.
--- net/core/dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/dev.c +2 -2
@@ -6911,7 +6911,8 @@ int dev_change_net_namespace(struct net_/* We get here if we can't use the current device name */ if (!pat) goto out; -if (dev_get_valid_name (net, dev, pat) <0 ) + err =dev_get_valid_name (net, dev, pat); +if (err <0 ) goto out; }
@@ -6923,7 +6924,6 @@ int dev_change_net_namespace(struct net_dev_close (dev);/* And unlink it from device chain */ - err = -ENODEV ;unlist_netdevice (dev);synchronize_net ();
Greg Kroah-Hartman
maintainerPATCH 24/56 net: davinci_emac: match the mdio device against its compatible if possible
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <[email protected]>
[ Upstream commit ea0820bb771175c7d4192fc6f5b5c56b3c6d5239 ]
Device tree based systems without of_dev_auxdata will have the mdio device named differently than "davinci_mdio(.0)". In this case use the device's parent's compatible string for matching
--- drivers/net/ethernet/ti/davinci_emac.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/ti/davinci_emac.c +4 -0
@@ -1514,6 +1514,10 @@ static int emac_devioctl(struct net_devistatic int match_first_device (struct device *dev,void *data) { +if (dev->parent && dev->parent->of_node) +return of_device_is_compatible (dev->parent->of_node, +"ti,davinci_mdio" ); +return !strncmp (dev_name (dev),"davinci_mdio" ,12 ); }
Greg Kroah-Hartman
maintainerPATCH 25/56 locking/lockdep: Do not record IRQ state within lockdep code
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (VMware)" <[email protected]>
[ Upstream commit fcc784be837714a9173b372ff9fb9b514590dad9 ]
While debugging where things were going wrong with mapping enabling/disabling interrupts with the lockdep state and actual real enabling and disabling interrupts, I had to silent the IRQ disabling/enabling in debug_check_no_locks_freed() because it was always showing up as it was called before the splat was.
Use raw_local_irq_save/restore() for not only debug_check_no_locks_freed() but for all internal lockdep functions, as they hide useful information about where interrupts were used incorrectly last.
--- kernel/locking/lockdep.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
kernel/locking/lockdep.c +6 -6
@@ -1253,11 +1253,11 @@ unsigned long lockdep_count_forward_deps this.parent =NULL ; this.class = class; -local_irq_save (flags); +raw_local_irq_save (flags);arch_spin_lock (&lockdep_lock); ret =__lockdep_count_forward_deps (&this);arch_spin_unlock (&lockdep_lock); -local_irq_restore (flags); +raw_local_irq_restore (flags);return ret; }
@@ -1280,11 +1280,11 @@ unsigned long lockdep_count_backward_dep this.parent =NULL ; this.class = class; -local_irq_save (flags); +raw_local_irq_save (flags);arch_spin_lock (&lockdep_lock); ret =__lockdep_count_backward_deps (&this);arch_spin_unlock (&lockdep_lock); -local_irq_restore (flags); +raw_local_irq_restore (flags);return ret; }
@@ -4083,7 +4083,7 @@ void debug_check_no_locks_freed(const voif (unlikely (!debug_locks))return ; -local_irq_save (flags); +raw_local_irq_save (flags);for (i =0 ; i < curr->lockdep_depth; i++) { hlock = curr->held_locks + i;
@@ -4094,7 +4094,7 @@ void debug_check_no_locks_freed(const voprint_freed_lock_bug (curr, mem_from, mem_from + mem_len, hlock);break ; } -local_irq_restore (flags); +raw_local_irq_restore (flags); }EXPORT_SYMBOL_GPL (debug_check_no_locks_freed);
Greg Kroah-Hartman
maintainerPATCH 26/56 ipv6: mcast: fix unsolicited report interval after receiving querys
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangbin Liu <[email protected]>
[ Upstream commit 6c6da92808442908287fae8ebb0ca041a52469f4 ]
After recieving MLD querys, we update idev->mc_maxdelay with max_delay from query header. This make the later unsolicited reports have the same interval with mc_maxdelay, which means we may send unsolicited reports with long interval time instead of default configured interval time.
Also as we will not call ipv6_mc_reset() after device up. This issue will be there even after leave the group and join other groups.
--- net/ipv6/mcast.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/ipv6/mcast.c +6 -3
@@ -2062,7 +2062,8 @@ void ipv6_mc_dad_complete(struct inet6_dmld_send_initial_cr (idev); idev->mc_dad_count--;if (idev->mc_dad_count) -mld_dad_start_timer (idev, idev->mc_maxdelay); +mld_dad_start_timer (idev, +unsolicited_report_interval (idev)); } }
@@ -2074,7 +2075,8 @@ static void mld_dad_timer_expire(unsigneif (idev->mc_dad_count) { idev->mc_dad_count--;if (idev->mc_dad_count) -mld_dad_start_timer (idev, idev->mc_maxdelay); +mld_dad_start_timer (idev, +unsolicited_report_interval (idev)); }in6_dev_put (idev); }
@@ -2432,7 +2434,8 @@ static void mld_ifc_timer_expire(unsigneif (idev->mc_ifc_count) { idev->mc_ifc_count--;if (idev->mc_ifc_count) -mld_ifc_start_timer (idev, idev->mc_maxdelay); +mld_ifc_start_timer (idev, +unsolicited_report_interval (idev)); }in6_dev_put (idev); }
Greg Kroah-Hartman
maintainerPATCH 27/56 Smack: Mark inode instant in smack_task_to_inode
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Casey Schaufler <[email protected]>
[ Upstream commit 7b4e88434c4e7982fb053c49657e1c8bbb8692d9 ]
Smack: Mark inode instant in smack_task_to_inode
/proc clean-up in commit 1bbc55131e59bd099fdc568d3aa0b42634dbd188 resulted in smack_task_to_inode() being called before smack_d_instantiate. This resulted in the smk_inode value being ignored, even while present for files in /proc/self. Marking the inode as instant here fixes that.
--- security/smack/smack_lsm.c | 1 + 1 file changed, 1 insertion(+)
security/smack/smack_lsm.c +1 -0
@@ -2037,6 +2037,7 @@ static void smack_task_to_inode(struct tstruct smack_known *skp =smk_of_task_struct (p); isp->smk_inode = skp; + isp->smk_flags |=SMK_INODE_INSTANT ; }/*
Greg Kroah-Hartman
maintainerPATCH 28/56 cxgb4: when disabling dcb set txq dcb priority to 0
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ganesh Goudar <[email protected]>
[ Upstream commit 5ce36338a30f9814fc4824f9fe6c20cd83d872c7 ]
When we are disabling DCB, store "0" in txq->dcb_prio since that's used for future TX Work Request "OVLAN_IDX" values. Setting non zero priority upon disabling DCB would halt the traffic.
--- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1 -1
@@ -529,7 +529,7 @@ static void dcb_tx_queue_prio_enable(str"Can't %s DCB Priority on port %d, TX Queue %d: err=%d\n" , enable ? "set" : "unset", pi->port_id, i, -err); else - txq->dcb_prio = value; + txq->dcb_prio = enable ? value : 0; } }#endif /* CONFIG_CHELSIO_T4_DCB */
Greg Kroah-Hartman
maintainerPATCH 29/56 brcmfmac: stop watchdog before detach and free everything
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Trimarchi <[email protected]>
[ Upstream commit 373c83a801f15b1e3d02d855fad89112bd4ccbe0 ]
Using built-in in kernel image without a firmware in filesystem or in the kernel image can lead to a kernel NULL pointer deference. Watchdog need to be stopped in brcmf_sdio_remove
The system is going down NOW!
[ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual address 000002f8 Sent SIGTERM to all processes [ 1348.121412] Mem abort info: [ 1348.126962] ESR = 0x96000004 [ 1348.130023] Exception class = DABT (current EL), IL = 32 bits [ 1348.135948] SET = 0, FnV = 0 [ 1348.138997] EA = 0, S1PTW = 0 [ 1348.142154] Data abort info: [ 1348.145045] ISV = 0, ISS = 0x00000004 [ 1348.148884] CM = 0, WnR = 0 [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____) [ 1348.158475] [00000000000002f8] pgd=0000000000000000 [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 1348.168927] Modules linked in: ipv6 [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted 4.17.0-rc5-next-20180517 #18 [ 1348.180757] Hardware name: Amarula A64-Relic (DT) [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO) [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20 [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290 [ 1348.200253] sp : ffff00000b85be30 [ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000 [ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638 [ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800 [ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660 [ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00 [ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001 [ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8 [ 1348.240711] x15: 0000000000000000 x14: 0000000000000400 [ 1348.246018] x13: 0000000000000400 x12: 0000000000000001 [ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10 [ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870 [ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55 [ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000 [ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100 [ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000
--- drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +7 -0
@@ -4201,6 +4201,13 @@ void brcmf_sdio_remove(struct brcmf_sdiobrcmf_dbg (TRACE ,"Enter\n" );if (bus) { +/* Stop watchdog task */ +if (bus->watchdog_tsk) { +send_sig (SIGTERM , bus->watchdog_tsk,1 ); +kthread_stop (bus->watchdog_tsk); + bus->watchdog_tsk =NULL ; + } +/* De-register interrupt handler */ brcmf_sdiod_intr_unregister (bus->sdiodev);
Greg Kroah-Hartman
maintainerPATCH 30/56 ARM: dts: am437x: make edt-ft5x06 a wakeup source
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Mack <[email protected]>
[ Upstream commit 49a6ec5b807ea4ad7ebe1f58080ebb8497cb2d2c ]
The touchscreen driver no longer configures the device as wakeup source by default. A "wakeup-source" property is needed.
--- arch/arm/boot/dts/am437x-sk-evm.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/am437x-sk-evm.dts +2 -0
@@ -415,6 +415,8 @@ touchscreen-size-x = <480>; touchscreen-size-y = <272>; + + wakeup-source; }; tlv320aic3106: tlv320aic3106@1b {
Greg Kroah-Hartman
maintainerPATCH 31/56 perf report powerpc: Fix crash if callchain is empty
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sandipan Das <[email protected]>
[ Upstream commit 143c99f6ac6812d23254e80844d6e34be897d3e1 ]
For some cases, the callchain provided by the kernel may be empty. So, the callchain ip filtering code will cause a crash if we do not check whether the struct ip_callchain pointer is NULL before accessing any members.
This can be observed on a powerpc64le system running Fedora 27 as shown below.
# perf record -b -e cycles:u ls
Before:
# perf report --branch-history
perf: Segmentation fault
-------- backtrace --------
perf[0x1027615c] linux-vdso64.so.1(__kernel_sigtramp_rt64+0x0)[0x7fff856304d8] perf(arch_skip_callchain_idx+0x44)[0x10257c58] perf[0x1017f2e4] perf(thread__resolve_callchain+0x124)[0x1017ff5c] perf(sample__resolve_callchain+0xf0)[0x10172788]
...
After:
# perf report --branch-history
Samples: 25 of event 'cycles:u', Event count (approx.): 2306870
Overhead Source:Line Symbol Shared Object + 11.60% _init+35736 [.] _init ls + 9.84% strcoll_l.c:137 [.] __strcoll_l libc-2.26.so + 9.16% memcpy.S:175 [.] __memcpy_power7 libc-2.26.so + 9.01% gconv_charset.h:54 [.] _nl_find_locale libc-2.26.so + 8.87% dl-addr.c:52 [.] _dl_addr libc-2.26.so + 8.83% _init+236 [.] _init ls
...
--- tools/perf/arch/powerpc/util/skip-callchain-idx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/arch/powerpc/util/skip-callchain-idx.c +1 -1
@@ -230,7 +230,7 @@ int arch_skip_callchain_idx(struct machiu64 ip;u64 skip_slot =-1 ; -if (chain->nr <3 ) +if (!chain || chain->nr <3 )return skip_slot; ip = chain->ips[2 ];
Greg Kroah-Hartman
maintainerPATCH 32/56 ARM: dts: da850: Fix interrups property for gpio
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keerthy <[email protected]>
[ Upstream commit 3eb1b955cd7ed1e621ace856710006c2a8a7f231 ]
The intc #interrupt-cells is equal to 1. Currently gpio node has 2 cells per IRQ which is wrong. Remove the additional cell for each of the interrupts.
--- arch/arm/boot/dts/da850.dtsi | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
arch/arm/boot/dts/da850.dtsi +1 -5
@@ -267,11 +267,7 @@ compatible = "ti,dm6441-gpio"; gpio-controller; reg = <0x226000 0x1000>; - interrupts = <42 IRQ_TYPE_EDGE_BOTH - 43 IRQ_TYPE_EDGE_BOTH 44 IRQ_TYPE_EDGE_BOTH - 45 IRQ_TYPE_EDGE_BOTH 46 IRQ_TYPE_EDGE_BOTH - 47 IRQ_TYPE_EDGE_BOTH 48 IRQ_TYPE_EDGE_BOTH - 49 IRQ_TYPE_EDGE_BOTH 50 IRQ_TYPE_EDGE_BOTH>; + interrupts = <42 43 44 45 46 47 48 49 50>; ti,ngpio = <144>; ti,davinci-gpio-unbanked = <0>; status = "disabled";
Greg Kroah-Hartman
maintainerPATCH 33/56 dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate()
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit c4c2b7644cc9a41f17a8cc8904efe3f66ae4c7ed ]
The d->chans[] array has d->dma_requests elements so the > should be
Quoted 1 line
= here.
--- drivers/dma/k3dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/k3dma.c +1 -1
@@ -652,7 +652,7 @@ static struct dma_chan *k3_of_dma_simplestruct k3_dma_dev *d = ofdma->of_dma_data;unsigned int request = dma_spec->args[0 ]; -if (request > d->dma_requests) +if (request >= d->dma_requests)return NULL ;return dma_get_slave_channel (&(d->chans[request].vc.chan));
Greg Kroah-Hartman
maintainerPATCH 34/56 md/raid10: fix that replacement cannot complete recovery after reassemble
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: BingJing Chang <[email protected]>
[ Upstream commit bda3153998f3eb2cafa4a6311971143628eacdbc ]
During assemble, the spare marked for replacement is not checked. conf->fullsync cannot be updated to be 1. As a result, recovery will treat it as a clean array. All recovering sectors are skipped. Original device is replaced with the not-recovered spare.
mdadm -C /dev/md0 -l10 -n4 -pn2 /dev/loop[0123]
mdadm /dev/md0 -a /dev/loop4
mdadm /dev/md0 --replace /dev/loop0
mdadm -S /dev/md0 # stop array during recovery
mdadm -A /dev/md0 /dev/loop[01234]
After reassemble, you can see recovery go on, but it completes immediately. In fact, recovery is not actually processed.
To solve this problem, we just add the missing logics for replacment spares. (In raid1.c or raid5.c, they have already been checked.)
--- drivers/md/raid10.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/md/raid10.c +7 -0
@@ -3770,6 +3770,13 @@ static int run(struct mddev *mddev) disk->rdev->saved_raid_disk < 0) conf->fullsync =1 ; } + +if (disk->replacement && + !test_bit (In_sync, &disk->replacement->flags) && + disk->replacement->saved_raid_disk <0 ) { + conf->fullsync =1 ; + } + disk->recovery_disabled = mddev->recovery_disabled -1 ; }
Greg Kroah-Hartman
maintainerPATCH 35/56 drm/exynos: gsc: Fix support for NV16/61, YUV420/YVU420 and YUV422 modes
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Szyprowski <[email protected]>
[ Upstream commit dd209ef809080ced903e7747ee3ef640c923a1d2 ]
Fix following issues related to planar YUV pixel format configuration:
- NV16/61 modes were incorrectly programmed as NV12/21,
- YVU420 was programmed as YUV420 on source,
- YVU420 and YUV422 were programmed as YUV420 on output.
--- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 29 ++++++++++++++++++++--------- drivers/gpu/drm/exynos/regs-gsc.h | 1 + 2 files changed, 21 insertions(+), 9 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_gsc.c +20 -9
@@ -526,21 +526,25 @@ static int gsc_src_set_fmt(struct device GSC_IN_CHROMA_ORDER_CRCB);break ;case DRM_FORMAT_NV21 : + cfg |= (GSC_IN_CHROMA_ORDER_CRCB |GSC_IN_YUV420_2P ); +break ;case DRM_FORMAT_NV61 : - cfg |= (GSC_IN_CHROMA_ORDER_CRCB | -GSC_IN_YUV420_2P ); + cfg |= (GSC_IN_CHROMA_ORDER_CRCB |GSC_IN_YUV422_2P );break ;case DRM_FORMAT_YUV422 : cfg |=GSC_IN_YUV422_3P ;break ;case DRM_FORMAT_YUV420 : + cfg |= (GSC_IN_CHROMA_ORDER_CBCR |GSC_IN_YUV420_3P ); +break ;case DRM_FORMAT_YVU420 : - cfg |=GSC_IN_YUV420_3P ; + cfg |= (GSC_IN_CHROMA_ORDER_CRCB |GSC_IN_YUV420_3P );break ;case DRM_FORMAT_NV12 : + cfg |= (GSC_IN_CHROMA_ORDER_CBCR |GSC_IN_YUV420_2P ); +break ;case DRM_FORMAT_NV16 : - cfg |= (GSC_IN_CHROMA_ORDER_CBCR | -GSC_IN_YUV420_2P ); + cfg |= (GSC_IN_CHROMA_ORDER_CBCR |GSC_IN_YUV422_2P );break ;case DRM_FORMAT_NV12MT : cfg |= (GSC_IN_TILE_C_16x8 |GSC_IN_TILE_MODE );
@@ -796,18 +800,25 @@ static int gsc_dst_set_fmt(struct device GSC_OUT_CHROMA_ORDER_CRCB);break ;case DRM_FORMAT_NV21 : -case DRM_FORMAT_NV61 : cfg |= (GSC_OUT_CHROMA_ORDER_CRCB |GSC_OUT_YUV420_2P );break ; +case DRM_FORMAT_NV61 : + cfg |= (GSC_OUT_CHROMA_ORDER_CRCB |GSC_OUT_YUV422_2P ); +break ;case DRM_FORMAT_YUV422 : + cfg |=GSC_OUT_YUV422_3P ; +break ;case DRM_FORMAT_YUV420 : + cfg |= (GSC_OUT_CHROMA_ORDER_CBCR |GSC_OUT_YUV420_3P ); +break ;case DRM_FORMAT_YVU420 : - cfg |=GSC_OUT_YUV420_3P ; + cfg |= (GSC_OUT_CHROMA_ORDER_CRCB |GSC_OUT_YUV420_3P );break ;case DRM_FORMAT_NV12 : + cfg |= (GSC_OUT_CHROMA_ORDER_CBCR |GSC_OUT_YUV420_2P ); +break ;case DRM_FORMAT_NV16 : - cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | -GSC_OUT_YUV420_2P ); + cfg |= (GSC_OUT_CHROMA_ORDER_CBCR |GSC_OUT_YUV422_2P );break ;case DRM_FORMAT_NV12MT : cfg |= (GSC_OUT_TILE_C_16x8 |GSC_OUT_TILE_MODE );
drivers/gpu/drm/exynos/regs-gsc.h +1 -0
@@ -138,6 +138,7 @@#define GSC_OUT_YUV420_3P (3 << 4)#define GSC_OUT_YUV422_1P (4 << 4)#define GSC_OUT_YUV422_2P (5 << 4) +#define GSC_OUT_YUV422_3P (6 << 4)#define GSC_OUT_YUV444 (7 << 4)#define GSC_OUT_TILE_TYPE_MASK (1 << 2)#define GSC_OUT_TILE_C_16x8 (0 << 2)
Greg Kroah-Hartman
maintainerPATCH 36/56 bnx2x: Fix receiving tx-timeout in error or recovery state.
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudarsana Reddy Kalluru <[email protected]>
[ Upstream commit 484c016d9392786ce5c74017c206c706f29f823d ]
Driver performs the internal reload when it receives tx-timeout event from the OS. Internal reload might fail in some scenarios e.g., fatal HW issues. In such cases OS still see the link, which would result in undesirable functionalities such as re-generation of tx-timeouts.
The patch addresses this issue by indicating the link-down to OS when tx-timeout is detected, and keeping the link in down state till the internal reload is successful.
Please consider applying it to 'net' branch.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 ++++++ drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 ++++++ 3 files changed, 13 insertions(+)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +1 -0
@@ -1613,6 +1613,7 @@ struct bnx2x {struct link_vars link_vars;u32 link_cnt;struct bnx2x_link_report_data last_reported_link; +bool force_link_down;struct mdio_if_info mdio;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +6 -0
@@ -1257,6 +1257,11 @@ void __bnx2x_link_report(struct bnx2x *b {struct bnx2x_link_report_data cur_data; +if (bp->force_link_down) { + bp->link_vars.link_up =0 ; +return ; + } +/* reread mf_cfg */ if (IS_PF (bp) && !CHIP_IS_E1 (bp))bnx2x_read_mf_cfg (bp);
@@ -2799,6 +2804,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int bp->pending_max =0 ; } + bp->force_link_down = false;if (bp->port.pmf) { rc =bnx2x_initial_phy_init (bp, load_mode);if (rc)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +6 -0
@@ -10036,6 +10036,12 @@ static void bnx2x_sp_rtnl_task(struct wo bp->sp_rtnl_state =0 ;smp_mb (); +/* Immediately indicate link as down */ + bp->link_vars.link_up =0 ; + bp->force_link_down = true; +netif_carrier_off (bp->dev); +BNX2X_ERR ("Indicating link is down due to Tx-timeout\n" ); +bnx2x_nic_unload (bp,UNLOAD_NORMAL , true);bnx2x_nic_load (bp,LOAD_NORMAL );
Greg Kroah-Hartman
maintainerPATCH 38/56 ARM: imx_v4_v5_defconfig: Select ULPI support
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Estevam <[email protected]>
[ Upstream commit 2ceb2780b790b74bc408a949f6aedbad8afa693e ]
Select CONFIG_USB_CHIPIDEA_ULPI and CONFIG_USB_ULPI_BUS so that USB ULPI can be functional on some boards like that use ULPI interface.
--- arch/arm/configs/imx_v4_v5_defconfig | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/configs/imx_v4_v5_defconfig +2 -0
@@ -146,9 +146,11 @@ CONFIG_USB_STORAGE=y CONFIG_USB_CHIPIDEA=y CONFIG_USB_CHIPIDEA_UDC=y CONFIG_USB_CHIPIDEA_HOST=y +CONFIG_USB_CHIPIDEA_ULPI=y CONFIG_NOP_USB_XCEIV=y CONFIG_USB_GADGET=y CONFIG_USB_ETH=m +CONFIG_USB_ULPI_BUS=y CONFIG_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_PLTFM=y
Greg Kroah-Hartman
maintainerPATCH 40/56 smsc75xx: Add workaround for gigabit link up hardware errata.
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuiko Oshino <[email protected]>
[ Upstream commit d461e3da905332189aad546b2ad9adbe6071c7cc ]
In certain conditions, the device may not be able to link in gigabit mode. This software workaround ensures that the device will not enter the failure state.
--- drivers/net/usb/smsc75xx.c | 62 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+)
drivers/net/usb/smsc75xx.c +62 -0
@@ -81,6 +81,9 @@ static bool turbo_mode = true;module_param (turbo_mode, bool,0644 );MODULE_PARM_DESC (turbo_mode,"Enable multiple frames per Rx transaction" ); +static int smsc75xx_link_ok_nopm (struct usbnet *dev); +static int smsc75xx_phy_gig_workaround (struct usbnet *dev); +static int __must_check __smsc75xx_read_reg (struct usbnet *dev,u32 index,u32 *data,int in_pm) {
@@ -840,6 +843,9 @@ static int smsc75xx_phy_initialize(strucreturn -EIO ; } +/* phy workaround for gig link */ +smsc75xx_phy_gig_workaround (dev); +smsc75xx_mdio_write (dev->net, dev->mii.phy_id,MII_ADVERTISE ,ADVERTISE_ALL |ADVERTISE_CSMA |ADVERTISE_PAUSE_CAP |ADVERTISE_PAUSE_ASYM );
@@ -978,6 +984,62 @@ static int smsc75xx_wait_ready(struct usreturn -EIO ; } +static int smsc75xx_phy_gig_workaround (struct usbnet *dev) +{ +struct mii_if_info *mii = &dev->mii; +int ret =0 , timeout =0 ; +u32 buf, link_up =0 ; + +/* Set the phy in Gig loopback */ +smsc75xx_mdio_write (dev->net, mii->phy_id,MII_BMCR ,0x4040 ); + +/* Wait for the link up */ +do { + link_up =smsc75xx_link_ok_nopm (dev); +usleep_range (10000 ,20000 ); + timeout++; + }while ((!link_up) && (timeout <1000 )); + +if (timeout >=1000 ) { +netdev_warn (dev->net,"Timeout waiting for PHY link up\n" ); +return -EIO ; + } + +/* phy reset */ + ret =smsc75xx_read_reg (dev,PMT_CTL , &buf); +if (ret <0 ) { +netdev_warn (dev->net,"Failed to read PMT_CTL: %d\n" , ret); +return ret; + } + + buf |=PMT_CTL_PHY_RST ; + + ret =smsc75xx_write_reg (dev,PMT_CTL , buf); +if (ret <0 ) { +netdev_warn (dev->net,"Failed to write PMT_CTL: %d\n" , ret); +return ret; + } + + timeout =0 ; +do { +usleep_range (10000 ,20000 ); + ret =smsc75xx_read_reg (dev,PMT_CTL , &buf); +if (ret <0 ) { +netdev_warn (dev->net,"Failed to read PMT_CTL: %d\n" , + ret); +return ret; + } + timeout++; + }while ((buf &PMT_CTL_PHY_RST ) && (timeout <100 )); + +if (timeout >=100 ) { +netdev_warn (dev->net,"timeout waiting for PHY Reset\n" ); +return -EIO ; + } + +return 0 ; +} +static int smsc75xx_reset (struct usbnet *dev) {struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0 ]);
Greg Kroah-Hartman
maintainerPATCH 41/56 netfilter: x_tables: set module owner for icmp(6) matches
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit d376bef9c29b3c65aeee4e785fffcd97ef0a9a81 ]
nft_compat relies on xt_request_find_match to increment refcount of the module that provides the match/target.
The (builtin) icmp matches did't set the module owner so it was possible to rmmod ip(6)tables while icmp extensions were still in use.
--- net/ipv4/netfilter/ip_tables.c | 1 + net/ipv6/netfilter/ip6_tables.c | 1 + 2 files changed, 2 insertions(+)
net/ipv4/netfilter/ip_tables.c +1 -0
@@ -2069,6 +2069,7 @@ static struct xt_match ipt_builtin_mt[] .checkentry = icmp_checkentry, .proto = IPPROTO_ICMP, .family = NFPROTO_IPV4, + .me = THIS_MODULE, }, };
net/ipv6/netfilter/ip6_tables.c +1 -0
@@ -2071,6 +2071,7 @@ static struct xt_match ip6t_builtin_mt[] .checkentry = icmp6_checkentry, .proto = IPPROTO_ICMPV6, .family = NFPROTO_IPV6, + .me = THIS_MODULE, }, };
Greg Kroah-Hartman
maintainerPATCH 42/56 ARM: pxa: irq: fix handling of ICMR registers in suspend/resume
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Mack <[email protected]>
[ Upstream commit 0c1049dcb4ceec640d8bd797335bcbebdcab44d2 ]
PXA3xx platforms have 56 interrupts that are stored in two ICMR registers. The code in pxa_irq_suspend() and pxa_irq_resume() however does a simple division by 32 which only leads to one register being saved at suspend and restored at resume time. The NAND interrupt setting, for instance, is lost.
Fix this by using DIV_ROUND_UP() instead.
--- arch/arm/mach-pxa/irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-pxa/irq.c +2 -2
@@ -160,7 +160,7 @@ static int pxa_irq_suspend(void) {int i; -for (i =0 ; i < pxa_internal_irq_nr /32 ; i++) { +for (i =0 ; i <DIV_ROUND_UP (pxa_internal_irq_nr,32 ); i++) {void __iomem *base =irq_base (i); saved_icmr[i] =__raw_readl (base +ICMR );
@@ -179,7 +179,7 @@ static void pxa_irq_resume(void) {int i; -for (i =0 ; i < pxa_internal_irq_nr /32 ; i++) { +for (i =0 ; i <DIV_ROUND_UP (pxa_internal_irq_nr,32 ); i++) {void __iomem *base =irq_base (i);__raw_writel (saved_icmr[i], base +ICMR );
Greg Kroah-Hartman
maintainerPATCH 43/56 drm/armada: fix colorkey mode property
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell King <[email protected]>
[ Upstream commit d378859a667edc99e3473704847698cae97ca2b1 ]
The colorkey mode property was not correctly disabling the colorkeying when "disabled" mode was selected. Arrange for this to work as one would expect.
--- drivers/gpu/drm/armada/armada_hw.h | 1 + drivers/gpu/drm/armada/armada_overlay.c | 30 ++++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-)
drivers/gpu/drm/armada/armada_hw.h +1 -0
@@ -160,6 +160,7 @@ enum {CFG_ALPHAM_GRA =0x1 <<16 ,CFG_ALPHAM_CFG =0x2 <<16 ,CFG_ALPHA_MASK =0xff <<8 , +#define CFG_ALPHA(x) ((x) << 8) CFG_PIXCMD_MASK = 0xff, };
drivers/gpu/drm/armada/armada_overlay.c +22 -8
@@ -26,6 +26,7 @@ struct armada_plane_properties {uint16_t contrast;uint16_t saturation;uint32_t colorkey_mode; +uint32_t colorkey_enable; };struct armada_plane {
@@ -62,11 +63,13 @@ armada_ovl_update_attr(struct armada_plawritel_relaxed (0x00002000 , dcrtc->base +LCD_SPU_CBSH_HUE );spin_lock_irq (&dcrtc->irq_lock); -armada_updatel (prop->colorkey_mode |CFG_ALPHAM_GRA , -CFG_CKMODE_MASK |CFG_ALPHAM_MASK |CFG_ALPHA_MASK , - dcrtc->base +LCD_SPU_DMA_CTRL1 ); - -armada_updatel (ADV_GRACOLORKEY ,0 , dcrtc->base +LCD_SPU_ADV_REG ); +armada_updatel (prop->colorkey_mode, +CFG_CKMODE_MASK |CFG_ALPHAM_MASK |CFG_ALPHA_MASK , + dcrtc->base +LCD_SPU_DMA_CTRL1 ); +if (dcrtc->variant->has_spu_adv_reg) +armada_updatel (prop->colorkey_enable, +ADV_GRACOLORKEY |ADV_VIDCOLORKEY , + dcrtc->base +LCD_SPU_ADV_REG );spin_unlock_irq (&dcrtc->irq_lock); }
@@ -329,8 +332,17 @@ static int armada_plane_set_property(str dplane->prop.colorkey_vb |=K2B (val); update_attr = true; }else if (property == priv->colorkey_mode_prop) { - dplane->prop.colorkey_mode &= ~CFG_CKMODE_MASK ; - dplane->prop.colorkey_mode |=CFG_CKMODE (val); +if (val ==CKMODE_DISABLE ) { + dplane->prop.colorkey_mode = +CFG_CKMODE (CKMODE_DISABLE ) | +CFG_ALPHAM_CFG |CFG_ALPHA (255 ); + dplane->prop.colorkey_enable =0 ; + }else { + dplane->prop.colorkey_mode = +CFG_CKMODE (val) | +CFG_ALPHAM_GRA |CFG_ALPHA (0 ); + dplane->prop.colorkey_enable =ADV_GRACOLORKEY ; + } update_attr = true; }else if (property == priv->brightness_prop) { dplane->prop.brightness = val -256 ;
@@ -449,7 +461,9 @@ int armada_overlay_plane_create(struct d dplane->prop.colorkey_yr =0xfefefe00 ; dplane->prop.colorkey_ug =0x01010100 ; dplane->prop.colorkey_vb =0x01010100 ; - dplane->prop.colorkey_mode =CFG_CKMODE (CKMODE_RGB ); + dplane->prop.colorkey_mode =CFG_CKMODE (CKMODE_RGB ) | +CFG_ALPHAM_GRA |CFG_ALPHA (0 ); + dplane->prop.colorkey_enable =ADV_GRACOLORKEY ; dplane->prop.brightness =0 ; dplane->prop.contrast =0x4000 ; dplane->prop.saturation =0x4000 ;
Greg Kroah-Hartman
maintainerPATCH 44/56 ARM: dts: am3517.dtsi: Disable reference to OMAP3 OTG controller
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adam Ford <[email protected]>
[ Upstream commit 923847413f7316b5ced3491769b3fefa6c56a79a ]
The AM3517 has a different OTG controller location than the OMAP3, which is included from omap3.dtsi. This results in a hwmod error. Since the AM3517 has a different OTG controller address, this patch disabes one that is isn't available.
--- arch/arm/boot/dts/am3517.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/boot/dts/am3517.dtsi +5 -0
@@ -62,6 +62,11 @@ }; }; +/* Table Table 5-79 of the TRM shows 480ab000 is reserved */ +&usb_otg_hs { + status = "disabled"; +}; + &iva { status = "disabled"; };
Greg Kroah-Hartman
maintainerPATCH 45/56 ixgbe: Be more careful when modifying MAC filters
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Duyck <[email protected]>
[ Upstream commit d14c780c11fbc10f66c43e7b64eefe87ca442bd3 ]
This change makes it so that we are much more explicit about the ordering of updates to the receive address register (RAR) table. Prior to this patch I believe we may have been updating the table while entries were still active, or possibly allowing for reordering of things since we weren't explicitly flushing writes to either the lower or upper portion of the register prior to accessing the other half.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +11 -1
@@ -1781,7 +1781,12 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hif (enable_addr !=0 ) rar_high |=IXGBE_RAH_AV ; +/* Record lower 32 bits of MAC address and then make +* sure that write is flushed to hardware before writing +* the upper 16 bits and setting the valid bit. +*/ IXGBE_WRITE_REG (hw,IXGBE_RAL (index), rar_low); +IXGBE_WRITE_FLUSH (hw);IXGBE_WRITE_REG (hw,IXGBE_RAH (index), rar_high);return 0 ;
@@ -1813,8 +1818,13 @@ s32 ixgbe_clear_rar_generic(struct ixgbe rar_high =IXGBE_READ_REG (hw,IXGBE_RAH (index)); rar_high &= ~(0x0000FFFF |IXGBE_RAH_AV ); -IXGBE_WRITE_REG (hw,IXGBE_RAL (index),0 ); +/* Clear the address valid bit and upper 16 bits of the address +* before clearing the lower bits. This way we aren't updating +* a live filter. +*/ IXGBE_WRITE_REG (hw,IXGBE_RAH (index), rar_high); +IXGBE_WRITE_FLUSH (hw); +IXGBE_WRITE_REG (hw,IXGBE_RAL (index),0 );/* clear VMDq pool/queue selection for this RAR */ hw->mac.ops.clear_vmdq (hw, index,IXGBE_CLEAR_VMDQ_ALL );
Greg Kroah-Hartman
maintainerPATCH 46/56 qlogic: check kstrtoul() for errors
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 5fc853cc01c68f84984ecc2d5fd777ecad78240f ]
We accidentally left out the error handling for kstrtoul().
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +2 -0
@@ -1136,6 +1136,8 @@ static ssize_t qlcnic_83xx_sysfs_flash_wreturn QL_STATUS_INVALID_PARAM ; ret =kstrtoul (buf,16 , &data); +if (ret) +return ret;switch (data) {case QLC_83XX_FLASH_SECTOR_ERASE_CMD :
Greg Kroah-Hartman
maintainerPATCH 47/56 net: usb: rtl8150: demote allmulti message to dev_dbg()
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Lechner <[email protected]>
[ Upstream commit 3a9b0455062ffb9d2f6cd4473a76e3456f318c9f ]
This driver can spam the kernel log with multiple messages of:
net eth0: eth0: allmulti set
Usually 4 or 8 at a time (probably because of using ConnMan).
This message doesn't seem useful, so let's demote it from dev_info() to dev_dbg().
--- drivers/net/usb/rtl8150.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/rtl8150.c +1 -1
@@ -681,7 +681,7 @@ static void rtl8150_set_multicast(struct (netdev->flags & IFF_ALLMULTI)) { rx_creg &= 0xfffe; rx_creg |= 0x0002; - dev_info(&netdev->dev, "%s: allmulti set\n", netdev->name); + dev_dbg(&netdev->dev, "%s: allmulti set\n", netdev->name); } else {/* ~RX_MULTICAST, ~RX_PROMISCUOUS */ rx_creg &=0x00fc ;
Greg Kroah-Hartman
maintainerPATCH 48/56 net: qca_spi: Avoid packet drop during initial sync
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wahren <[email protected]>
[ Upstream commit b2bab426dc715de147f8039a3fccff27d795f4eb ]
As long as the synchronization with the QCA7000 isn't finished, we cannot accept packets from the upper layers. So let the SPI thread enable the TX queue after sync and avoid unwanted packet drop.
--- drivers/net/ethernet/qualcomm/qca_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/qualcomm/qca_spi.c +1 -1
@@ -636,7 +636,7 @@ qcaspi_netdev_open(struct net_device *dereturn ret; } -netif_start_queue (qca->net_dev); +/* SPI thread takes care of TX queue */ return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 49/56 net: qca_spi: Make sure the QCA7000 reset is triggered
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Wahren <[email protected]>
[ Upstream commit 711c62dfa6bdb4326ca6c587f295ea5c4f7269de ]
In case the SPI thread is not running, a simple reset of sync state won't fix the transmit timeout. We also need to wake up the kernel thread.
--- drivers/net/ethernet/qualcomm/qca_spi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/qualcomm/qca_spi.c +3 -0
@@ -740,6 +740,9 @@ qcaspi_netdev_tx_timeout(struct net_devi qca->net_dev->stats.tx_errors++;/* Trigger tx queue flush and QCA7000 reset */ qca->sync =QCASPI_SYNC_UNKNOWN ; + +if (qca->spi_thread) +wake_up_process (qca->spi_thread); } static int
Greg Kroah-Hartman
maintainerPATCH 51/56 staging: android: ion: check for kref overflow
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Rosenberg <[email protected]>
This patch is against 4.4. It does not apply to master due to a large rework of ion in 4.12 which removed the affected functions altogther. 4c23cbff073f3b9b ("staging: android: ion: Remove import interface")
Userspace can cause the kref to handles to increment arbitrarily high. Ensure it does not overflow.
---
v2: Fixed patch corruption :(
It applies from 3.18 to 4.11, although with a trivial conflict resolution for the later branches.
drivers/staging/android/ion/ion.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/staging/android/ion/ion.c +14 -3
@@ -15,6 +15,7 @@* */ +#include <linux/atomic.h> #include <linux/device.h> #include <linux/err.h> #include <linux/file.h>
@@ -389,6 +390,16 @@ static void ion_handle_get(struct ion_hakref_get (&handle->ref); } +/* Must hold the client lock */ +static struct ion_handle *ion_handle_get_check_overflow ( +struct ion_handle *handle) +{ +if (atomic_read (&handle->ref.refcount) +1 ==0 ) +return ERR_PTR (-EOVERFLOW ); +ion_handle_get (handle); +return handle; +} +static int ion_handle_put_nolock (struct ion_handle *handle) {int ret;
@@ -435,9 +446,9 @@ static struct ion_handle *ion_handle_get handle =idr_find (&client->idr, id);if (handle) -ion_handle_get (handle); +return ion_handle_get_check_overflow (handle); -return handle ? handle :ERR_PTR (-EINVAL ); +return ERR_PTR (-EINVAL ); } struct ion_handle *ion_handle_get_by_id(struct ion_client *client,
@@ -1197,7 +1208,7 @@ struct ion_handle *ion_import_dma_buf(st/* if a handle exists for this buffer just take a reference to it */ handle =ion_handle_lookup (client, buffer);if (!IS_ERR (handle)) { -ion_handle_get (handle); + handle =ion_handle_get_check_overflow (handle);mutex_unlock (&client->lock); goto end; }
Greg Kroah-Hartman
maintainerPATCH 52/56 xfrm_user: prevent leaking 2 bytes of kernel memory
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 45c180bc29babbedd6b8c01b975780ef44d9d09c upstream.
struct xfrm_userpolicy_type has two holes, so we should not use C99 style initializer.
KMSAN report:
BUG: KMSAN: kernel-infoleak in copyout lib/iov_iter.c:140 [inline] BUG: KMSAN: kernel-infoleak in _copy_to_iter+0x1b14/0x2800 lib/iov_iter.c:571 CPU: 1 PID: 4520 Comm: syz-executor841 Not tainted 4.17.0+ #5 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x185/0x1d0 lib/dump_stack.c:113 kmsan_report+0x188/0x2a0 mm/kmsan/kmsan.c:1117 kmsan_internal_check_memory+0x138/0x1f0 mm/kmsan/kmsan.c:1211 kmsan_copy_to_user+0x7a/0x160 mm/kmsan/kmsan.c:1253 copyout lib/iov_iter.c:140 [inline] _copy_to_iter+0x1b14/0x2800 lib/iov_iter.c:571 copy_to_iter include/linux/uio.h:106 [inline] skb_copy_datagram_iter+0x422/0xfa0 net/core/datagram.c:431 skb_copy_datagram_msg include/linux/skbuff.h:3268 [inline] netlink_recvmsg+0x6f1/0x1900 net/netlink/af_netlink.c:1959 sock_recvmsg_nosec net/socket.c:802 [inline] sock_recvmsg+0x1d6/0x230 net/socket.c:809 ___sys_recvmsg+0x3fe/0x810 net/socket.c:2279 __sys_recvmmsg+0x58e/0xe30 net/socket.c:2391 do_sys_recvmmsg+0x2a6/0x3e0 net/socket.c:2472 __do_sys_recvmmsg net/socket.c:2485 [inline] __se_sys_recvmmsg net/socket.c:2481 [inline] __x64_sys_recvmmsg+0x15d/0x1c0 net/socket.c:2481 do_syscall_64+0x15b/0x230 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x446ce9 RSP: 002b:00007fc307918db8 EFLAGS: 00000293 ORIG_RAX: 000000000000012b RAX: ffffffffffffffda RBX: 00000000006dbc24 RCX: 0000000000446ce9 RDX: 000000000000000a RSI: 0000000020005040 RDI: 0000000000000003 RBP: 00000000006dbc20 R08: 0000000020004e40 R09: 0000000000000000 R10: 0000000040000000 R11: 0000000000000293 R12: 0000000000000000 R13: 00007ffc8d2df32f R14: 00007fc3079199c0 R15: 0000000000000001
Uninit was stored to memory at:
kmsan_save_stack_with_flags mm/kmsan/kmsan.c:279 [inline] kmsan_save_stack mm/kmsan/kmsan.c:294 [inline] kmsan_internal_chain_origin+0x12b/0x210 mm/kmsan/kmsan.c:685 kmsan_memcpy_origins+0x11d/0x170 mm/kmsan/kmsan.c:527 __msan_memcpy+0x109/0x160 mm/kmsan/kmsan_instr.c:413 __nla_put lib/nlattr.c:569 [inline] nla_put+0x276/0x340 lib/nlattr.c:627 copy_to_user_policy_type net/xfrm/xfrm_user.c:1678 [inline] dump_one_policy+0xbe1/0x1090 net/xfrm/xfrm_user.c:1708 xfrm_policy_walk+0x45a/0xd00 net/xfrm/xfrm_policy.c:1013 xfrm_dump_policy+0x1c0/0x2a0 net/xfrm/xfrm_user.c:1749 netlink_dump+0x9b5/0x1550 net/netlink/af_netlink.c:2226 __netlink_dump_start+0x1131/0x1270 net/netlink/af_netlink.c:2323 netlink_dump_start include/linux/netlink.h:214 [inline] xfrm_user_rcv_msg+0x8a3/0x9b0 net/xfrm/xfrm_user.c:2577 netlink_rcv_skb+0x37e/0x600 net/netlink/af_netlink.c:2448 xfrm_netlink_rcv+0xb2/0xf0 net/xfrm/xfrm_user.c:2598 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x1680/0x1750 net/netlink/af_netlink.c:1336 netlink_sendmsg+0x104f/0x1350 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg net/socket.c:639 [inline] ___sys_sendmsg+0xec8/0x1320 net/socket.c:2117 __sys_sendmsg net/socket.c:2155 [inline] __do_sys_sendmsg net/socket.c:2164 [inline] __se_sys_sendmsg net/socket.c:2162 [inline] __x64_sys_sendmsg+0x331/0x460 net/socket.c:2162 do_syscall_64+0x15b/0x230 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Local variable description: ----upt.i@dump_one_policy Variable was created at: dump_one_policy+0x78/0x1090 net/xfrm/xfrm_user.c:1689 xfrm_policy_walk+0x45a/0xd00 net/xfrm/xfrm_policy.c:1013
Byte 130 of 137 is uninitialized
Memory access starts at ffff88019550407f
--- net/xfrm/xfrm_user.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
net/xfrm/xfrm_user.c +5 -3
@@ -1597,9 +1597,11 @@ static inline size_t userpolicy_type_att#ifdef CONFIG_XFRM_SUB_POLICY static int copy_to_user_policy_type (u8 type,struct sk_buff *skb) { -struct xfrm_userpolicy_type upt = { - .type = type, - }; +struct xfrm_userpolicy_type upt; + +/* Sadly there are two holes in struct xfrm_userpolicy_type */ +memset (&upt,0 ,sizeof (upt)); + upt.type = type;return nla_put (skb,XFRMA_POLICY_TYPE ,sizeof (upt), &upt); }
Greg Kroah-Hartman
maintainerPATCH 53/56 netfilter: conntrack: dccp: treat SYNC/SYNCACK as invalid if no prior state
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
commit 6613b6173dee098997229caf1f3b961c49da75e6 upstream.
When first DCCP packet is SYNC or SYNCACK, we insert a new conntrack that has an un-initialized timeout value, i.e. such entry could be reaped at any time.
Mark them as INVALID and only ignore SYNC/SYNCACK when connection had an old state.
--- net/netfilter/nf_conntrack_proto_dccp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/netfilter/nf_conntrack_proto_dccp.c +4 -4
@@ -244,14 +244,14 @@ dccp_state_table[CT_DCCP_ROLE_MAX + 1][D* We currently ignore Sync packets * * sNO, sRQ, sRS, sPO, sOP, sCR, sCG, sTW */ - sIG, sIG, sIG, sIG, sIG, sIG, sIG, sIG, + sIV, sIG, sIG, sIG, sIG, sIG, sIG, sIG, }, [DCCP_PKT_SYNCACK] = {/* * We currently ignore SyncAck packets * * sNO, sRQ, sRS, sPO, sOP, sCR, sCG, sTW */ - sIG, sIG, sIG, sIG, sIG, sIG, sIG, sIG, + sIV, sIG, sIG, sIG, sIG, sIG, sIG, sIG, }, }, [CT_DCCP_ROLE_SERVER] = {
@@ -372,14 +372,14 @@ dccp_state_table[CT_DCCP_ROLE_MAX + 1][D* We currently ignore Sync packets * * sNO, sRQ, sRS, sPO, sOP, sCR, sCG, sTW */ - sIG, sIG, sIG, sIG, sIG, sIG, sIG, sIG, + sIV, sIG, sIG, sIG, sIG, sIG, sIG, sIG, }, [DCCP_PKT_SYNCACK] = {/* * We currently ignore SyncAck packets * * sNO, sRQ, sRS, sPO, sOP, sCR, sCG, sTW */ - sIG, sIG, sIG, sIG, sIG, sIG, sIG, sIG, + sIV, sIG, sIG, sIG, sIG, sIG, sIG, sIG, }, }, };
Greg Kroah-Hartman
maintainerPATCH 54/56 packet: refine ring v3 block size test to hold one frame
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <[email protected]>
commit 4576cd469d980317c4edd9173f8b694aa71ea3a3 upstream.
TPACKET_V3 stores variable length frames in fixed length blocks. Blocks must be able to store a block header, optional private space and at least one minimum sized frame.
Frames, even for a zero snaplen packet, store metadata headers and optional reserved space.
In the block size bounds check, ensure that the frame of the chosen configuration fits. This includes sockaddr_ll and optional tp_reserve.
Syzbot was able to construct a ring with insuffient room for the sockaddr_ll in the header of a zero-length frame, triggering an out-of-bounds write in dev_parse_header.
Convert the comparison to less than, as zero is a valid snap len. This matches the test for minimum tp_frame_size immediately below.
--- net/packet/af_packet.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
net/packet/af_packet.c +6 -4
@@ -3853,6 +3853,8 @@ static int packet_set_ring(struct sock * }if (req->tp_block_nr) { +unsigned int min_frame_size; +/* Sanity tests and some calculations */ err = -EBUSY ;if (unlikely (rb->pg_vec))
@@ -3875,12 +3877,12 @@ static int packet_set_ring(struct sock * goto out;if (unlikely (req->tp_block_size & (PAGE_SIZE -1 ))) goto out; + min_frame_size = po->tp_hdrlen + po->tp_reserve;if (po->tp_version >=TPACKET_V3 && - req->tp_block_size <= -BLK_PLUS_PRIV ((u64 )req_u->req3.tp_sizeof_priv) +sizeof (struct tpacket3_hdr )) + req->tp_block_size < +BLK_PLUS_PRIV ((u64 )req_u->req3.tp_sizeof_priv) + min_frame_size) goto out; -if (unlikely (req->tp_frame_size < po->tp_hdrlen + - po->tp_reserve)) +if (unlikely (req->tp_frame_size < min_frame_size)) goto out;if (unlikely (req->tp_frame_size & (TPACKET_ALIGNMENT -1 ))) goto out;
Greg Kroah-Hartman
maintainerPATCH 55/56 PCI: hotplug: Dont leak pci_slot on registration failure
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Wunner <[email protected]>
commit 4ce6435820d1f1cc2c2788e232735eb244bcc8a3 upstream.
If addition of sysfs files fails on registration of a hotplug slot, the struct pci_slot as well as the entry in the slot_list is leaked. The issue has been present since the hotplug core was introduced in 2002:
https://git.kernel.org/tglx/history/c/a8a2069f432c
Perhaps the idea was that even though sysfs addition fails, the slot should still be usable. But that's not how drivers use the interface, they abort probe if a non-zero value is returned.
--- drivers/pci/hotplug/pci_hotplug_core.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/pci/hotplug/pci_hotplug_core.c +9 -0
@@ -457,8 +457,17 @@ int __pci_hp_register(struct hotplug_slolist_add (&slot->slot_list, &pci_hotplug_slot_list); result =fs_add_slot (pci_slot); +if (result) + goto err_list_del; +kobject_uevent (&pci_slot->kobj,KOBJ_ADD );dbg ("Added slot %s to the list\n" , name); + goto out; + +err_list_del: +list_del (&slot->slot_list); + pci_slot->hotplug =NULL ; +pci_destroy_slot (pci_slot); out:mutex_unlock (&pci_hp_mutex);return result;
Greg Kroah-Hartman
maintainerPATCH 56/56 reiserfs: fix broken xattr handling (heap corruption, bad retval)
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jann Horn <[email protected]>
commit a13f085d111e90469faf2d9965eb39b11c114d7e upstream.
This fixes the following issues:
- When a buffer size is supplied to reiserfs_listxattr() such that each individual name fits, but the concatenation of all names doesn't fit, reiserfs_listxattr() overflows the supplied buffer. This leads to a kernel heap overflow (verified using KASAN) followed by an out-of-bounds usercopy and is therefore a security bug.
- When a buffer size is supplied to reiserfs_listxattr() such that a name doesn't fit, -ERANGE should be returned. But reiserfs instead just truncates the list of names; I have verified that if the only xattr on a file has a longer name than the supplied buffer length, listxattr() incorrectly returns zero.
With my patch applied, -ERANGE is returned in both cases and the memory corruption doesn't happen anymore.
Credit for making me clean this code up a bit goes to Al Viro, who pointed out that the ->actor calling convention is suboptimal and should be changed.
--- fs/reiserfs/xattr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/reiserfs/xattr.c +3 -1
@@ -842,8 +842,10 @@ static int listxattr_filler(void *buf, c size = handler->list (b->dentry, b->buf + b->pos, b->size, name, namelen, handler->flags); -if (size > b->size) +if (b->pos + size > b->size) { + b->pos = -ERANGE ;return -ERANGE ; + } }else { size = handler->list (b->dentry,NULL ,0 , name, namelen, handler->flags);
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.120 release. There are 56 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Aug 28 06:42:19 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.120-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-3.18.y
and the diffstat can be found below.thanks,
greg k-h
Merged, compiled with -Werror, and installed onto my Pixel XL.
No initial issues noticed in dmesg or general usage.
Thanks!
Nathan
Greg Kroah-Hartman
maintainerQuoted 15 lines · Nathan Chancellor
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.120 release. There are 56 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Aug 28 06:42:19 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.120-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-3.18.y
and the diffstat can be found below.
Quoted 8 lines
Quoted 4 lines
thanks,
greg k-h
Merged, compiled with -Werror, and installed onto my Pixel XL.
No initial issues noticed in dmesg or general usage.
Wonderful, thanks for testing and letting me know.
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.120 release. There are 56 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Aug 28 06:42:19 UTC 2018. Anything received after that time might be too late.
Build results:
total: 137 pass: 137 fail: 0 Qemu test results: total: 207 pass: 207 fail: 0
Details are available at http://kerneltests.org/builders/.
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.120 release. There are 56 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Aug 28 06:42:19 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.120-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-3.18.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah