* Re: Linux 6.8-rc5 [not found] ` <CAHk-=wj6xj_cGmsQK7g=hSfRZZNo-njC+u_1v3dE8fPZtjCBOg@mail.gmail.com> @ 2024-02-20 20:16 ` Linus Torvalds 2024-02-20 23:07 ` Shuah Khan 0 siblings, 1 reply; 2+ messages in thread From: Linus Torvalds @ 2024-02-20 20:16 UTC (permalink / raw) To: Guenter Roeck, Shuah Khan, David Gow, Brendan Higgins, Rae Moar Cc: Linux Kernel Mailing List, Matthew Auld, Arunpravin Paneer Selvam, Christian König, kselftest list, KUnit Development On Tue, 20 Feb 2024 at 11:57, Linus Torvalds <torvalds@linux-foundation.org> wrote: > > It turns out that that commit is buggy for another reason, but it's > hidden by the fact that apparently KUNIT_ASSERT_FALSE_MSG() doesn't > check the format string. The fix for that is this: --- a/include/kunit/test.h +++ b/include/kunit/test.h @@ -579,7 +579,7 @@ void __printf(2, 3) kunit_log_append(struct string_stream *log, const char *fmt, void __noreturn __kunit_abort(struct kunit *test); -void __kunit_do_failed_assertion(struct kunit *test, +void __printf(6,7) __kunit_do_failed_assertion(struct kunit *test, const struct kunit_loc *loc, enum kunit_assert_type type, const struct kunit_assert *assert, but that causes a *lot* of noise (not just in drm_buddy_test.c), so I'm not going to apply that fix as-is. Clearly there's a lot of incorrect format parameters that have never been checked. Instead adding Shuah and the KUnit people to the participants, and hoping that they will fix this up and we can get the format fixes for KUnit in the 6.9 timeframe. Side note: when I apply the above patch, the suggestions gcc spews out look invalid. Gcc seems to suggest turning a a format string of '%d" to "%ld" for a size_t variable. That's wrong. It should be "%zu". A 'size_t' can in fact be 'unsigned int' on some platforms (not just in theory), so %ld is really incorrect not just from a sign perspective. Anyway, I guess I will commit the immediate drm_buddy_test.c fix to get rid of the build issue, but the KUnit message format string issue will have to be a "let's get this fixed up _later_" issue. Linus ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Linux 6.8-rc5 2024-02-20 20:16 ` Linux 6.8-rc5 Linus Torvalds @ 2024-02-20 23:07 ` Shuah Khan 0 siblings, 0 replies; 2+ messages in thread From: Shuah Khan @ 2024-02-20 23:07 UTC (permalink / raw) To: Linus Torvalds, Guenter Roeck, David Gow, Brendan Higgins, Rae Moar Cc: Linux Kernel Mailing List, Matthew Auld, Arunpravin Paneer Selvam, Christian König, kselftest list, KUnit Development, Shuah Khan On 2/20/24 13:16, Linus Torvalds wrote: > On Tue, 20 Feb 2024 at 11:57, Linus Torvalds > <torvalds@linux-foundation.org> wrote: >> >> It turns out that that commit is buggy for another reason, but it's >> hidden by the fact that apparently KUNIT_ASSERT_FALSE_MSG() doesn't >> check the format string. > > The fix for that is this: > > --- a/include/kunit/test.h > +++ b/include/kunit/test.h > @@ -579,7 +579,7 @@ void __printf(2, 3) kunit_log_append(struct > string_stream *log, const char *fmt, > > void __noreturn __kunit_abort(struct kunit *test); > > -void __kunit_do_failed_assertion(struct kunit *test, > +void __printf(6,7) __kunit_do_failed_assertion(struct kunit *test, > const struct kunit_loc *loc, > enum kunit_assert_type type, > const struct kunit_assert *assert, > > but that causes a *lot* of noise (not just in drm_buddy_test.c), so > I'm not going to apply that fix as-is. Clearly there's a lot of > incorrect format parameters that have never been checked. > > Instead adding Shuah and the KUnit people to the participants, and > hoping that they will fix this up and we can get the format fixes for > KUnit in the 6.9 timeframe. > We will take care of this for 6.9 > Side note: when I apply the above patch, the suggestions gcc spews out > look invalid. Gcc seems to suggest turning a a format string of '%d" > to "%ld" for a size_t variable. That's wrong. It should be "%zu". > > A 'size_t' can in fact be 'unsigned int' on some platforms (not just > in theory), so %ld is really incorrect not just from a sign > perspective. > > Anyway, I guess I will commit the immediate drm_buddy_test.c fix to > get rid of the build issue, but the KUnit message format string issue > will have to be a "let's get this fixed up _later_" issue. > > Linus Thank you. -- Shuah ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-20 23:07 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <CAHk-=wi8vZD7EXZfob-yhfDERyfzWxzMOzG9FsOuaKU-v6+PHA@mail.gmail.com> [not found] ` <538327ff-8d34-41d5-a9ae-1a334744f5ae@roeck-us.net> [not found] ` <CAHk-=wj6xj_cGmsQK7g=hSfRZZNo-njC+u_1v3dE8fPZtjCBOg@mail.gmail.com> 2024-02-20 20:16 ` Linux 6.8-rc5 Linus Torvalds 2024-02-20 23:07 ` Shuah Khan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).