linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, John David Anglin <dave.anglin@bell.net>,
	Helge Deller <deller@gmx.de>
Subject: [PATCH 4.9 01/93] parisc: Handle vmas whose context is not current in flush_cache_range
Date: Wed,  9 Aug 2017 11:12:54 -0700	[thread overview]
Message-ID: <20170809181335.714925211@linuxfoundation.org> (raw)
In-Reply-To: <20170809181335.658857427@linuxfoundation.org>

4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: John David Anglin <dave.anglin@bell.net>

commit 13d57093c141db2036364d6be35e394fc5b64728 upstream.

In testing James' patch to drivers/parisc/pdc_stable.c, I hit the BUG
statement in flush_cache_range() during a system shutdown:

kernel BUG at arch/parisc/kernel/cache.c:595!
CPU: 2 PID: 6532 Comm: kworker/2:0 Not tainted 4.13.0-rc2+ #1
Workqueue: events free_ioctx

 IAOQ[0]: flush_cache_range+0x144/0x148
 IAOQ[1]: flush_cache_page+0x0/0x1a8
 RP(r2): flush_cache_range+0xec/0x148
Backtrace:
 [<00000000402910ac>] unmap_page_range+0x84/0x880
 [<00000000402918f4>] unmap_single_vma+0x4c/0x60
 [<0000000040291a18>] zap_page_range_single+0x110/0x160
 [<0000000040291c34>] unmap_mapping_range+0x174/0x1a8
 [<000000004026ccd8>] truncate_pagecache+0x50/0xa8
 [<000000004026cd84>] truncate_setsize+0x54/0x70
 [<000000004033d534>] put_aio_ring_file+0x44/0xb0
 [<000000004033d5d8>] aio_free_ring+0x38/0x140
 [<000000004033d714>] free_ioctx+0x34/0xa8
 [<00000000401b0028>] process_one_work+0x1b8/0x4d0
 [<00000000401b04f4>] worker_thread+0x1b4/0x648
 [<00000000401b9128>] kthread+0x1b0/0x208
 [<0000000040150020>] end_fault_vector+0x20/0x28
 [<0000000040639518>] nf_ip_reroute+0x50/0xa8
 [<0000000040638ed0>] nf_ip_route+0x10/0x78
 [<0000000040638c90>] xfrm4_mode_tunnel_input+0x180/0x1f8

CPU: 2 PID: 6532 Comm: kworker/2:0 Not tainted 4.13.0-rc2+ #1
Workqueue: events free_ioctx
Backtrace:
 [<0000000040163bf0>] show_stack+0x20/0x38
 [<0000000040688480>] dump_stack+0xa8/0x120
 [<0000000040163dc4>] die_if_kernel+0x19c/0x2b0
 [<0000000040164d0c>] handle_interruption+0xa24/0xa48

This patch modifies flush_cache_range() to handle non current contexts.
In as much as this occurs infrequently, the simplest approach is to
flush the entire cache when this happens.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/parisc/kernel/cache.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -604,13 +604,12 @@ void flush_cache_range(struct vm_area_st
 	if (parisc_requires_coherency())
 		flush_tlb_range(vma, start, end);
 
-	if ((end - start) >= parisc_cache_flush_threshold) {
+	if ((end - start) >= parisc_cache_flush_threshold
+	    || vma->vm_mm->context != mfsp(3)) {
 		flush_cache_all();
 		return;
 	}
 
-	BUG_ON(vma->vm_mm->context != mfsp(3));
-
 	flush_user_dcache_range_asm(start, end);
 	if (vma->vm_flags & VM_EXEC)
 		flush_user_icache_range_asm(start, end);

  reply	other threads:[~2017-08-09 18:14 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09 18:12 [PATCH 4.9 00/93] 4.9.42-stable review Greg Kroah-Hartman
2017-08-09 18:12 ` Greg Kroah-Hartman [this message]
2017-08-09 18:12 ` [PATCH 4.9 02/93] cgroup: create dfl_root files on subsys registration Greg Kroah-Hartman
2017-08-09 18:12 ` [PATCH 4.9 03/93] cgroup: fix error return value from cgroup_subtree_control() Greg Kroah-Hartman
2017-08-09 18:12 ` [PATCH 4.9 04/93] libata: array underflow in ata_find_dev() Greg Kroah-Hartman
2017-08-09 18:12 ` [PATCH 4.9 05/93] workqueue: restore WQ_UNBOUND/max_active==1 to be ordered Greg Kroah-Hartman
2017-08-09 18:12 ` [PATCH 4.9 06/93] iwlwifi: dvm: prevent an out of bounds access Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 07/93] brcmfmac: fix memleak due to calling brcmf_sdiod_sgtable_alloc() twice Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 08/93] NFSv4: Fix EXCHANGE_ID corrupt verifier issue Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 09/93] mmc: sdhci-of-at91: force card detect value for non removable devices Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 10/93] device property: Make dev_fwnode() public Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 11/93] mmc: core: Fix access to HS400-ES devices Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 12/93] mm, mprotect: flush TLB if potentially racing with a parallel reclaim leaving stale TLB entries Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 13/93] cpuset: fix a deadlock due to incomplete patching of cpusets_enabled() Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 14/93] ALSA: hda - Fix speaker output from VAIO VPCL14M1R Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 16/93] ASoC: do not close shared backend dailink Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 18/93] mm/page_alloc: Remove kernel address exposure in free_reserved_area() Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 19/93] timers: Fix overflow in get_next_timer_interrupt Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 20/93] powerpc/tm: Fix saving of TM SPRs in core dump Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 21/93] powerpc/64: Fix __check_irq_replay missing decrementer interrupt Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 22/93] iommu/amd: Enable ga_log_intr when enabling guest_mode Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 23/93] gpiolib: skip unwanted events, dont convert them to opposite edge Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 24/93] ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 25/93] ext4: fix overflow caused by missing cast in ext4_resize_fs() Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 26/93] ARM: dts: armada-38x: Fix irq type for pca955 Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 27/93] ARM: dts: tango4: Request RGMII RX and TX clock delays Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 28/93] media: platform: davinci: return -EINVAL for VPFE_CMD_S_CCDC_RAW_PARAMS ioctl Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 29/93] iscsi-target: Fix initial login PDU asynchronous socket close OOPs Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 30/93] mmc: dw_mmc: Use device_property_read instead of of_property_read Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 31/93] mmc: core: " Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 32/93] media: lirc: LIRC_GET_REC_RESOLUTION should return microseconds Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 33/93] f2fs: sanity check checkpoint segno and blkoff Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 34/93] Btrfs: fix early ENOSPC due to delalloc Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 35/93] [media] saa7164: fix double fetch PCIe access condition Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 36/93] tcp_bbr: cut pacing rate only if filled pipe Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 37/93] tcp_bbr: introduce bbr_bw_to_pacing_rate() helper Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 38/93] tcp_bbr: introduce bbr_init_pacing_rate_from_rtt() helper Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 39/93] tcp_bbr: remove sk_pacing_rate=0 transient during init Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 40/93] tcp_bbr: init pacing rate on first RTT sample Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 41/93] ipv4: ipv6: initialize treq->txhash in cookie_v[46]_check() Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 42/93] net: Zero terminate ifr_name in dev_ifname() Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 43/93] ipv6: avoid overflow of offset in ip6_find_1stfragopt Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 44/93] net: dsa: b53: Add missing ARL entries for BCM53125 Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 45/93] ipv4: initialize fib_trie prior to register_netdev_notifier call Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 46/93] rtnetlink: allocate more memory for dev_set_mac_address() Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 47/93] mcs7780: Fix initialization when CONFIG_VMAP_STACK is enabled Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 48/93] openvswitch: fix potential out of bound access in parse_ct Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 49/93] packet: fix use-after-free in prb_retire_rx_blk_timer_expired() Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 50/93] ipv6: Dont increase IPSTATS_MIB_FRAGFAILS twice in ip6_fragment() Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 51/93] net: ethernet: nb8800: Handle all 4 RGMII modes identically Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 52/93] dccp: fix a memleak that dccp_ipv6 doesnt put reqsk properly Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 53/93] dccp: fix a memleak that dccp_ipv4 " Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 54/93] dccp: fix a memleak for dccp_feat_init err process Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 55/93] sctp: dont dereference ptr before leaving _sctp_walk_{params, errors}() Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 56/93] sctp: fix the check for _sctp_walk_params and _sctp_walk_errors Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 57/93] net/mlx5: Consider tx_enabled in all modes on remap Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 58/93] net/mlx5: Fix command bad flow on command entry allocation failure Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 59/93] net/mlx5e: Fix outer_header_zero() check size Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 60/93] net/mlx5e: Fix wrong delay calculation for overflow check scheduling Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 61/93] net/mlx5e: Schedule overflow check work to mlx5e workqueue Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 62/93] net: phy: Correctly process PHY_HALTED in phy_stop_machine() Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 63/93] xen-netback: correctly schedule rate-limited queues Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 64/93] sparc64: Measure receiver forward progress to avoid send mondo timeout Greg Kroah-Hartman
2017-08-09 18:13 ` [PATCH 4.9 65/93] sparc64: Prevent perf from running during super critical sections Greg Kroah-Hartman
2017-08-10 16:20   ` Greg Kroah-Hartman
2017-08-10 16:45     ` David Miller
2017-08-11  5:00     ` David Miller
2017-08-11 19:33       ` Greg KH
2017-08-09 18:13 ` [PATCH 4.9 66/93] sparc64: Fix exception handling in UltraSPARC-III memcpy Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 67/93] wext: handle NULL extra data in iwe_stream_add_point better Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 68/93] sh_eth: fix EESIPR values for SH77{34|63} Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 69/93] sh_eth: R8A7740 supports packet shecksumming Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 70/93] net: phy: dp83867: fix irq generation Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 71/93] tg3: Fix race condition in tg3_get_stats64() Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 72/93] x86/boot: Add missing declaration of string functions Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 73/93] spi: spi-axi: Free resources on error path Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 74/93] ASoC: rt5645: set sel_i2s_pre_div1 to 2 Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 75/93] netfilter: use fwmark_reflect in nf_send_reset Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 76/93] phy state machine: failsafe leave invalid RUNNING state Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 77/93] ipv4: make tcp_notsent_lowat sysctl knob behave as true unsigned int Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 78/93] clk/samsung: exynos542x: mark some clocks as critical Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 79/93] scsi: qla2xxx: Get mutex lock before checking optrom_state Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 80/93] drm/virtio: fix framebuffer sparse warning Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 81/93] ARM: dts: sun8i: Support DTB build for NanoPi M1 Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 82/93] ARM: dts: sunxi: Change node name for pwrseq pin on Olinuxino-lime2-emmc Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 83/93] iw_cxgb4: do not send RX_DATA_ACK CPLs after close/abort Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 84/93] nbd: blk_mq_init_queue returns an error code on failure, not NULL Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 85/93] virtio_blk: fix panic in initialization error path Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 86/93] ARM: 8632/1: ftrace: fix syscall name matching Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 87/93] mm, slab: make sure that KMALLOC_MAX_SIZE will fit into MAX_ORDER Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 88/93] lib/Kconfig.debug: fix frv build failure Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 89/93] signal: protect SIGNAL_UNKILLABLE from unintentional clearing Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 90/93] mm: dont dereference struct page fields of invalid pages Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 91/93] net/mlx5: E-Switch, Re-enable RoCE on mode change only after FDB destroy Greg Kroah-Hartman
2017-08-09 18:14 ` [PATCH 4.9 92/93] ipv4: Should use consistent conditional judgement for ip fragment in __ip_append_data and ip_finish_output Greg Kroah-Hartman
2017-08-10  0:15 ` [PATCH 4.9 00/93] 4.9.42-stable review Shuah Khan
2017-08-10  0:41 ` Guenter Roeck
2017-08-10  3:04 ` Sumit Semwal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170809181335.714925211@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=dave.anglin@bell.net \
    --cc=deller@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).