The patch titled Subject: lib: new testcases for bitmap_parse{_user} has been added to the -mm tree. Its filename is lib-new-testcases-for-bitmap_parse_user.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/lib-new-testcases-for-bitmap_parse_user.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/lib-new-testcases-for-bitmap_parse_user.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Yury Norov <ynorov@xxxxxxxxxxx> Subject: lib: new testcases for bitmap_parse{_user} New version of bitmap_parse() is unified with bitmap_parse_list(), and therefore: - weakens rules on whitespaces and commas between hex chunks; - in addition to - allows passing UINT_MAX or any other big number as the length of input string instead of actual string length. The patch covers the cases. Link: http://lkml.kernel.org/r/20190501010636.30595-7-ynorov@xxxxxxxxxxx Signed-off-by: Yury Norov <ynorov@xxxxxxxxxxx> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Cc: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx> Cc: Amritha Nambiar <amritha.nambiar@xxxxxxxxx> Cc: Willem de Bruijn <willemb@xxxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: "Tobin C . Harding" <tobin@xxxxxxxxxx> Cc: Will Deacon <will.deacon@xxxxxxx> Cc: Steffen Klassert <steffen.klassert@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/test_bitmap.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/lib/test_bitmap.c~lib-new-testcases-for-bitmap_parse_user +++ a/lib/test_bitmap.c @@ -344,14 +344,22 @@ static const unsigned long parse_test2[] }; static const struct test_bitmap_parselist parse_tests[] __initconst = { + {0, "", &parse_test[0 * step], 32, 0}, + {0, " ", &parse_test[0 * step], 32, 0}, {0, "0", &parse_test[0 * step], 32, 0}, + {0, "0\n", &parse_test[0 * step], 32, 0}, {0, "1", &parse_test[1 * step], 32, 0}, {0, "deadbeef", &parse_test[2 * step], 32, 0}, {0, "1,0", &parse_test[3 * step], 33, 0}, + {0, "deadbeef,\n,0,1", &parse_test[2 * step], 96, 0}, {0, "deadbeef,1,0", &parse_test2[0 * 2 * step], 96, 0}, {0, "baadf00d,deadbeef,1,0", &parse_test2[1 * 2 * step], 128, 0}, {0, "badf00d,deadbeef,1,0", &parse_test2[2 * 2 * step], 124, 0}, + {0, "badf00d,deadbeef,1,0", &parse_test2[2 * 2 * step], 124, NO_LEN}, + {0, " badf00d,deadbeef,1,0 ", &parse_test2[2 * 2 * step], 124, 0}, + {0, " , badf00d,deadbeef,1,0 , ", &parse_test2[2 * 2 * step], 124, 0}, + {0, " , badf00d, ,, ,,deadbeef,1,0 , ", &parse_test2[2 * 2 * step], 124, 0}, {-EINVAL, "goodfood,deadbeef,1,0", NULL, 128, 0}, {-EOVERFLOW, "3,0", NULL, 33, 0}, _ Patches currently in -mm which might be from ynorov@xxxxxxxxxxx are lib-string-add-strnchrnul.patch bitops-more-bits_to_-macros.patch lib-add-test-for-bitmap_parse.patch lib-make-bitmap_parse_user-a-wrapper-on-bitmap_parse.patch lib-rework-bitmap_parse.patch lib-new-testcases-for-bitmap_parse_user.patch cpumask-dont-calculate-length-of-the-input-string.patch