diff options
Diffstat (limited to 'arch/parisc/hpux')
-rw-r--r-- | arch/parisc/hpux/entry_hpux.S | 3 | ||||
-rw-r--r-- | arch/parisc/hpux/sys_hpux.c | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/arch/parisc/hpux/entry_hpux.S b/arch/parisc/hpux/entry_hpux.S index fa9bf38787e..31c8cccfba3 100644 --- a/arch/parisc/hpux/entry_hpux.S +++ b/arch/parisc/hpux/entry_hpux.S @@ -22,10 +22,9 @@ #include <linux/linkage.h> #include <asm/unistd.h> - .text - #define ENTRY_NAME(_name_) .word _name_ + .section .rodata,"a" .align 4 .export hpux_call_table .import hpux_unimplemented_wrapper diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index 29b4d61898f..05273ccced0 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c @@ -468,19 +468,23 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2) if ( opcode == 1 ) { /* GETFSIND */ len = strlen_user((char *)arg1); printk(KERN_DEBUG "len of arg1 = %d\n", len); - - fsname = (char *) kmalloc(len+1, GFP_KERNEL); + if (len == 0) + return 0; + fsname = (char *) kmalloc(len, GFP_KERNEL); if ( !fsname ) { printk(KERN_DEBUG "failed to kmalloc fsname\n"); return 0; } - if ( copy_from_user(fsname, (char *)arg1, len+1) ) { + if ( copy_from_user(fsname, (char *)arg1, len) ) { printk(KERN_DEBUG "failed to copy_from_user fsname\n"); kfree(fsname); return 0; } + /* String could be altered by userspace after strlen_user() */ + fsname[len] = '\0'; + printk(KERN_DEBUG "that is '%s' as (char *)\n", fsname); if ( !strcmp(fsname, "hfs") ) { fstype = 0; |