Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
strscpy: reject buffer sizes larger than INT_MAX
As already done for snprintf(), add a check in strscpy() for giant (i.e. likely negative and/or miscalculated) copy sizes, WARN, and error out. Link: http://lkml.kernel.org/r/201907260928.23DE35406@keescook Signed-off-by: Kees Cook <[email protected]> Cc: Joe Perches <[email protected]> Cc: Rasmus Villemoes <[email protected]> Cc: Yann Droneaud <[email protected]> Cc: David Laight <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Stephen Kitt <[email protected]> Cc: Jann Horn <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information