Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19984
b: refs/heads/master
c: 1fcbf05
h: refs/heads/master
v: v3
  • Loading branch information
Kyle McMartin authored and Linus Torvalds committed Feb 8, 2006
1 parent 9d946c5 commit b72e4c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b5173119ff10c5538e92a7957a50887ae170b8da
refs/heads/master: 1fcbf053e55e961112f237dc690129f0858156f1
10 changes: 7 additions & 3 deletions trunk/arch/parisc/hpux/sys_hpux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b72e4c9

Please sign in to comment.