Re: [PATCH v3] vsprintf: Prevent crash when dereferencing invalid pointers

From: kbuild test robot
Date: Thu Mar 15 2018 - 10:49:27 EST


Hi Petr,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.16-rc5 next-20180314]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Petr-Mladek/vsprintf-Prevent-crash-when-dereferencing-invalid-pointers/20180315-214100
config: i386-randconfig-x019-201810 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All errors (new ones prefixed by >>):

lib/test_printf.c: In function 'plain':
>> lib/test_printf.c:273:8: error: too many arguments to function 'plain_format'
err = plain_format(ptr);
^~~~~~~~~~~~
lib/test_printf.c:235:1: note: declared here
plain_format(void)
^~~~~~~~~~~~

vim +/plain_format +273 lib/test_printf.c

256
257 /*
258 * We can't use test() to test %p because we don't know what output to expect
259 * after an address is hashed.
260 */
261 static void __init
262 plain(void *ptr)
263 {
264 int err;
265
266 err = plain_hash(ptr);
267 if (err) {
268 pr_warn("plain 'p' does not appear to be hashed\n");
269 failed_tests++;
270 return;
271 }
272
> 273 err = plain_format(ptr);
274 if (err) {
275 pr_warn("hashing plain 'p' has unexpected format\n");
276 failed_tests++;
277 }
278 }
279

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip