Re: [PATCH] rcu: Fix buffer overlow in print_cpu_stall_info()

From: Nikita Kiryushin
Date: Fri Mar 29 2024 - 14:08:05 EST



Thank you for the feedback!
would you like to resend keeping the buffer-overflow fix but leaving
out the signed-to-unsigned conversion?

I will make a second version of the patch, without
conversion as it is intentional.
However, the signed output is intentional. The idea is that if the
timekeeping code is confused enough to run the jiffies counter backwards,
we see a small negative number rather than a huge positive number.
For example, -132 is immediately obvious, while the 64-bit unsigned
equivalent of 18446744073709551484 might not be.
I had suspicions that was the case, however, I did not find the pointers
in the code or in the commit message, that it was intentional, so I assumed
a mistake.
Maybe, it would be a good idea for me to add a comment with intent
clarification, to reduce possibility of the same confusion in the future,
while I am at it? If so, should I do it in the same patch, or make a separate one?