sparc: fix ldom_reboot buffer overflow harder
authorKees Cook <keescook@chromium.org>
Wed, 2 Oct 2013 05:13:34 +0000 (22:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Oct 2013 23:08:32 +0000 (16:08 -0700)
commit5c19adb25bc8d618619c24c4500bbbbc06bdba0b
treef7aed10573f88b45fed25ebb0bf74199e0f6c5e9
parent34b6bdb2a889231e450774b5227a80c2f5051bc0
sparc: fix ldom_reboot buffer overflow harder

[ Upstream commit 20928bd3f08afb036c096d9559d581926b895918 ]

The length argument to strlcpy was still wrong. It could overflow the end of
full_boot_str by 5 bytes. Instead of strcat and strlcpy, just use snprint.

Reported-by: Brad Spengler <spender@grsecurity.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/sparc/kernel/ds.c