diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-11 05:16:34 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-11 05:16:34 +0400 |
commit | b4294eecb2785a3e1d4c8fde3403f4fc4ca2dc21 (patch) | |
tree | ec188fb597ecb1560041dc03c1777f7d2c9a9b4f /arch/sparc/kernel | |
parent | 4ece92df296f472e49d26ee38ddbed4596458132 (diff) | |
parent | 961246b4ed8da3bcf4ee1eb9147f341013553e3c (diff) | |
download | linux-b4294eecb2785a3e1d4c8fde3403f4fc4ca2dc21.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull Sparc bugfixes from David Miller:
"Four bug fixes:
1) Enable snoop tags properly on Sparc32/LEON, from Andreas Larsson
2) strcpy() length check fix from Chen Gang.
3) Forgotten unregister_netdev() in sunvnet driver, from Dave
Kleikamp.
4) Fix broken assembler offsets used in vm_area_struct accesses on
sparc32, from Olivier DANET."
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
[PATCH] sparc32: vm_area_struct access for old Sun SPARCs.
sunvnet: vnet_port_remove must call unregister_netdev
sparc32, leon: Require separate snoop tags set to regard snooping to be enabled
arch: sparc: kernel: check the memory length before use strcpy().
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/asm-offsets.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/ds.c | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/arch/sparc/kernel/asm-offsets.c b/arch/sparc/kernel/asm-offsets.c index 961b87f99e69..f76389a32342 100644 --- a/arch/sparc/kernel/asm-offsets.c +++ b/arch/sparc/kernel/asm-offsets.c @@ -49,6 +49,8 @@ int foo(void) DEFINE(AOFF_task_thread, offsetof(struct task_struct, thread)); BLANK(); DEFINE(AOFF_mm_context, offsetof(struct mm_struct, context)); + BLANK(); + DEFINE(VMA_VM_MM, offsetof(struct vm_area_struct, vm_mm)); /* DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); */ return 0; diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 5ef48dab5636..11d460f6f9cc 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c @@ -783,6 +783,16 @@ void ldom_set_var(const char *var, const char *value) char *base, *p; int msg_len, loops; + if (strlen(var) + strlen(value) + 2 > + sizeof(pkt) - sizeof(pkt.header)) { + printk(KERN_ERR PFX + "contents length: %zu, which more than max: %lu," + "so could not set (%s) variable to (%s).\n", + strlen(var) + strlen(value) + 2, + sizeof(pkt) - sizeof(pkt.header), var, value); + return; + } + memset(&pkt, 0, sizeof(pkt)); pkt.header.data.tag.type = DS_DATA; pkt.header.data.handle = cp->handle; |