aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-09-28 14:57:19 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2010-09-30 18:57:35 -0400
commit1cf180c94e9166cda083ff65333883ab3648e852 (patch)
tree70cee3eaf3f99abf64377f19a864bb56974b3547
parentd900329e20f4476db6461752accebcf7935a8055 (diff)
x86, irq: Plug memory leak in sparse irq
free_irq_cfg() is not freeing the cpumask_vars in irq_cfg. Fixing this triggers a use after free caused by the fact that copying struct irq_cfg is done with memcpy, which copies the pointer not the cpumask. Fix both places. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Yinghai Lu <yhlu.kernel@gmail.com> LKML-Reference: <alpine.LFD.2.00.1009282052570.2416@localhost6.localdomain6> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@kernel.org Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--arch/x86/kernel/apic/io_apic.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index f1efebaf5510..5c5b8f3dddb5 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -306,14 +306,19 @@ void arch_init_copy_chip_data(struct irq_desc *old_desc,
306 306
307 old_cfg = old_desc->chip_data; 307 old_cfg = old_desc->chip_data;
308 308
309 memcpy(cfg, old_cfg, sizeof(struct irq_cfg)); 309 cfg->vector = old_cfg->vector;
310 cfg->move_in_progress = old_cfg->move_in_progress;
311 cpumask_copy(cfg->domain, old_cfg->domain);
312 cpumask_copy(cfg->old_domain, old_cfg->old_domain);
310 313
311 init_copy_irq_2_pin(old_cfg, cfg, node); 314 init_copy_irq_2_pin(old_cfg, cfg, node);
312} 315}
313 316
314static void free_irq_cfg(struct irq_cfg *old_cfg) 317static void free_irq_cfg(struct irq_cfg *cfg)
315{ 318{
316 kfree(old_cfg); 319 free_cpumask_var(cfg->domain);
320 free_cpumask_var(cfg->old_domain);
321 kfree(cfg);
317} 322}
318 323
319void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc) 324void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
: 97.4%;'/> -rw-r--r--drivers/gpu/pvr/osfunc.h40
-rw-r--r--drivers/gpu/pvr/pdump_common.c224
-rw-r--r--drivers/gpu/pvr/pdump_km.h14
-rw-r--r--drivers/gpu/pvr/pdumpdefs.h9
-rw-r--r--drivers/gpu/pvr/perproc.c10
-rw-r--r--drivers/gpu/pvr/perproc.h13
-rw-r--r--drivers/gpu/pvr/power.c21
-rw-r--r--drivers/gpu/pvr/private_data.h28
-rw-r--r--drivers/gpu/pvr/pvr_bridge.h655
-rw-r--r--drivers/gpu/pvr/pvr_bridge_k.c161
-rw-r--r--drivers/gpu/pvr/pvr_bridge_km.h20
-rw-r--r--drivers/gpu/pvr/pvr_debug.h1
-rw-r--r--drivers/gpu/pvr/pvrmmap.h8
-rw-r--r--drivers/gpu/pvr/pvrsrv.c62
-rw-r--r--drivers/gpu/pvr/pvrsrv_errors.h2
-rw-r--r--drivers/gpu/pvr/pvrversion.h8
-rw-r--r--drivers/gpu/pvr/queue.c146
-rw-r--r--drivers/gpu/pvr/queue.h3
-rw-r--r--drivers/gpu/pvr/ra.c2
-rw-r--r--drivers/gpu/pvr/resman.c17
-rw-r--r--drivers/gpu/pvr/resman.h3
-rw-r--r--drivers/gpu/pvr/services.h268
-rw-r--r--drivers/gpu/pvr/servicesext.h232
-rw-r--r--drivers/gpu/pvr/servicesint.h117
-rw-r--r--drivers/gpu/pvr/sgx/bridged_sgx_bridge.c1041
-rw-r--r--drivers/gpu/pvr/sgx/mmu.c806
-rw-r--r--drivers/gpu/pvr/sgx/mmu.h8
-rw-r--r--drivers/gpu/pvr/sgx/pb.c8
-rw-r--r--drivers/gpu/pvr/sgx/sgx_bridge_km.h28
-rw-r--r--drivers/gpu/pvr/sgx/sgxconfig.h147
-rw-r--r--drivers/gpu/pvr/sgx/sgxinfokm.h201
-rw-r--r--drivers/gpu/pvr/sgx/sgxinit.c441
-rw-r--r--drivers/gpu/pvr/sgx/sgxkick.c46
-rw-r--r--drivers/gpu/pvr/sgx/sgxpower.c15
-rw-r--r--drivers/gpu/pvr/sgx/sgxreset.c430
-rw-r--r--drivers/gpu/pvr/sgx/sgxtransfer.c120
-rw-r--r--drivers/gpu/pvr/sgx/sgxutils.c301
-rw-r--r--drivers/gpu/pvr/sgx/sgxutils.h19
-rw-r--r--drivers/gpu/pvr/sgx531defs.h544
-rw-r--r--drivers/gpu/pvr/sgx535defs.h650
-rw-r--r--drivers/gpu/pvr/sgx543_v1.164defs.h1284
-rw-r--r--drivers/gpu/pvr/sgx543defs.h400
-rw-r--r--drivers/gpu/pvr/sgx544defs.h1351
-rw-r--r--drivers/gpu/pvr/sgx_bridge.h189
-rw-r--r--drivers/gpu/pvr/sgx_mkif_km.h63
-rw-r--r--drivers/gpu/pvr/sgx_options.h58
-rw-r--r--drivers/gpu/pvr/sgxapi_km.h64
-rw-r--r--drivers/gpu/pvr/sgxdefs.h16
-rw-r--r--drivers/gpu/pvr/sgxerrata.h154
-rw-r--r--drivers/gpu/pvr/sgxfeaturedefs.h90
-rw-r--r--drivers/gpu/pvr/sgxinfo.h196
-rw-r--r--drivers/gpu/pvr/sgxmmu.h19
-rw-r--r--drivers/gpu/pvr/sgxmpdefs.h30
-rw-r--r--drivers/gpu/pvr/syscommon.h52
-rw-r--r--drivers/gpu/pvr/ttrace.h184
-rw-r--r--drivers/gpu/pvr/ttrace_common.h81
-rw-r--r--drivers/gpu/pvr/ttrace_tokens.h84
88 files changed, 15497 insertions, 5486 deletions
diff --git a/drivers/gpu/pvr/Makefile b/drivers/gpu/pvr/Makefile
index 0dc058d364d..d537d081489 100644
--- a/drivers/gpu/pvr/Makefile
+++ b/drivers/gpu/pvr/Makefile
@@ -26,8 +26,12 @@ ccflags-y = -DLINUX -D__linux__ -Idrivers/gpu/pvr \
26 -DPVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE \ 26 -DPVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE \
27 -DSYS_CUSTOM_POWERLOCK_WRAP \ 27 -DSYS_CUSTOM_POWERLOCK_WRAP \
28 -DSUPPORT_SGX_NEW_STATUS_VALS \ 28 -DSUPPORT_SGX_NEW_STATUS_VALS \
29 -DSYS_OMAP3430_PIN_MEMORY_BUS_CLOCK \ 29 -DSYS_OMAP3430_PIN_MEMORY_BUS_CLOCK \
30 -DSGX_EARLYSUSPEND \ 30 -DSGX_EARLYSUSPEND \
31 -DSUPPORT_DBGDRV_EVENT_OBJECTS \
32 -DPVR_NO_OMAP_TIMER \
33 -DSUPPORT_DYNAMIC_GTF_TIMING \
34 -DSUPPORT_SGX_LOW_LATENCY_SCHEDULING \
31 -DPVRSRV_MODNAME="\"pvrsrvkm"\" 35 -DPVRSRV_MODNAME="\"pvrsrvkm"\"
32 36
33ccflags-$(CONFIG_SGX540) += -Idrivers/gpu/pvr/omap4 -Idrivers/gpu/pvr/sgx \ 37ccflags-$(CONFIG_SGX540) += -Idrivers/gpu/pvr/omap4 -Idrivers/gpu/pvr/sgx \
@@ -48,8 +52,7 @@ ccflags-$(CONFIG_SGX_530_BUILD_RELEASE) += \
48 -DPVR_BUILD_TYPE="\"release\"" \ 52 -DPVR_BUILD_TYPE="\"release\"" \
49 -DRELEASE \ 53 -DRELEASE \
50 -DSUPPORT_ACTIVE_POWER_MANAGEMENT \ 54 -DSUPPORT_ACTIVE_POWER_MANAGEMENT \
51 -DSUPPORT_HW_RECOVERY \ 55 -DSUPPORT_HW_RECOVERY
52 -DSUPPORT_SGX_LOW_LATENCY_SCHEDULING
53 56
54ccflags-$(CONFIG_SGX_530_BUILD_DEBUG) += \ 57ccflags-$(CONFIG_SGX_530_BUILD_DEBUG) += \
55 -DPVR_BUILD_TYPE="\"debug\"" -DDEBUG \ 58 -DPVR_BUILD_TYPE="\"debug\"" -DDEBUG \
@@ -65,8 +68,7 @@ ccflags-$(CONFIG_SGX_540_BUILD_RELEASE) += \
65 -DPVR_BUILD_TYPE="\"release\"" \ 68 -DPVR_BUILD_TYPE="\"release\"" \
66 -DRELEASE \ 69 -DRELEASE \
67 -DSUPPORT_ACTIVE_POWER_MANAGEMENT \ 70 -DSUPPORT_ACTIVE_POWER_MANAGEMENT \
68 -DPVR_NO_FULL_CACHE_OPS \ 71 -DPVR_NO_FULL_CACHE_OPS
69 -DSUPPORT_SGX_LOW_LATENCY_SCHEDULING
70 72
71ccflags-$(CONFIG_SGX_540_BUILD_DEBUG) += \ 73ccflags-$(CONFIG_SGX_540_BUILD_DEBUG) += \
72 -DPVR_BUILD_TYPE="\"debug\"" -DDEBUG \ 74 -DPVR_BUILD_TYPE="\"debug\"" -DDEBUG \
diff --git a/drivers/gpu/pvr/bridged_pvr_bridge.c b/drivers/gpu/pvr/bridged_pvr_bridge.c
index f0dde100218..b06a7a394a6 100644
--- a/drivers/gpu/pvr/bridged_pvr_bridge.c
+++ b/drivers/gpu/pvr/bridged_pvr_bridge.c
@@ -1,26 +1,26 @@
1/********************************************************************** 1/**********************************************************************
2 * 2 *
3 * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved. 3 * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License, 6 * under the terms and conditions of the GNU General Public License,
7 *