Re: [PATCH] kasan: Increase the number of bits to shift when recording extra timestamps

From: Andrew Morton
Date: Thu Feb 15 2024 - 17:27:24 EST


On Thu, 15 Feb 2024 18:39:55 +0000 Juntong Deng <juntong.deng@xxxxxxxxxxx> wrote:

> Fix the mistake before,

This is rather imprecise ;)

I shall add to the changelog:

Fixes: 5d4c6ac94694 ("kasan: record and report more information")

> I thought printk only display 99999 seconds
> at max, but actually printk can display larger number of seconds.
>
> So increase the number of bits to shift when recording the extra
> timestamp (44 bits), without affecting the precision, shift it right by
> 9 bits, discarding all bits that do not affect the microsecond part
> (nanoseconds will not be shown).
>
> Currently the maximum time that can be displayed is 9007199.254740s,
> because
>
> 11111111111111111111111111111111111111111111 (44 bits) << 9
> = 11111111111111111111111111111111111111111111000000000
> = 9007199.254740

Another important thing to always changelog is the effect of the
bug/shortcoming upon our users. So that

a) others can decide whether the issue is serious enough to justify
backporting the fix into earlier Long Term Stable kernels and

b) people who maintain other kernel trees (of whom there are many)
are better able to determine whether this patch is likely to address
a report which they have received from their customers.

Because 99999 seconds is a very long time, I am assuming that the
effect of this upon our users is basically zero, so I shall not be
adding

Cc: <stable@xxxxxxxxxxxxxxx>

to this patch's changelog.