* [PATCH for-4.4 00/13] Stable candidates for 4.4.y
@ 2017-07-25 20:07 Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 01/13] ppp: take reference on channels netns Amit Pundir
` (13 more replies)
0 siblings, 14 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable
Hi Greg,
Few stable candidates for 4.4.y for your consideration.
Cherry-picked and build tested on Linux v4.4.78 for
ARCH=arm/arm64 + allmodconfig.
Few fixes are applicable for 3.18.y as well and I'll submit
them along with other fixes shortly in a separate thread.
Regards,
Amit Pundir
Calvin Owens (1):
mpt3sas: Don't overreach ioc->reply_post[] during initialization
Florian Fainelli (1):
net: phy: Do not perform software reset for Generic PHY
Guillaume Nault (1):
ppp: take reference on channels netns
Herbert Xu (1):
af_key: Fix sadb_x_ipsecrequest parsing
Jia-Ju Bai (1):
isdn: Fix a sleep-in-atomic bug
Lior David (1):
wil6210: fix deadlock when using fw_no_recovery option
Michal Kazior (1):
ath10k: fix null deref on wmi-tlv when trying spectral scan
Oliver Neukum (2):
kaweth: fix firmware download
kaweth: fix oops upon failed memory allocation
Sudeep Holla (3):
mailbox: always wait in mbox_send_message for blocking Tx mode
mailbox: skip complete wait event if timer expired
mailbox: handle empty message in tx_tick
Sudip Mukherjee (1):
nfc: fdp: fix NULL pointer dereference
drivers/isdn/i4l/isdn_ppp.c | 2 +-
drivers/mailbox/mailbox.c | 13 +++++----
drivers/net/phy/phy_device.c | 2 +-
drivers/net/ppp/ppp_generic.c | 2 ++
drivers/net/usb/kaweth.c | 10 +++++--
drivers/net/wireless/ath/ath10k/wmi-ops.h | 6 ++++
drivers/net/wireless/ath/wil6210/main.c | 15 +++++-----
drivers/nfc/fdp/i2c.c | 6 ++--
drivers/scsi/mpt3sas/mpt3sas_base.c | 33 +++++++++++-----------
include/linux/phy.h | 4 +++
net/key/af_key.c | 47 +++++++++++++++++--------------
11 files changed, 82 insertions(+), 58 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH for-4.4 01/13] ppp: take reference on channels netns
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-26 5:10 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 02/13] mpt3sas: Don't overreach ioc->reply_post[] during initialization Amit Pundir
` (12 subsequent siblings)
13 siblings, 1 reply; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Guillaume Nault, David S . Miller
From: Guillaume Nault <g.nault@alphalink.fr>
commit 1f461dcdd296eecedaffffc6bae2bfa90bd7eb89 upstream.
Let channels hold a reference on their network namespace.
Some channel types, like ppp_async and ppp_synctty, can have their
userspace controller running in a different namespace. Therefore they
can't rely on them to preclude their netns from being removed from
under them.
==================================================================
BUG: KASAN: use-after-free in ppp_unregister_channel+0x372/0x3a0 at
addr ffff880064e217e0
Read of size 8 by task syz-executor/11581
=============================================================================
BUG net_namespace (Not tainted): kasan: bad access detected
-----------------------------------------------------------------------------
Disabling lock debugging due to kernel taint
INFO: Allocated in copy_net_ns+0x6b/0x1a0 age=92569 cpu=3 pid=6906
[< none >] ___slab_alloc+0x4c7/0x500 kernel/mm/slub.c:2440
[< none >] __slab_alloc+0x4c/0x90 kernel/mm/slub.c:2469
[< inline >] slab_alloc_node kernel/mm/slub.c:2532
[< inline >] slab_alloc kernel/mm/slub.c:2574
[< none >] kmem_cache_alloc+0x23a/0x2b0 kernel/mm/slub.c:2579
[< inline >] kmem_cache_zalloc kernel/include/linux/slab.h:597
[< inline >] net_alloc kernel/net/core/net_namespace.c:325
[< none >] copy_net_ns+0x6b/0x1a0 kernel/net/core/net_namespace.c:360
[< none >] create_new_namespaces+0x2f6/0x610 kernel/kernel/nsproxy.c:95
[< none >] copy_namespaces+0x297/0x320 kernel/kernel/nsproxy.c:150
[< none >] copy_process.part.35+0x1bf4/0x5760 kernel/kernel/fork.c:1451
[< inline >] copy_process kernel/kernel/fork.c:1274
[< none >] _do_fork+0x1bc/0xcb0 kernel/kernel/fork.c:1723
[< inline >] SYSC_clone kernel/kernel/fork.c:1832
[< none >] SyS_clone+0x37/0x50 kernel/kernel/fork.c:1826
[< none >] entry_SYSCALL_64_fastpath+0x16/0x7a kernel/arch/x86/entry/entry_64.S:185
INFO: Freed in net_drop_ns+0x67/0x80 age=575 cpu=2 pid=2631
[< none >] __slab_free+0x1fc/0x320 kernel/mm/slub.c:2650
[< inline >] slab_free kernel/mm/slub.c:2805
[< none >] kmem_cache_free+0x2a0/0x330 kernel/mm/slub.c:2814
[< inline >] net_free kernel/net/core/net_namespace.c:341
[< none >] net_drop_ns+0x67/0x80 kernel/net/core/net_namespace.c:348
[< none >] cleanup_net+0x4e5/0x600 kernel/net/core/net_namespace.c:448
[< none >] process_one_work+0x794/0x1440 kernel/kernel/workqueue.c:2036
[< none >] worker_thread+0xdb/0xfc0 kernel/kernel/workqueue.c:2170
[< none >] kthread+0x23f/0x2d0 kernel/drivers/block/aoe/aoecmd.c:1303
[< none >] ret_from_fork+0x3f/0x70 kernel/arch/x86/entry/entry_64.S:468
INFO: Slab 0xffffea0001938800 objects=3 used=0 fp=0xffff880064e20000
flags=0x5fffc0000004080
INFO: Object 0xffff880064e20000 @offset=0 fp=0xffff880064e24200
CPU: 1 PID: 11581 Comm: syz-executor Tainted: G B 4.4.0+
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
00000000ffffffff ffff8800662c7790 ffffffff8292049d ffff88003e36a300
ffff880064e20000 ffff880064e20000 ffff8800662c77c0 ffffffff816f2054
ffff88003e36a300 ffffea0001938800 ffff880064e20000 0000000000000000
Call Trace:
[< inline >] __dump_stack kernel/lib/dump_stack.c:15
[<ffffffff8292049d>] dump_stack+0x6f/0xa2 kernel/lib/dump_stack.c:50
[<ffffffff816f2054>] print_trailer+0xf4/0x150 kernel/mm/slub.c:654
[<ffffffff816f875f>] object_err+0x2f/0x40 kernel/mm/slub.c:661
[< inline >] print_address_description kernel/mm/kasan/report.c:138
[<ffffffff816fb0c5>] kasan_report_error+0x215/0x530 kernel/mm/kasan/report.c:236
[< inline >] kasan_report kernel/mm/kasan/report.c:259
[<ffffffff816fb4de>] __asan_report_load8_noabort+0x3e/0x40 kernel/mm/kasan/report.c:280
[< inline >] ? ppp_pernet kernel/include/linux/compiler.h:218
[<ffffffff83ad71b2>] ? ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
[< inline >] ppp_pernet kernel/include/linux/compiler.h:218
[<ffffffff83ad71b2>] ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
[< inline >] ? ppp_pernet kernel/drivers/net/ppp/ppp_generic.c:293
[<ffffffff83ad6f26>] ? ppp_unregister_channel+0xe6/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
[<ffffffff83ae18f3>] ppp_asynctty_close+0xa3/0x130 kernel/drivers/net/ppp/ppp_async.c:241
[<ffffffff83ae1850>] ? async_lcp_peek+0x5b0/0x5b0 kernel/drivers/net/ppp/ppp_async.c:1000
[<ffffffff82c33239>] tty_ldisc_close.isra.1+0x99/0xe0 kernel/drivers/tty/tty_ldisc.c:478
[<ffffffff82c332c0>] tty_ldisc_kill+0x40/0x170 kernel/drivers/tty/tty_ldisc.c:744
[<ffffffff82c34943>] tty_ldisc_release+0x1b3/0x260 kernel/drivers/tty/tty_ldisc.c:772
[<ffffffff82c1ef21>] tty_release+0xac1/0x13e0 kernel/drivers/tty/tty_io.c:1901
[<ffffffff82c1e460>] ? release_tty+0x320/0x320 kernel/drivers/tty/tty_io.c:1688
[<ffffffff8174de36>] __fput+0x236/0x780 kernel/fs/file_table.c:208
[<ffffffff8174e405>] ____fput+0x15/0x20 kernel/fs/file_table.c:244
[<ffffffff813595ab>] task_work_run+0x16b/0x200 kernel/kernel/task_work.c:115
[< inline >] exit_task_work kernel/include/linux/task_work.h:21
[<ffffffff81307105>] do_exit+0x8b5/0x2c60 kernel/kernel/exit.c:750
[<ffffffff813fdd20>] ? debug_check_no_locks_freed+0x290/0x290 kernel/kernel/locking/lockdep.c:4123
[<ffffffff81306850>] ? mm_update_next_owner+0x6f0/0x6f0 kernel/kernel/exit.c:357
[<ffffffff813215e6>] ? __dequeue_signal+0x136/0x470 kernel/kernel/signal.c:550
[<ffffffff8132067b>] ? recalc_sigpending_tsk+0x13b/0x180 kernel/kernel/signal.c:145
[<ffffffff81309628>] do_group_exit+0x108/0x330 kernel/kernel/exit.c:880
[<ffffffff8132b9d4>] get_signal+0x5e4/0x14f0 kernel/kernel/signal.c:2307
[< inline >] ? kretprobe_table_lock kernel/kernel/kprobes.c:1113
[<ffffffff8151d355>] ? kprobe_flush_task+0xb5/0x450 kernel/kernel/kprobes.c:1158
[<ffffffff8115f7d3>] do_signal+0x83/0x1c90 kernel/arch/x86/kernel/signal.c:712
[<ffffffff8151d2a0>] ? recycle_rp_inst+0x310/0x310 kernel/include/linux/list.h:655
[<ffffffff8115f750>] ? setup_sigcontext+0x780/0x780 kernel/arch/x86/kernel/signal.c:165
[<ffffffff81380864>] ? finish_task_switch+0x424/0x5f0 kernel/kernel/sched/core.c:2692
[< inline >] ? finish_lock_switch kernel/kernel/sched/sched.h:1099
[<ffffffff81380560>] ? finish_task_switch+0x120/0x5f0 kernel/kernel/sched/core.c:2678
[< inline >] ? context_switch kernel/kernel/sched/core.c:2807
[<ffffffff85d794e9>] ? __schedule+0x919/0x1bd0 kernel/kernel/sched/core.c:3283
[<ffffffff81003901>] exit_to_usermode_loop+0xf1/0x1a0 kernel/arch/x86/entry/common.c:247
[< inline >] prepare_exit_to_usermode kernel/arch/x86/entry/common.c:282
[<ffffffff810062ef>] syscall_return_slowpath+0x19f/0x210 kernel/arch/x86/entry/common.c:344
[<ffffffff85d88022>] int_ret_from_sys_call+0x25/0x9f kernel/arch/x86/entry/entry_64.S:281
Memory state around the buggy address:
ffff880064e21680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff880064e21700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff880064e21780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff880064e21800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff880064e21880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Fixes: 273ec51dd7ce ("net: ppp_generic - introduce net-namespace functionality v2")
Reported-by: Baozeng Ding <sploving1@gmail.com>
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/net/ppp/ppp_generic.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index e5bb870b5461..fa76ca128e1b 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -2390,6 +2390,8 @@ ppp_unregister_channel(struct ppp_channel *chan)
spin_lock_bh(&pn->all_channels_lock);
list_del(&pch->list);
spin_unlock_bh(&pn->all_channels_lock);
+ put_net(pch->chan_net);
+ pch->chan_net = NULL;
pch->file.dead = 1;
wake_up_interruptible(&pch->file.rwait);
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 02/13] mpt3sas: Don't overreach ioc->reply_post[] during initialization
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 01/13] ppp: take reference on channels netns Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 03/13] kaweth: fix firmware download Amit Pundir
` (11 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Calvin Owens, Martin K . Petersen
From: Calvin Owens <calvinowens@fb.com>
commit 5ec8a1753bc29efa7e4b1391d691c9c719b30257 upstream.
In _base_make_ioc_operational(), we walk ioc->reply_queue_list and pull
a pointer out of successive elements of ioc->reply_post[] for each entry
in that list if RDPQ is enabled.
Since the code pulls the pointer for the next iteration at the bottom of
the loop, it triggers the a KASAN dump on the final iteration:
BUG: KASAN: slab-out-of-bounds in _base_make_ioc_operational+0x47b7/0x47e0 [mpt3sas] at addr ffff880754816ab0
Read of size 8 by task modprobe/305
<snip>
Call Trace:
[<ffffffff81dfc591>] dump_stack+0x4d/0x6c
[<ffffffff814c9689>] print_trailer+0xf9/0x150
[<ffffffff814ceda4>] object_err+0x34/0x40
[<ffffffff814d1231>] kasan_report_error+0x221/0x530
[<ffffffff814d1673>] __asan_report_load8_noabort+0x43/0x50
[<ffffffffa0043637>] _base_make_ioc_operational+0x47b7/0x47e0 [mpt3sas]
[<ffffffffa0049a51>] mpt3sas_base_attach+0x1991/0x2120 [mpt3sas]
[<ffffffffa0053c93>] _scsih_probe+0xeb3/0x16b0 [mpt3sas]
[<ffffffff81ebd047>] local_pci_probe+0xc7/0x170
[<ffffffff81ebf2cf>] pci_device_probe+0x20f/0x290
[<ffffffff820d50cd>] really_probe+0x17d/0x600
[<ffffffff820d56a3>] __driver_attach+0x153/0x190
[<ffffffff820cffac>] bus_for_each_dev+0x11c/0x1a0
[<ffffffff820d421d>] driver_attach+0x3d/0x50
[<ffffffff820d378a>] bus_add_driver+0x44a/0x5f0
[<ffffffff820d666c>] driver_register+0x18c/0x3b0
[<ffffffff81ebcb76>] __pci_register_driver+0x156/0x200
[<ffffffffa00c8135>] _mpt3sas_init+0x135/0x1000 [mpt3sas]
[<ffffffff81000423>] do_one_initcall+0x113/0x2b0
[<ffffffff813caa5a>] do_init_module+0x1d0/0x4d8
[<ffffffff81273909>] load_module+0x6729/0x8dc0
[<ffffffff81276123>] SYSC_init_module+0x183/0x1a0
[<ffffffff8127625e>] SyS_init_module+0xe/0x10
[<ffffffff828fe7d7>] entry_SYSCALL_64_fastpath+0x12/0x6a
Fix this by pulling the value at the beginning of the loop.
Signed-off-by: Calvin Owens <calvinowens@fb.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Jens Axboe <axboe@fb.com>
Acked-by: Chaitra Basappa <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/scsi/mpt3sas/mpt3sas_base.c | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 5b2c37f1e908..9b5367294116 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -4981,15 +4981,14 @@ _base_make_ioc_ready(struct MPT3SAS_ADAPTER *ioc, int sleep_flag,
static int
_base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
{
- int r, i;
+ int r, i, index;
unsigned long flags;
u32 reply_address;
u16 smid;
struct _tr_list *delayed_tr, *delayed_tr_next;
u8 hide_flag;
struct adapter_reply_queue *reply_q;
- long reply_post_free;
- u32 reply_post_free_sz, index = 0;
+ Mpi2ReplyDescriptorsUnion_t *reply_post_free_contig;
dinitprintk(ioc, pr_info(MPT3SAS_FMT "%s\n", ioc->name,
__func__));
@@ -5061,27 +5060,27 @@ _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
_base_assign_reply_queues(ioc);
/* initialize Reply Post Free Queue */
- reply_post_free_sz = ioc->reply_post_queue_depth *
- sizeof(Mpi2DefaultReplyDescriptor_t);
- reply_post_free = (long)ioc->reply_post[index].reply_post_free;
+ index = 0;
+ reply_post_free_contig = ioc->reply_post[0].reply_post_free;
list_for_each_entry(reply_q, &ioc->reply_queue_list, list) {
+ /*
+ * If RDPQ is enabled, switch to the next allocation.
+ * Otherwise advance within the contiguous region.
+ */
+ if (ioc->rdpq_array_enable) {
+ reply_q->reply_post_free =
+ ioc->reply_post[index++].reply_post_free;
+ } else {
+ reply_q->reply_post_free = reply_post_free_contig;
+ reply_post_free_contig += ioc->reply_post_queue_depth;
+ }
+
reply_q->reply_post_host_index = 0;
- reply_q->reply_post_free = (Mpi2ReplyDescriptorsUnion_t *)
- reply_post_free;
for (i = 0; i < ioc->reply_post_queue_depth; i++)
reply_q->reply_post_free[i].Words =
cpu_to_le64(ULLONG_MAX);
if (!_base_is_controller_msix_enabled(ioc))
goto skip_init_reply_post_free_queue;
- /*
- * If RDPQ is enabled, switch to the next allocation.
- * Otherwise advance within the contiguous region.
- */
- if (ioc->rdpq_array_enable)
- reply_post_free = (long)
- ioc->reply_post[++index].reply_post_free;
- else
- reply_post_free += reply_post_free_sz;
}
skip_init_reply_post_free_queue:
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 03/13] kaweth: fix firmware download
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 01/13] ppp: take reference on channels netns Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 02/13] mpt3sas: Don't overreach ioc->reply_post[] during initialization Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 04/13] kaweth: fix oops upon failed memory allocation Amit Pundir
` (10 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Oliver Neukum, David S . Miller
From: Oliver Neukum <oneukum@suse.com>
commit 60bcabd080f53561efa9288be45c128feda1a8bb upstream.
This fixes the oops discovered by the Umap2 project and Alan Stern.
The intf member needs to be set before the firmware is downloaded.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/net/usb/kaweth.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index f64b25c221e8..9f900eee27be 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1029,6 +1029,7 @@ static int kaweth_probe(
kaweth = netdev_priv(netdev);
kaweth->dev = udev;
kaweth->net = netdev;
+ kaweth->intf = intf;
spin_lock_init(&kaweth->device_lock);
init_waitqueue_head(&kaweth->term_wait);
@@ -1139,8 +1140,6 @@ err_fw:
dev_dbg(dev, "Initializing net device.\n");
- kaweth->intf = intf;
-
kaweth->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!kaweth->tx_urb)
goto err_free_netdev;
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 04/13] kaweth: fix oops upon failed memory allocation
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
` (2 preceding siblings ...)
2017-07-25 20:07 ` [PATCH for-4.4 03/13] kaweth: fix firmware download Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 05/13] net: phy: Do not perform software reset for Generic PHY Amit Pundir
` (9 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Oliver Neukum, David S . Miller
From: Oliver Neukum <oneukum@suse.com>
commit 575ced7f8090c1a4e91e2daf8da9352a6a1fc7a7 upstream.
Just return an error upon failure.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/net/usb/kaweth.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 9f900eee27be..cd93220c9b45 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1009,6 +1009,7 @@ static int kaweth_probe(
struct net_device *netdev;
const eth_addr_t bcast_addr = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
int result = 0;
+ int rv = -EIO;
dev_dbg(dev,
"Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x\n",
@@ -1049,6 +1050,10 @@ static int kaweth_probe(
/* Download the firmware */
dev_info(dev, "Downloading firmware...\n");
kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL);
+ if (!kaweth->firmware_buf) {
+ rv = -ENOMEM;
+ goto err_free_netdev;
+ }
if ((result = kaweth_download_firmware(kaweth,
"kaweth/new_code.bin",
100,
@@ -1203,7 +1208,7 @@ err_only_tx:
err_free_netdev:
free_netdev(netdev);
- return -EIO;
+ return rv;
}
/****************************************************************
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 05/13] net: phy: Do not perform software reset for Generic PHY
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
` (3 preceding siblings ...)
2017-07-25 20:07 ` [PATCH for-4.4 04/13] kaweth: fix oops upon failed memory allocation Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 06/13] nfc: fdp: fix NULL pointer dereference Amit Pundir
` (8 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Florian Fainelli, David S . Miller
From: Florian Fainelli <f.fainelli@gmail.com>
commit 0878fff1f42c18e448ab5b8b4f6a3eb32365b5b6 upstream.
The Generic PHY driver is a catch-all PHY driver and it should preserve
whatever prior initialization has been done by boot loader or firmware
agents. For specific PHY device configuration it is expected that a
specialized PHY driver would take over that role.
Resetting the generic PHY was a bad idea that has lead to several
complaints and downstream workarounds e.g: in OpenWrt/LEDE so restore
the behavior prior to 87aa9f9c61ad ("net: phy: consolidate PHY
reset in phy_init_hw()").
Reported-by: Felix Fietkau <nbd@nbd.name>
Fixes: 87aa9f9c61ad ("net: phy: consolidate PHY reset in phy_init_hw()")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/net/phy/phy_device.c | 2 +-
include/linux/phy.h | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 0bfbabad4431..1d1e5f7723ab 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1442,7 +1442,7 @@ static struct phy_driver genphy_driver[] = {
.phy_id = 0xffffffff,
.phy_id_mask = 0xffffffff,
.name = "Generic PHY",
- .soft_reset = genphy_soft_reset,
+ .soft_reset = genphy_no_soft_reset,
.config_init = genphy_config_init,
.features = PHY_GBIT_FEATURES | SUPPORTED_MII |
SUPPORTED_AUI | SUPPORTED_FIBRE |
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 05fde31b6dc6..b64825d6ad26 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -785,6 +785,10 @@ int genphy_read_status(struct phy_device *phydev);
int genphy_suspend(struct phy_device *phydev);
int genphy_resume(struct phy_device *phydev);
int genphy_soft_reset(struct phy_device *phydev);
+static inline int genphy_no_soft_reset(struct phy_device *phydev)
+{
+ return 0;
+}
void phy_driver_unregister(struct phy_driver *drv);
void phy_drivers_unregister(struct phy_driver *drv, int n);
int phy_driver_register(struct phy_driver *new_driver);
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 06/13] nfc: fdp: fix NULL pointer dereference
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
` (4 preceding siblings ...)
2017-07-25 20:07 ` [PATCH for-4.4 05/13] net: phy: Do not perform software reset for Generic PHY Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 07/13] isdn: Fix a sleep-in-atomic bug Amit Pundir
` (7 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Sudip Mukherjee, Sudip Mukherjee, Samuel Ortiz
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
commit b6355fb3f5f40bbce165847d277e64896cab8f95 upstream.
We are checking phy after dereferencing it. We can print the debug
information after checking it. If phy is NULL then we will get a good
stack trace to tell us that we are in this irq handler.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/nfc/fdp/i2c.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c
index 532db28145c7..a5d7332dfce5 100644
--- a/drivers/nfc/fdp/i2c.c
+++ b/drivers/nfc/fdp/i2c.c
@@ -210,14 +210,14 @@ static irqreturn_t fdp_nci_i2c_irq_thread_fn(int irq, void *phy_id)
struct sk_buff *skb;
int r;
- client = phy->i2c_dev;
- dev_dbg(&client->dev, "%s\n", __func__);
-
if (!phy || irq != phy->i2c_dev->irq) {
WARN_ON_ONCE(1);
return IRQ_NONE;
}
+ client = phy->i2c_dev;
+ dev_dbg(&client->dev, "%s\n", __func__);
+
r = fdp_nci_i2c_read(phy, &skb);
if (r == -EREMOTEIO)
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 07/13] isdn: Fix a sleep-in-atomic bug
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
` (5 preceding siblings ...)
2017-07-25 20:07 ` [PATCH for-4.4 06/13] nfc: fdp: fix NULL pointer dereference Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 08/13] ath10k: fix null deref on wmi-tlv when trying spectral scan Amit Pundir
` (6 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Jia-Ju Bai, David S . Miller
From: Jia-Ju Bai <baijiaju1990@163.com>
commit e8f4ae85439f34bec3b0ab69223a41809dab28c9 upstream.
The driver may sleep under a spin lock, the function call path is:
isdn_ppp_mp_receive (acquire the lock)
isdn_ppp_mp_reassembly
isdn_ppp_push_higher
isdn_ppp_decompress
isdn_ppp_ccp_reset_trans
isdn_ppp_ccp_reset_alloc_state
kzalloc(GFP_KERNEL) --> may sleep
To fixed it, the "GFP_KERNEL" is replaced with "GFP_ATOMIC".
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/isdn/i4l/isdn_ppp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 9c1e8adaf4fc..bf3fbd00a091 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -2364,7 +2364,7 @@ static struct ippp_ccp_reset_state *isdn_ppp_ccp_reset_alloc_state(struct ippp_s
id);
return NULL;
} else {
- rs = kzalloc(sizeof(struct ippp_ccp_reset_state), GFP_KERNEL);
+ rs = kzalloc(sizeof(struct ippp_ccp_reset_state), GFP_ATOMIC);
if (!rs)
return NULL;
rs->state = CCPResetIdle;
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 08/13] ath10k: fix null deref on wmi-tlv when trying spectral scan
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
` (6 preceding siblings ...)
2017-07-25 20:07 ` [PATCH for-4.4 07/13] isdn: Fix a sleep-in-atomic bug Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 09/13] wil6210: fix deadlock when using fw_no_recovery option Amit Pundir
` (5 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Michal Kazior, Kalle Valo
From: Michal Kazior <michal.kazior@tieto.com>
commit 18ae68fff392e445af3c2d8be9bef8a16e1c72a7 upstream.
WMI ops wrappers did not properly check for null
function pointers for spectral scan. This caused
null dereference crash with WMI-TLV based firmware
which doesn't implement spectral scan.
The crash could be triggered with:
ip link set dev wlan0 up
echo background > /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan_ctl
The crash looked like this:
[ 168.031989] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 168.037406] IP: [< (null)>] (null)
[ 168.040395] PGD cdd4067 PUD fa0f067 PMD 0
[ 168.043303] Oops: 0010 [#1] SMP
[ 168.045377] Modules linked in: ath10k_pci(O) ath10k_core(O) ath mac80211 cfg80211 [last unloaded: cfg80211]
[ 168.051560] CPU: 1 PID: 1380 Comm: bash Tainted: G W O 4.8.0 #78
[ 168.054336] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
[ 168.059183] task: ffff88000c460c00 task.stack: ffff88000d4bc000
[ 168.061736] RIP: 0010:[<0000000000000000>] [< (null)>] (null)
...
[ 168.100620] Call Trace:
[ 168.101910] [<ffffffffa03b9566>] ? ath10k_spectral_scan_config+0x96/0x200 [ath10k_core]
[ 168.104871] [<ffffffff811386e2>] ? filemap_fault+0xb2/0x4a0
[ 168.106696] [<ffffffffa03b97e6>] write_file_spec_scan_ctl+0x116/0x280 [ath10k_core]
[ 168.109618] [<ffffffff812da3a1>] full_proxy_write+0x51/0x80
[ 168.111443] [<ffffffff811957b8>] __vfs_write+0x28/0x120
[ 168.113090] [<ffffffff812f1a2d>] ? security_file_permission+0x3d/0xc0
[ 168.114932] [<ffffffff8109b912>] ? percpu_down_read+0x12/0x60
[ 168.116680] [<ffffffff811965f8>] vfs_write+0xb8/0x1a0
[ 168.118293] [<ffffffff81197966>] SyS_write+0x46/0xa0
[ 168.119912] [<ffffffff818f2972>] entry_SYSCALL_64_fastpath+0x1a/0xa4
[ 168.121737] Code: Bad RIP value.
[ 168.123318] RIP [< (null)>] (null)
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/net/wireless/ath/ath10k/wmi-ops.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index 8f4f6a892581..cfed5808bc4e 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -639,6 +639,9 @@ ath10k_wmi_vdev_spectral_conf(struct ath10k *ar,
struct sk_buff *skb;
u32 cmd_id;
+ if (!ar->wmi.ops->gen_vdev_spectral_conf)
+ return -EOPNOTSUPP;
+
skb = ar->wmi.ops->gen_vdev_spectral_conf(ar, arg);
if (IS_ERR(skb))
return PTR_ERR(skb);
@@ -654,6 +657,9 @@ ath10k_wmi_vdev_spectral_enable(struct ath10k *ar, u32 vdev_id, u32 trigger,
struct sk_buff *skb;
u32 cmd_id;
+ if (!ar->wmi.ops->gen_vdev_spectral_enable)
+ return -EOPNOTSUPP;
+
skb = ar->wmi.ops->gen_vdev_spectral_enable(ar, vdev_id, trigger,
enable);
if (IS_ERR(skb))
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 09/13] wil6210: fix deadlock when using fw_no_recovery option
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
` (7 preceding siblings ...)
2017-07-25 20:07 ` [PATCH for-4.4 08/13] ath10k: fix null deref on wmi-tlv when trying spectral scan Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 10/13] mailbox: always wait in mbox_send_message for blocking Tx mode Amit Pundir
` (4 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Lior David, Maya Erez, Kalle Valo
From: Lior David <qca_liord@qca.qualcomm.com>
commit dfb5b098e0f40b68aa07f2ec55f4dd762efefbfa upstream.
When FW crashes with no_fw_recovery option, driver
waits for manual recovery with wil->mutex held, this
can easily create deadlocks.
Fix the problem by moving the wait outside the lock.
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/net/wireless/ath/wil6210/main.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index bb69a5949aea..85bca557a339 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -330,18 +330,19 @@ static void wil_fw_error_worker(struct work_struct *work)
wil->last_fw_recovery = jiffies;
+ wil_info(wil, "fw error recovery requested (try %d)...\n",
+ wil->recovery_count);
+ if (!no_fw_recovery)
+ wil->recovery_state = fw_recovery_running;
+ if (wil_wait_for_recovery(wil) != 0)
+ return;
+
mutex_lock(&wil->mutex);
switch (wdev->iftype) {
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_P2P_CLIENT:
case NL80211_IFTYPE_MONITOR:
- wil_info(wil, "fw error recovery requested (try %d)...\n",
- wil->recovery_count);
- if (!no_fw_recovery)
- wil->recovery_state = fw_recovery_running;
- if (0 != wil_wait_for_recovery(wil))
- break;
-
+ /* silent recovery, upper layers will see disconnect */
__wil_down(wil);
__wil_up(wil);
break;
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 10/13] mailbox: always wait in mbox_send_message for blocking Tx mode
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
` (8 preceding siblings ...)
2017-07-25 20:07 ` [PATCH for-4.4 09/13] wil6210: fix deadlock when using fw_no_recovery option Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 11/13] mailbox: skip complete wait event if timer expired Amit Pundir
` (3 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Sudeep Holla, Jassi Brar
From: Sudeep Holla <sudeep.holla@arm.com>
commit c61b781ee084e69855477d23dd33e7e6caad652c upstream.
There exists a race when msg_submit return immediately as there was an
active request being processed which may have completed just before it's
checked again in mbox_send_message. This will result in return to the
caller without waiting in mbox_send_message even when it's blocking Tx.
This patch fixes the issue by waiting for the completion always if Tx
is in blocking mode.
Fixes: 2b6d83e2b8b7 ("mailbox: Introduce framework for mailbox")
Reported-by: Alexey Klimov <alexey.klimov@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Alexey Klimov <alexey.klimov@arm.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/mailbox/mailbox.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 6a4811f85705..6e03717318b0 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -261,7 +261,7 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)
msg_submit(chan);
- if (chan->cl->tx_block && chan->active_req) {
+ if (chan->cl->tx_block) {
unsigned long wait;
int ret;
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 11/13] mailbox: skip complete wait event if timer expired
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
` (9 preceding siblings ...)
2017-07-25 20:07 ` [PATCH for-4.4 10/13] mailbox: always wait in mbox_send_message for blocking Tx mode Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 12/13] mailbox: handle empty message in tx_tick Amit Pundir
` (2 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Sudeep Holla, Jassi Brar
From: Sudeep Holla <sudeep.holla@arm.com>
commit cc6eeaa3029a6dbcb4ad41b1f92876483bd88965 upstream.
If a wait_for_completion_timeout() call returns due to a timeout,
complete() can get called after returning from the wait which is
incorrect and can cause subsequent transmissions on a channel to fail.
Since the wait_for_completion_timeout() sees the completion variable
is non-zero caused by the erroneous/spurious complete() call, and
it immediately returns without waiting for the time as expected by the
client.
This patch fixes the issue by skipping complete() call for the timer
expiry.
Fixes: 2b6d83e2b8b7 ("mailbox: Introduce framework for mailbox")
Reported-by: Alexey Klimov <alexey.klimov@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/mailbox/mailbox.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 6e03717318b0..233af2ce9b8c 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -108,7 +108,7 @@ static void tx_tick(struct mbox_chan *chan, int r)
if (mssg && chan->cl->tx_done)
chan->cl->tx_done(chan->cl, mssg, r);
- if (chan->cl->tx_block)
+ if (r != -ETIME && chan->cl->tx_block)
complete(&chan->tx_complete);
}
@@ -272,8 +272,8 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)
ret = wait_for_completion_timeout(&chan->tx_complete, wait);
if (ret == 0) {
- t = -EIO;
- tx_tick(chan, -EIO);
+ t = -ETIME;
+ tx_tick(chan, t);
}
}
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 12/13] mailbox: handle empty message in tx_tick
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
` (10 preceding siblings ...)
2017-07-25 20:07 ` [PATCH for-4.4 11/13] mailbox: skip complete wait event if timer expired Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 13/13] af_key: Fix sadb_x_ipsecrequest parsing Amit Pundir
2017-08-03 22:24 ` [PATCH for-4.4 00/13] Stable candidates for 4.4.y Greg KH
13 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Sudeep Holla, Jassi Brar
From: Sudeep Holla <sudeep.holla@arm.com>
commit cb710ab1d8a23f68ff8f45aedf3e552bb90e70de upstream.
We already check if the message is empty before calling the client
tx_done callback. Calling completion on a wait event is also invalid
if the message is empty.
This patch moves the existing empty message check earlier.
Fixes: 2b6d83e2b8b7 ("mailbox: Introduce framework for mailbox")
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
drivers/mailbox/mailbox.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 233af2ce9b8c..9cf826df89b1 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -104,8 +104,11 @@ static void tx_tick(struct mbox_chan *chan, int r)
/* Submit next message */
msg_submit(chan);
+ if (!mssg)
+ return;
+
/* Notify the client */
- if (mssg && chan->cl->tx_done)
+ if (chan->cl->tx_done)
chan->cl->tx_done(chan->cl, mssg, r);
if (r != -ETIME && chan->cl->tx_block)
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH for-4.4 13/13] af_key: Fix sadb_x_ipsecrequest parsing
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
` (11 preceding siblings ...)
2017-07-25 20:07 ` [PATCH for-4.4 12/13] mailbox: handle empty message in tx_tick Amit Pundir
@ 2017-07-25 20:07 ` Amit Pundir
2017-07-26 5:02 ` Amit Pundir
2017-08-03 22:24 ` [PATCH for-4.4 00/13] Stable candidates for 4.4.y Greg KH
13 siblings, 1 reply; 17+ messages in thread
From: Amit Pundir @ 2017-07-25 20:07 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Herbert Xu, Steffen Klassert
From: Herbert Xu <herbert@gondor.apana.org.au>
commit 096f41d3a8fcbb8dde7f71379b1ca85fe213eded upstream.
The parsing of sadb_x_ipsecrequest is broken in a number of ways.
First of all we're not verifying sadb_x_ipsecrequest_len. This
is needed when the structure carries addresses at the end. Worse
we don't even look at the length when we parse those optional
addresses.
The migration code had similar parsing code that's better but
it also has some deficiencies. The length is overcounted first
of all as it includes the header itself. It also fails to check
the length before dereferencing the sa_family field.
This patch fixes those problems in parse_sockaddr_pair and then
uses it in parse_ipsecrequest.
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
net/key/af_key.c | 47 ++++++++++++++++++++++++++---------------------
1 file changed, 26 insertions(+), 21 deletions(-)
diff --git a/net/key/af_key.c b/net/key/af_key.c
index e67c28e614b9..d8d95b6415e4 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -65,6 +65,10 @@ struct pfkey_sock {
} dump;
};
+static int parse_sockaddr_pair(struct sockaddr *sa, int ext_len,
+ xfrm_address_t *saddr, xfrm_address_t *daddr,
+ u16 *family);
+
static inline struct pfkey_sock *pfkey_sk(struct sock *sk)
{
return (struct pfkey_sock *)sk;
@@ -1922,19 +1926,14 @@ parse_ipsecrequest(struct xfrm_policy *xp, struct sadb_x_ipsecrequest *rq)
/* addresses present only in tunnel mode */
if (t->mode == XFRM_MODE_TUNNEL) {
- u8 *sa = (u8 *) (rq + 1);
- int family, socklen;
+ int err;
- family = pfkey_sockaddr_extract((struct sockaddr *)sa,
- &t->saddr);
- if (!family)
- return -EINVAL;
-
- socklen = pfkey_sockaddr_len(family);
- if (pfkey_sockaddr_extract((struct sockaddr *)(sa + socklen),
- &t->id.daddr) != family)
- return -EINVAL;
- t->encap_family = family;
+ err = parse_sockaddr_pair(
+ (struct sockaddr *)(rq + 1),
+ rq->sadb_x_ipsecrequest_len - sizeof(*rq),
+ &t->saddr, &t->id.daddr, &t->encap_family);
+ if (err)
+ return err;
} else
t->encap_family = xp->family;
@@ -1954,7 +1953,11 @@ parse_ipsecrequests(struct xfrm_policy *xp, struct sadb_x_policy *pol)
if (pol->sadb_x_policy_len * 8 < sizeof(struct sadb_x_policy))
return -EINVAL;
- while (len >= sizeof(struct sadb_x_ipsecrequest)) {
+ while (len >= sizeof(*rq)) {
+ if (len < rq->sadb_x_ipsecrequest_len ||
+ rq->sadb_x_ipsecrequest_len < sizeof(*rq))
+ return -EINVAL;
+
if ((err = parse_ipsecrequest(xp, rq)) < 0)
return err;
len -= rq->sadb_x_ipsecrequest_len;
@@ -2417,7 +2420,6 @@ out:
return err;
}
-#ifdef CONFIG_NET_KEY_MIGRATE
static int pfkey_sockaddr_pair_size(sa_family_t family)
{
return PFKEY_ALIGN8(pfkey_sockaddr_len(family) * 2);
@@ -2429,7 +2431,7 @@ static int parse_sockaddr_pair(struct sockaddr *sa, int ext_len,
{
int af, socklen;
- if (ext_len < pfkey_sockaddr_pair_size(sa->sa_family))
+ if (ext_len < 2 || ext_len < pfkey_sockaddr_pair_size(sa->sa_family))
return -EINVAL;
af = pfkey_sockaddr_extract(sa, saddr);
@@ -2445,6 +2447,7 @@ static int parse_sockaddr_pair(struct sockaddr *sa, int ext_len,
return 0;
}
+#ifdef CONFIG_NET_KEY_MIGRATE
static int ipsecrequests_to_migrate(struct sadb_x_ipsecrequest *rq1, int len,
struct xfrm_migrate *m)
{
@@ -2452,13 +2455,14 @@ static int ipsecrequests_to_migrate(struct sadb_x_ipsecrequest *rq1, int len,
struct sadb_x_ipsecrequest *rq2;
int mode;
- if (len <= sizeof(struct sadb_x_ipsecrequest) ||
- len < rq1->sadb_x_ipsecrequest_len)
+ if (len < sizeof(*rq1) ||
+ len < rq1->sadb_x_ipsecrequest_len ||
+ rq1->sadb_x_ipsecrequest_len < sizeof(*rq1))
return -EINVAL;
/* old endoints */
err = parse_sockaddr_pair((struct sockaddr *)(rq1 + 1),
- rq1->sadb_x_ipsecrequest_len,
+ rq1->sadb_x_ipsecrequest_len - sizeof(*rq1),
&m->old_saddr, &m->old_daddr,
&m->old_family);
if (err)
@@ -2467,13 +2471,14 @@ static int ipsecrequests_to_migrate(struct sadb_x_ipsecrequest *rq1, int len,
rq2 = (struct sadb_x_ipsecrequest *)((u8 *)rq1 + rq1->sadb_x_ipsecrequest_len);
len -= rq1->sadb_x_ipsecrequest_len;
- if (len <= sizeof(struct sadb_x_ipsecrequest) ||
- len < rq2->sadb_x_ipsecrequest_len)
+ if (len <= sizeof(*rq2) ||
+ len < rq2->sadb_x_ipsecrequest_len ||
+ rq2->sadb_x_ipsecrequest_len < sizeof(*rq2))
return -EINVAL;
/* new endpoints */
err = parse_sockaddr_pair((struct sockaddr *)(rq2 + 1),
- rq2->sadb_x_ipsecrequest_len,
+ rq2->sadb_x_ipsecrequest_len - sizeof(*rq2),
&m->new_saddr, &m->new_daddr,
&m->new_family);
if (err)
--
2.7.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH for-4.4 13/13] af_key: Fix sadb_x_ipsecrequest parsing
2017-07-25 20:07 ` [PATCH for-4.4 13/13] af_key: Fix sadb_x_ipsecrequest parsing Amit Pundir
@ 2017-07-26 5:02 ` Amit Pundir
0 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-26 5:02 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Herbert Xu, Steffen Klassert
Please ignore this one. This patch is already in your stable queue.
Regards,
Amit Pundir
On 26 July 2017 at 01:37, Amit Pundir <amit.pundir@linaro.org> wrote:
> From: Herbert Xu <herbert@gondor.apana.org.au>
>
> commit 096f41d3a8fcbb8dde7f71379b1ca85fe213eded upstream.
>
> The parsing of sadb_x_ipsecrequest is broken in a number of ways.
> First of all we're not verifying sadb_x_ipsecrequest_len. This
> is needed when the structure carries addresses at the end. Worse
> we don't even look at the length when we parse those optional
> addresses.
>
> The migration code had similar parsing code that's better but
> it also has some deficiencies. The length is overcounted first
> of all as it includes the header itself. It also fails to check
> the length before dereferencing the sa_family field.
>
> This patch fixes those problems in parse_sockaddr_pair and then
> uses it in parse_ipsecrequest.
>
> Reported-by: Andrey Konovalov <andreyknvl@google.com>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
> Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
> ---
> net/key/af_key.c | 47 ++++++++++++++++++++++++++---------------------
> 1 file changed, 26 insertions(+), 21 deletions(-)
>
> diff --git a/net/key/af_key.c b/net/key/af_key.c
> index e67c28e614b9..d8d95b6415e4 100644
> --- a/net/key/af_key.c
> +++ b/net/key/af_key.c
> @@ -65,6 +65,10 @@ struct pfkey_sock {
> } dump;
> };
>
> +static int parse_sockaddr_pair(struct sockaddr *sa, int ext_len,
> + xfrm_address_t *saddr, xfrm_address_t *daddr,
> + u16 *family);
> +
> static inline struct pfkey_sock *pfkey_sk(struct sock *sk)
> {
> return (struct pfkey_sock *)sk;
> @@ -1922,19 +1926,14 @@ parse_ipsecrequest(struct xfrm_policy *xp, struct sadb_x_ipsecrequest *rq)
>
> /* addresses present only in tunnel mode */
> if (t->mode == XFRM_MODE_TUNNEL) {
> - u8 *sa = (u8 *) (rq + 1);
> - int family, socklen;
> + int err;
>
> - family = pfkey_sockaddr_extract((struct sockaddr *)sa,
> - &t->saddr);
> - if (!family)
> - return -EINVAL;
> -
> - socklen = pfkey_sockaddr_len(family);
> - if (pfkey_sockaddr_extract((struct sockaddr *)(sa + socklen),
> - &t->id.daddr) != family)
> - return -EINVAL;
> - t->encap_family = family;
> + err = parse_sockaddr_pair(
> + (struct sockaddr *)(rq + 1),
> + rq->sadb_x_ipsecrequest_len - sizeof(*rq),
> + &t->saddr, &t->id.daddr, &t->encap_family);
> + if (err)
> + return err;
> } else
> t->encap_family = xp->family;
>
> @@ -1954,7 +1953,11 @@ parse_ipsecrequests(struct xfrm_policy *xp, struct sadb_x_policy *pol)
> if (pol->sadb_x_policy_len * 8 < sizeof(struct sadb_x_policy))
> return -EINVAL;
>
> - while (len >= sizeof(struct sadb_x_ipsecrequest)) {
> + while (len >= sizeof(*rq)) {
> + if (len < rq->sadb_x_ipsecrequest_len ||
> + rq->sadb_x_ipsecrequest_len < sizeof(*rq))
> + return -EINVAL;
> +
> if ((err = parse_ipsecrequest(xp, rq)) < 0)
> return err;
> len -= rq->sadb_x_ipsecrequest_len;
> @@ -2417,7 +2420,6 @@ out:
> return err;
> }
>
> -#ifdef CONFIG_NET_KEY_MIGRATE
> static int pfkey_sockaddr_pair_size(sa_family_t family)
> {
> return PFKEY_ALIGN8(pfkey_sockaddr_len(family) * 2);
> @@ -2429,7 +2431,7 @@ static int parse_sockaddr_pair(struct sockaddr *sa, int ext_len,
> {
> int af, socklen;
>
> - if (ext_len < pfkey_sockaddr_pair_size(sa->sa_family))
> + if (ext_len < 2 || ext_len < pfkey_sockaddr_pair_size(sa->sa_family))
> return -EINVAL;
>
> af = pfkey_sockaddr_extract(sa, saddr);
> @@ -2445,6 +2447,7 @@ static int parse_sockaddr_pair(struct sockaddr *sa, int ext_len,
> return 0;
> }
>
> +#ifdef CONFIG_NET_KEY_MIGRATE
> static int ipsecrequests_to_migrate(struct sadb_x_ipsecrequest *rq1, int len,
> struct xfrm_migrate *m)
> {
> @@ -2452,13 +2455,14 @@ static int ipsecrequests_to_migrate(struct sadb_x_ipsecrequest *rq1, int len,
> struct sadb_x_ipsecrequest *rq2;
> int mode;
>
> - if (len <= sizeof(struct sadb_x_ipsecrequest) ||
> - len < rq1->sadb_x_ipsecrequest_len)
> + if (len < sizeof(*rq1) ||
> + len < rq1->sadb_x_ipsecrequest_len ||
> + rq1->sadb_x_ipsecrequest_len < sizeof(*rq1))
> return -EINVAL;
>
> /* old endoints */
> err = parse_sockaddr_pair((struct sockaddr *)(rq1 + 1),
> - rq1->sadb_x_ipsecrequest_len,
> + rq1->sadb_x_ipsecrequest_len - sizeof(*rq1),
> &m->old_saddr, &m->old_daddr,
> &m->old_family);
> if (err)
> @@ -2467,13 +2471,14 @@ static int ipsecrequests_to_migrate(struct sadb_x_ipsecrequest *rq1, int len,
> rq2 = (struct sadb_x_ipsecrequest *)((u8 *)rq1 + rq1->sadb_x_ipsecrequest_len);
> len -= rq1->sadb_x_ipsecrequest_len;
>
> - if (len <= sizeof(struct sadb_x_ipsecrequest) ||
> - len < rq2->sadb_x_ipsecrequest_len)
> + if (len <= sizeof(*rq2) ||
> + len < rq2->sadb_x_ipsecrequest_len ||
> + rq2->sadb_x_ipsecrequest_len < sizeof(*rq2))
> return -EINVAL;
>
> /* new endpoints */
> err = parse_sockaddr_pair((struct sockaddr *)(rq2 + 1),
> - rq2->sadb_x_ipsecrequest_len,
> + rq2->sadb_x_ipsecrequest_len - sizeof(*rq2),
> &m->new_saddr, &m->new_daddr,
> &m->new_family);
> if (err)
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH for-4.4 01/13] ppp: take reference on channels netns
2017-07-25 20:07 ` [PATCH for-4.4 01/13] ppp: take reference on channels netns Amit Pundir
@ 2017-07-26 5:10 ` Amit Pundir
0 siblings, 0 replies; 17+ messages in thread
From: Amit Pundir @ 2017-07-26 5:10 UTC (permalink / raw)
To: Greg KH; +Cc: Stable, Guillaume Nault, David S . Miller
Please ignore this one. This patch already got included in 4.4.8.
Somehow cherry-pick didn't pick up on that.
Regards,
Amit Pundir
On 26 July 2017 at 01:37, Amit Pundir <amit.pundir@linaro.org> wrote:
> From: Guillaume Nault <g.nault@alphalink.fr>
>
> commit 1f461dcdd296eecedaffffc6bae2bfa90bd7eb89 upstream.
>
> Let channels hold a reference on their network namespace.
> Some channel types, like ppp_async and ppp_synctty, can have their
> userspace controller running in a different namespace. Therefore they
> can't rely on them to preclude their netns from being removed from
> under them.
>
> ==================================================================
> BUG: KASAN: use-after-free in ppp_unregister_channel+0x372/0x3a0 at
> addr ffff880064e217e0
> Read of size 8 by task syz-executor/11581
> =============================================================================
> BUG net_namespace (Not tainted): kasan: bad access detected
> -----------------------------------------------------------------------------
>
> Disabling lock debugging due to kernel taint
> INFO: Allocated in copy_net_ns+0x6b/0x1a0 age=92569 cpu=3 pid=6906
> [< none >] ___slab_alloc+0x4c7/0x500 kernel/mm/slub.c:2440
> [< none >] __slab_alloc+0x4c/0x90 kernel/mm/slub.c:2469
> [< inline >] slab_alloc_node kernel/mm/slub.c:2532
> [< inline >] slab_alloc kernel/mm/slub.c:2574
> [< none >] kmem_cache_alloc+0x23a/0x2b0 kernel/mm/slub.c:2579
> [< inline >] kmem_cache_zalloc kernel/include/linux/slab.h:597
> [< inline >] net_alloc kernel/net/core/net_namespace.c:325
> [< none >] copy_net_ns+0x6b/0x1a0 kernel/net/core/net_namespace.c:360
> [< none >] create_new_namespaces+0x2f6/0x610 kernel/kernel/nsproxy.c:95
> [< none >] copy_namespaces+0x297/0x320 kernel/kernel/nsproxy.c:150
> [< none >] copy_process.part.35+0x1bf4/0x5760 kernel/kernel/fork.c:1451
> [< inline >] copy_process kernel/kernel/fork.c:1274
> [< none >] _do_fork+0x1bc/0xcb0 kernel/kernel/fork.c:1723
> [< inline >] SYSC_clone kernel/kernel/fork.c:1832
> [< none >] SyS_clone+0x37/0x50 kernel/kernel/fork.c:1826
> [< none >] entry_SYSCALL_64_fastpath+0x16/0x7a kernel/arch/x86/entry/entry_64.S:185
>
> INFO: Freed in net_drop_ns+0x67/0x80 age=575 cpu=2 pid=2631
> [< none >] __slab_free+0x1fc/0x320 kernel/mm/slub.c:2650
> [< inline >] slab_free kernel/mm/slub.c:2805
> [< none >] kmem_cache_free+0x2a0/0x330 kernel/mm/slub.c:2814
> [< inline >] net_free kernel/net/core/net_namespace.c:341
> [< none >] net_drop_ns+0x67/0x80 kernel/net/core/net_namespace.c:348
> [< none >] cleanup_net+0x4e5/0x600 kernel/net/core/net_namespace.c:448
> [< none >] process_one_work+0x794/0x1440 kernel/kernel/workqueue.c:2036
> [< none >] worker_thread+0xdb/0xfc0 kernel/kernel/workqueue.c:2170
> [< none >] kthread+0x23f/0x2d0 kernel/drivers/block/aoe/aoecmd.c:1303
> [< none >] ret_from_fork+0x3f/0x70 kernel/arch/x86/entry/entry_64.S:468
> INFO: Slab 0xffffea0001938800 objects=3 used=0 fp=0xffff880064e20000
> flags=0x5fffc0000004080
> INFO: Object 0xffff880064e20000 @offset=0 fp=0xffff880064e24200
>
> CPU: 1 PID: 11581 Comm: syz-executor Tainted: G B 4.4.0+
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
> 00000000ffffffff ffff8800662c7790 ffffffff8292049d ffff88003e36a300
> ffff880064e20000 ffff880064e20000 ffff8800662c77c0 ffffffff816f2054
> ffff88003e36a300 ffffea0001938800 ffff880064e20000 0000000000000000
> Call Trace:
> [< inline >] __dump_stack kernel/lib/dump_stack.c:15
> [<ffffffff8292049d>] dump_stack+0x6f/0xa2 kernel/lib/dump_stack.c:50
> [<ffffffff816f2054>] print_trailer+0xf4/0x150 kernel/mm/slub.c:654
> [<ffffffff816f875f>] object_err+0x2f/0x40 kernel/mm/slub.c:661
> [< inline >] print_address_description kernel/mm/kasan/report.c:138
> [<ffffffff816fb0c5>] kasan_report_error+0x215/0x530 kernel/mm/kasan/report.c:236
> [< inline >] kasan_report kernel/mm/kasan/report.c:259
> [<ffffffff816fb4de>] __asan_report_load8_noabort+0x3e/0x40 kernel/mm/kasan/report.c:280
> [< inline >] ? ppp_pernet kernel/include/linux/compiler.h:218
> [<ffffffff83ad71b2>] ? ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
> [< inline >] ppp_pernet kernel/include/linux/compiler.h:218
> [<ffffffff83ad71b2>] ppp_unregister_channel+0x372/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
> [< inline >] ? ppp_pernet kernel/drivers/net/ppp/ppp_generic.c:293
> [<ffffffff83ad6f26>] ? ppp_unregister_channel+0xe6/0x3a0 kernel/drivers/net/ppp/ppp_generic.c:2392
> [<ffffffff83ae18f3>] ppp_asynctty_close+0xa3/0x130 kernel/drivers/net/ppp/ppp_async.c:241
> [<ffffffff83ae1850>] ? async_lcp_peek+0x5b0/0x5b0 kernel/drivers/net/ppp/ppp_async.c:1000
> [<ffffffff82c33239>] tty_ldisc_close.isra.1+0x99/0xe0 kernel/drivers/tty/tty_ldisc.c:478
> [<ffffffff82c332c0>] tty_ldisc_kill+0x40/0x170 kernel/drivers/tty/tty_ldisc.c:744
> [<ffffffff82c34943>] tty_ldisc_release+0x1b3/0x260 kernel/drivers/tty/tty_ldisc.c:772
> [<ffffffff82c1ef21>] tty_release+0xac1/0x13e0 kernel/drivers/tty/tty_io.c:1901
> [<ffffffff82c1e460>] ? release_tty+0x320/0x320 kernel/drivers/tty/tty_io.c:1688
> [<ffffffff8174de36>] __fput+0x236/0x780 kernel/fs/file_table.c:208
> [<ffffffff8174e405>] ____fput+0x15/0x20 kernel/fs/file_table.c:244
> [<ffffffff813595ab>] task_work_run+0x16b/0x200 kernel/kernel/task_work.c:115
> [< inline >] exit_task_work kernel/include/linux/task_work.h:21
> [<ffffffff81307105>] do_exit+0x8b5/0x2c60 kernel/kernel/exit.c:750
> [<ffffffff813fdd20>] ? debug_check_no_locks_freed+0x290/0x290 kernel/kernel/locking/lockdep.c:4123
> [<ffffffff81306850>] ? mm_update_next_owner+0x6f0/0x6f0 kernel/kernel/exit.c:357
> [<ffffffff813215e6>] ? __dequeue_signal+0x136/0x470 kernel/kernel/signal.c:550
> [<ffffffff8132067b>] ? recalc_sigpending_tsk+0x13b/0x180 kernel/kernel/signal.c:145
> [<ffffffff81309628>] do_group_exit+0x108/0x330 kernel/kernel/exit.c:880
> [<ffffffff8132b9d4>] get_signal+0x5e4/0x14f0 kernel/kernel/signal.c:2307
> [< inline >] ? kretprobe_table_lock kernel/kernel/kprobes.c:1113
> [<ffffffff8151d355>] ? kprobe_flush_task+0xb5/0x450 kernel/kernel/kprobes.c:1158
> [<ffffffff8115f7d3>] do_signal+0x83/0x1c90 kernel/arch/x86/kernel/signal.c:712
> [<ffffffff8151d2a0>] ? recycle_rp_inst+0x310/0x310 kernel/include/linux/list.h:655
> [<ffffffff8115f750>] ? setup_sigcontext+0x780/0x780 kernel/arch/x86/kernel/signal.c:165
> [<ffffffff81380864>] ? finish_task_switch+0x424/0x5f0 kernel/kernel/sched/core.c:2692
> [< inline >] ? finish_lock_switch kernel/kernel/sched/sched.h:1099
> [<ffffffff81380560>] ? finish_task_switch+0x120/0x5f0 kernel/kernel/sched/core.c:2678
> [< inline >] ? context_switch kernel/kernel/sched/core.c:2807
> [<ffffffff85d794e9>] ? __schedule+0x919/0x1bd0 kernel/kernel/sched/core.c:3283
> [<ffffffff81003901>] exit_to_usermode_loop+0xf1/0x1a0 kernel/arch/x86/entry/common.c:247
> [< inline >] prepare_exit_to_usermode kernel/arch/x86/entry/common.c:282
> [<ffffffff810062ef>] syscall_return_slowpath+0x19f/0x210 kernel/arch/x86/entry/common.c:344
> [<ffffffff85d88022>] int_ret_from_sys_call+0x25/0x9f kernel/arch/x86/entry/entry_64.S:281
> Memory state around the buggy address:
> ffff880064e21680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff880064e21700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>>ffff880064e21780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ^
> ffff880064e21800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff880064e21880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ==================================================================
>
> Fixes: 273ec51dd7ce ("net: ppp_generic - introduce net-namespace functionality v2")
> Reported-by: Baozeng Ding <sploving1@gmail.com>
> Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
> Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
> ---
> drivers/net/ppp/ppp_generic.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
> index e5bb870b5461..fa76ca128e1b 100644
> --- a/drivers/net/ppp/ppp_generic.c
> +++ b/drivers/net/ppp/ppp_generic.c
> @@ -2390,6 +2390,8 @@ ppp_unregister_channel(struct ppp_channel *chan)
> spin_lock_bh(&pn->all_channels_lock);
> list_del(&pch->list);
> spin_unlock_bh(&pn->all_channels_lock);
> + put_net(pch->chan_net);
> + pch->chan_net = NULL;
>
> pch->file.dead = 1;
> wake_up_interruptible(&pch->file.rwait);
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH for-4.4 00/13] Stable candidates for 4.4.y
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
` (12 preceding siblings ...)
2017-07-25 20:07 ` [PATCH for-4.4 13/13] af_key: Fix sadb_x_ipsecrequest parsing Amit Pundir
@ 2017-08-03 22:24 ` Greg KH
13 siblings, 0 replies; 17+ messages in thread
From: Greg KH @ 2017-08-03 22:24 UTC (permalink / raw)
To: Amit Pundir; +Cc: Stable
On Wed, Jul 26, 2017 at 01:37:08AM +0530, Amit Pundir wrote:
> Hi Greg,
>
> Few stable candidates for 4.4.y for your consideration.
> Cherry-picked and build tested on Linux v4.4.78 for
> ARCH=arm/arm64 + allmodconfig.
>
> Few fixes are applicable for 3.18.y as well and I'll submit
> them along with other fixes shortly in a separate thread.
All now applied, thanks!
greg k-h
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2017-08-03 22:25 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25 20:07 [PATCH for-4.4 00/13] Stable candidates for 4.4.y Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 01/13] ppp: take reference on channels netns Amit Pundir
2017-07-26 5:10 ` Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 02/13] mpt3sas: Don't overreach ioc->reply_post[] during initialization Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 03/13] kaweth: fix firmware download Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 04/13] kaweth: fix oops upon failed memory allocation Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 05/13] net: phy: Do not perform software reset for Generic PHY Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 06/13] nfc: fdp: fix NULL pointer dereference Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 07/13] isdn: Fix a sleep-in-atomic bug Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 08/13] ath10k: fix null deref on wmi-tlv when trying spectral scan Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 09/13] wil6210: fix deadlock when using fw_no_recovery option Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 10/13] mailbox: always wait in mbox_send_message for blocking Tx mode Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 11/13] mailbox: skip complete wait event if timer expired Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 12/13] mailbox: handle empty message in tx_tick Amit Pundir
2017-07-25 20:07 ` [PATCH for-4.4 13/13] af_key: Fix sadb_x_ipsecrequest parsing Amit Pundir
2017-07-26 5:02 ` Amit Pundir
2017-08-03 22:24 ` [PATCH for-4.4 00/13] Stable candidates for 4.4.y Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).