On 5/30/2025 6:29 AM, Su Hui wrote:
The expected use case is for the input string not to exceed 3 characters. The valid range is decimal 0 to 128. That could be enforced by switching to simple_strntoul() and relying upon the existing checks.On 5/30/25 7:35 AM, Jeffrey E Altman wrote:Do you see an overflow condition which would not be caught by those checks which would be caught by use of kstrtoul()?Actually, no example in reality.If p can equal to '0xffffffffffffffff0000000000000001', simple_strtoul() and kstroul() all transform 'p' to unsigned long value '0x1'. But kstrtoul() return an error and we can know overflow happens. If 'p' can be a very long string, kstroul() make sense.
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature