Re: [PATCH] lib/test_hmm.c: fix harmless shift wrapping bug

2021-03-16 Thread Ralph Campbell
On 3/16/21 4:43 AM, Dan Carpenter wrote: The "cmd.npages" variable is a u64 that comes from the user. I noticed during review that it could have a shift wrapping bug when it is used in the integer overflow test on the next line. It turns out this is harmless. The users all do: unsig

[PATCH] lib/test_hmm.c: fix harmless shift wrapping bug

2021-03-16 Thread Dan Carpenter
The "cmd.npages" variable is a u64 that comes from the user. I noticed during review that it could have a shift wrapping bug when it is used in the integer overflow test on the next line. It turns out this is harmless. The users all do: unsigned long size = cmd->npages << PAGE_SHIFT; a