Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1357490

[PATCH 4.4 47/50] MIPS: smp.c: Fix uninitialised temp_foreign_map

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.4 47/50] MIPS: smp.c: Fix uninitialised temp_foreign_map
Date 2016-03-14 19:10 +0100
Message-ID <rcF6k-7mS-55@gated-at.bofh.it> (permalink)
References <rcEWC-73F-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

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

From: James Hogan <james.hogan@imgtec.com>

commit d825c06bfe8b885b797f917ad47365d0e9c21fbb upstream.

When calculate_cpu_foreign_map() recalculates the cpu_foreign_map
cpumask it uses the local variable temp_foreign_map without initialising
it to zero. Since the calculation only ever sets bits in this cpumask
any existing bits at that memory location will remain set and find their
way into cpu_foreign_map too. This could potentially lead to cache
operations suboptimally doing smp calls to multiple VPEs in the same
core, even though the VPEs share primary caches.

Therefore initialise temp_foreign_map using cpumask_clear() before use.

Fixes: cccf34e9411c ("MIPS: c-r4k: Fix cache flushing for MT cores")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/12759/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/kernel/smp.c |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -121,6 +121,7 @@ static inline void calculate_cpu_foreign
 	cpumask_t temp_foreign_map;
 
 	/* Re-calculate the mask */
+	cpumask_clear(&temp_foreign_map);
 	for_each_online_cpu(i) {
 		core_present = 0;
 		for_each_cpu(k, &temp_foreign_map)

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.4 00/50] 4.4.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:10 +0100
  [PATCH 4.4 11/50] KVM: MMU: fix reserved bit check for ept=0/CR0.WP=0/CR4.SMEP=1/EFER.NX=0 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:10 +0100
  [PATCH 4.4 47/50] MIPS: smp.c: Fix uninitialised temp_foreign_map Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:10 +0100
  [PATCH 4.4 10/50] KVM: MMU: fix ept=0/pte.u=1/pte.w=0/CR0.WP=0/CR4.SMEP=1/EFER.NX=0 combo Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:10 +0100
  [PATCH 4.4 14/50] tracing: Fix check for cpu online when event is disabled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:10 +0100
  [PATCH 4.4 39/50] Revert "drm/radeon/pm: adjust display configuration after powerstate" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 30/50] mac80211: minstrel_ht: set default tx aggregation timeout to 0 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 21/50] ASoC: wm8958: Fix enum ctl accesses in a wrong type Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 27/50] iwlwifi: mvm: inc pending frames counter also when txing non-sta Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 43/50] userfaultfd: dont block on the last VM updates at exit time Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 32/50] mac80211: check PN correctly for GCMP-encrypted fragmented MPDUs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 26/50] can: gs_usb: fixed disconnect bug by removing erroneous use of kfree() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 40/50] powerpc: Fix dedotify for binutils >= 2.26 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 28/50] mac80211: minstrel: Change expected throughput unit back to Kbps Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 33/50] mac80211: Fix Public Action frame RX in AP mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 41/50] powerpc/powernv: Add a kmsg_dumper that flushes console output on panic Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 29/50] mac80211: fix use of uninitialised values in RX aggregation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 22/50] ovl: ignore lower entries when checking purity of non-directory entries Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 04/50] ARM: OMAP2+: hwmod: Introduce ti,no-idle dt property Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 45/50] ovl: fix getcwd() failure after unsuccessful rmdir Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 23/50] ovl: fix working on distributed fs as lower layer Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 03/50] ARM: dts: dra7: do not gate cpsw clock due to errata i877 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 02/50] ARM: mvebu: fix overlap of Crypto SRAM with PCIe memory window Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 24/50] wext: fix message delay/ordering Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 06/50] kvm: cap halt polling at exactly halt_poll_ns Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 44/50] ovl: copy new uid/gid into overlayfs runtime inode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 35/50] x86/mm: Fix slow_virt_to_phys() for X86_PAE again Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 42/50] powerpc/powernv: Fix OPAL_CONSOLE_FLUSH prototype and usages Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 34/50] gpu: ipu-v3: Do not bail out on missing optional port nodes Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:20 +0100
  [PATCH 4.4 15/50] dmaengine: at_xdmac: fix residue computation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:30 +0100
  [PATCH 4.4 25/50] cfg80211/wext: fix message ordering Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:30 +0100
  [PATCH 4.4 20/50] ASoC: wm8994: Fix enum ctl accesses in a wrong type Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:30 +0100
  [PATCH 4.4 19/50] ASoC: samsung: Use IRQ safe spin lock calls Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-14 19:30 +0100
  Re: [PATCH 4.4 00/50] 4.4.6-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-03-15 00:20 +0100
    Re: [PATCH 4.4 00/50] 4.4.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-16 16:50 +0100
  Re: [PATCH 4.4 00/50] 4.4.6-stable review Guenter Roeck <linux@roeck-us.net> - 2016-03-15 03:40 +0100
    Re: [PATCH 4.4 00/50] 4.4.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-16 16:50 +0100

csiph-web