diff options
| author | Boris Ostrovsky <[email protected]> | 2014-05-09 15:11:27 +0000 |
|---|---|---|
| committer | H. Peter Anvin <[email protected]> | 2014-05-09 15:45:52 +0000 |
| commit | 28b92e09e25bdc0ae864b22eacf195a74f861389 (patch) | |
| tree | 2483505e3c98fd83565a1576af11daf629f8efdf /fs/nfs/filelayout/filelayoutdev.c | |
| parent | x86: Fix typo in MSR_IA32_MISC_ENABLE_LIMIT_CPUID macro (diff) | |
| download | kernel-28b92e09e25bdc0ae864b22eacf195a74f861389.tar.gz kernel-28b92e09e25bdc0ae864b22eacf195a74f861389.zip | |
x86, vdso, time: Cast tv_nsec to u64 for proper shifting in update_vsyscall()
With tk->wall_to_monotonic.tv_nsec being a 32-bit value on 32-bit
systems, (tk->wall_to_monotonic.tv_nsec << tk->shift) in update_vsyscall()
may lose upper bits or, worse, add them since compiler will do this:
(u64)(tk->wall_to_monotonic.tv_nsec << tk->shift)
instead of
((u64)tk->wall_to_monotonic.tv_nsec << tk->shift)
So if, for example, tv_nsec is 0x800000 and shift is 8 we will end up
with 0xffffffff80000000 instead of 0x80000000. And then we are stuck in
the subsequent 'while' loop.
We need an explicit cast.
Signed-off-by: Boris Ostrovsky <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Acked-by: Konrad Rzeszutek Wilk <[email protected]>
Cc: <[email protected]> # v3.14
Signed-off-by: H. Peter Anvin <[email protected]>
Diffstat (limited to 'fs/nfs/filelayout/filelayoutdev.c')
0 files changed, 0 insertions, 0 deletions
