[XFS] Prevent buffer overrun in cmn_err().
authorLachlan McIlroy <lachlan@sgi.com>
Sat, 10 Feb 2007 07:34:38 +0000 (18:34 +1100)
committerTim Shimmin <tes@sgi.com>
Sat, 10 Feb 2007 07:34:38 +0000 (18:34 +1100)
commitdc74eaad8cda9f12a885639b4f2513c99e9b483a
treeb32ac71e87436179c2f9ef94f6e9aca7e4aa7b4e
parent585e6d8856526a846b90b485abf37ec40e5da1cf
[XFS] Prevent buffer overrun in cmn_err().

The message buffer used by cmn_err() is only 256 bytes and some CXFS
messages were exceeding this length. Since we were using vsprintf() and
not checking for buffer overruns we were clobbering memory beyond the
buffer. The size of the buffer has been increased to 1024 bytes so we can
capture these larger messages and we are now using vsnprintf() to prevent
overrunning the buffer size.

SGI-PV: 958599
SGI-Modid: xfs-linux-melb:xfs-kern:27561a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Geoffrey Wehrman <gwehrman@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
fs/xfs/support/debug.c