[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d0c81ab8-b404-4710-9b27-71aede157b3b@linuxfoundation.org>
Date: Thu, 22 Feb 2024 07:23:21 -0700
From: Shuah Khan <skhan@...uxfoundation.org>
To: David Gow <davidgow@...gle.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Guenter Roeck <linux@...ck-us.net>, Rae Moar <rmoar@...gle.com>,
Matthew Auld <matthew.auld@...el.com>,
Arunpravin Paneer Selvam <arunpravin.paneerselvam@....com>,
Christian König <christian.koenig@....com>,
Kees Cook <keescook@...omium.org>, Maíra Canal
<mcanal@...lia.com>, Rodrigo Vivi <rodrigo.vivi@...el.com>,
Matthew Brost <matthew.brost@...el.com>,
Willem de Bruijn <willemb@...gle.com>, Florian Westphal <fw@...len.de>,
Cassio Neri <cassio.neri@...il.com>,
Javier Martinez Canillas <javierm@...hat.com>,
Arthur Grillo <arthur.grillo@....br>
Cc: Brendan Higgins <brendan.higgins@...ux.dev>,
Daniel Latypov <dlatypov@...gle.com>, Stephen Boyd <sboyd@...nel.org>,
David Airlie <airlied@...il.com>, Maxime Ripard <mripard@...nel.org>,
"David S . Miller" <davem@...emloft.net>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, intel-xe@...ts.freedesktop.org,
linux-rtc@...r.kernel.org, linux-kselftest@...r.kernel.org,
kunit-dev@...glegroups.com, linux-hardening@...r.kernel.org,
netdev@...r.kernel.org, Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH 0/9] kunit: Fix printf format specifier issues in KUnit
assertions
On 2/21/24 02:27, David Gow wrote:
> KUnit has several macros which accept a log message, which can contain
> printf format specifiers. Some of these (the explicit log macros)
> already use the __printf() gcc attribute to ensure the format specifiers
> are valid, but those which could fail the test, and hence used
> __kunit_do_failed_assertion() behind the scenes, did not.
>
> These include:
> - KUNIT_EXPECT_*_MSG()
> - KUNIT_ASSERT_*_MSG()
> - KUNIT_FAIL()
>
> This series adds the __printf() attribute, and fixes all of the issues
> uncovered. (Or, at least, all of those I could find with an x86_64
> allyesconfig, and the default KUnit config on a number of other
> architectures. Please test!)
>
> The issues in question basically take the following forms:
> - int / long / long long confusion: typically a type being updated, but
> the format string not.
> - Use of integer format specifiers (%d/%u/%li/etc) for types like size_t
> or pointer differences (technically ptrdiff_t), which would only work
> on some architectures.
> - Use of integer format specifiers in combination with PTR_ERR(), where
> %pe would make more sense.
> - Use of empty messages which, whilst technically not incorrect, are not
> useful and trigger a gcc warning.
>
> We'd like to get these (or equivalent) in for 6.9 if possible, so please
> do take a look if possible.
>
> Thanks,
> -- David
>
> Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Closes: https://lore.kernel.org/linux-kselftest/CAHk-=wgJMOquDO5f8ShH1f4rzZwzApNVCw643m5-Yj+BfsFstA@mail.gmail.com/
>
>
Thank you for a quick response David. I will apply the series to
kunit next for Linux 6.9 as soon as the reviews are complete.
thanks,
-- Shuah
Powered by blists - more mailing lists