public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] staging: fbtft: Fix buffer overflow vulnerability
@ 2017-02-15  3:27 Tobin C. Harding
  2017-02-15  3:27 ` [PATCH v2 1/3] " Tobin C. Harding
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tobin C. Harding @ 2017-02-15  3:27 UTC (permalink / raw)
  To: Thomas Petazzoni, noralf
  Cc: Greg Kroah-Hartman, devel, linux-kernel, Tobin C. Harding

Module copies a user supplied string (module parameter) into a buffer
using strncpy() and does not check that the buffer is null terminated.

Replace call to strncpy() with call to strlcpy() ensuring that the
buffer is null terminated.

Replace magic number with pre-existing compile time constant.

Check return value of call to strlcpy() and throw warning if source
string is truncated.

v1 was a single patch. v2 adds 2 extra patches while retaining the
original v1 patch as the first of the series.

v2:
 - Replace magic number
 - Check return value of call to strlcpy()

Tobin C. Harding (3):
  staging: fbtft: Fix buffer overflow vulnerability
  staging: fbtft: Replace magic number with constant
  staging: fbtft: Add check on strlcpy() return value

 drivers/staging/fbtft/fbtft_device.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-15  3:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-15  3:27 [PATCH v2 0/3] staging: fbtft: Fix buffer overflow vulnerability Tobin C. Harding
2017-02-15  3:27 ` [PATCH v2 1/3] " Tobin C. Harding
2017-02-15  3:27 ` [PATCH v2 2/3] staging: fbtft: Replace magic number with constant Tobin C. Harding
2017-02-15  3:36   ` Joe Perches
2017-02-15  3:27 ` [PATCH v2 3/3] staging: fbtft: Add check on strlcpy() return value Tobin C. Harding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox