]> git.baikalelectronics.ru Git - kernel.git/commit
drm/etnaviv: reject timeouts with tv_nsec >= NSEC_PER_SEC
authorArnd Bergmann <arnd@arndb.de>
Mon, 11 Nov 2019 16:20:04 +0000 (17:20 +0100)
committerArnd Bergmann <arnd@arndb.de>
Wed, 18 Dec 2019 17:07:32 +0000 (18:07 +0100)
commit7a5fb77bd4339c4abef37b7d033a96d98d0fb5f1
tree7578182952795a319fbff6c71c756fecd57e74e5
parentcead528aab3d0ec54c7d191812b85d4e77c19bcd
drm/etnaviv: reject timeouts with tv_nsec >= NSEC_PER_SEC

Most kernel interfaces that take a timespec require normalized
representation with tv_nsec between 0 and NSEC_PER_SEC.

Passing values larger than 0x100000000ull further behaves differently
on 32-bit and 64-bit kernels, and can cause the latter to spend a long
time counting seconds in timespec64_sub()/set_normalized_timespec64().

Reject those large values at the user interface to enforce sane and
portable behavior.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/gpu/drm/etnaviv/etnaviv_drv.c