Skip to contentSkip to conversation

arm: mach-omap2: mux: fix buffer overrun

PATCH New Aaro Koskinen 2 participants 2 messages Jan 5, 2011 – Jan 6, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mach-omap2: mux: fix buffer overrun

memcpy() copies 8 bytes too much (omap_mux_entry vs. omap_mux). Correct by replacing memcpy() with struct assignment, which is safer.

---
 arch/arm/mach-omap2/mux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mux.c +1 -1
index 17bd639..df8d2f2 100644
@@ -893,7 +893,7 @@ static struct omap_mux * __init omap_mux_list_add(
 		return NULL;
 
 	m = &entry->mux;
-	memcpy(m, src, sizeof(struct omap_mux_entry));
+	entry->mux = *src;
 
 #ifdef CONFIG_OMAP_MUX
 	if (omap_mux_copy_names(src, m)) {
Signature · 1 line
1.5.6.5
maintainer
#1 lore raw

PATCH 1/1 arm: mach-omap2: mux: fix buffer overrun

Quoted 2 lines · Aaro Koskinen

memcpy() copies 8 bytes too much (omap_mux_entry vs. omap_mux). Correct by replacing memcpy() with struct assignment, which is safer.

Thanks will queue as a fix after the merge window.

Tony

Quoted 25 lines
---
 arch/arm/mach-omap2/mux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mux.c +1 -1
index 17bd639..df8d2f2 100644
@@ -893,7 +893,7 @@ static struct omap_mux * __init omap_mux_list_add(
 		return NULL;
 
 	m = &entry->mux;
-	memcpy(m, src, sizeof(struct omap_mux_entry));
+	entry->mux = *src;
 
 #ifdef CONFIG_OMAP_MUX
 	if (omap_mux_copy_names(src, m)) {
Signature · 6 lines
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html