Skip to content

Commit e0c6d97

Browse files
cpwickmanaegl
authored andcommitted
[IA64] SN2: security hole in sn2_ptc_proc_write
Security hole in sn2_ptc_proc_write It is possible to overrun a buffer with a write to this /proc file. Signed-off-by: Cliff Wickman <[email protected]> Signed-off-by: Tony Luck <[email protected]>
1 parent 9bedbcb commit e0c6d97

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/ia64/sn/kernel/sn2/sn2_smp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ static ssize_t sn2_ptc_proc_write(struct file *file, const char __user *user, si
512512
int cpu;
513513
char optstr[64];
514514

515+
if (count > sizeof(optstr))
516+
return -EINVAL;
515517
if (copy_from_user(optstr, user, count))
516518
return -EFAULT;
517519
optstr[count - 1] = '\0';

0 commit comments

Comments
 (0)