]> git.baikalelectronics.ru Git - kernel.git/commit
lib: Add might_fault() to strncpy_from_user.
authorKP Singh <kpsingh@chromium.org>
Thu, 4 Jun 2020 23:50:11 +0000 (16:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Jun 2020 02:06:25 +0000 (19:06 -0700)
commit77ce4f206256161e161ce6e2ed8fc4d20f192d35
tree963fa448037023b18a406a6965d8b898a8743980
parent43d18ebf1c9a4b64d9984c5ecc37af2c63cbcc8b
lib: Add might_fault() to strncpy_from_user.

When updating a piece of broken logic from using get_user to
strncpy_from_user, we noticed that a warning which is expected when
calling a function that might fault from an atomic context with
pagefaults enabled disappeared.

Not having this warning in place can lead to calling strncpy_from_user
from an atomic context and eventually kernel crashes/stack corruption.

Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Jann Horn <jannh@google.com>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20200414225705.255711-1-kpsingh@chromium.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/strncpy_from_user.c