From: shuah <shuah@kernel.org>
To: Brendan Higgins <brendanhiggins@google.com>,
David Gow <davidgow@google.com>
Cc: Kees Cook <keescook@chromium.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>,
KUnit Development <kunit-dev@googlegroups.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
shuah <shuah@kernel.org>
Subject: Re: [PATCH kselftest/test] kunit: Always print actual pointer values in asserts
Date: Wed, 25 Mar 2020 11:25:59 -0600 [thread overview]
Message-ID: <2246e35f-b8c4-0152-91f5-5f01d52cd414@kernel.org> (raw)
In-Reply-To: <CAFd5g44ZNv-BP_t6M1EWQjXbgBYsA0+oBZ_-nTAmZbE4GNWgpQ@mail.gmail.com>
On 3/25/20 10:33 AM, Brendan Higgins wrote:
> On Tue, Mar 24, 2020 at 8:33 PM David Gow <davidgow@google.com> wrote:
>>
>> On Tue, Dec 3, 2019 at 3:44 PM Brendan Higgins
>> <brendanhiggins@google.com> wrote:
>>>
>>> On Thu, Nov 21, 2019 at 3:51 PM David Gow <davidgow@google.com> wrote:
>>>>
>>>> KUnit assertions and expectations will print the values being tested. If
>>>> these are pointers (e.g., KUNIT_EXPECT_PTR_EQ(test, a, b)), these
>>>> pointers are currently printed with the %pK format specifier, which -- to
>>>> prevent information leaks which may compromise, e.g., ASLR -- are often
>>>> either hashed or replaced with ____ptrval____ or similar, making debugging
>>>> tests difficult.
>>>>
>>>> By replacing %pK with %px as Documentation/core-api/printk-formats.rst
>>>> suggests, we disable this security feature for KUnit assertions and
>>>> expectations, allowing the actual pointer values to be printed. Given
>>>> that KUnit is not intended for use in production kernels, and the
>>>> pointers are only printed on failing tests, this seems like a worthwhile
>>>> tradeoff.
>>>
>>> I agree. However, I also remember that others in the past yelled at me
>>> for assuming that KUnit would not be built into production kernels.
>>>
>>> I feel like +Kees Cook would have a good opinion on this (or will at
>>> least CC the right people).
>>>
>>
>> I'm tempted to take the silence as a sign that no-one is upset by
>> this. Otherwise, consider this a gentle reminder to file any
>> objections you may have. :-)
>>
>> Otherwise, I've confirmed that this still applies cleanly to the
>> latest linux-kselftest/kunit branch, so -- assuming there are no
>> last-minute objections -- this ought to be ready to go.
>
> Shuah, can you pick this up for 5.7?
>
Yes. I will pick this up.
thanks,
-- Shuah
prev parent reply other threads:[~2020-03-25 17:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-21 23:50 [PATCH kselftest/test] kunit: Always print actual pointer values in asserts David Gow
2019-12-03 23:44 ` Brendan Higgins
2020-03-25 3:33 ` David Gow
2020-03-25 16:33 ` Brendan Higgins
2020-03-25 17:25 ` shuah [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2246e35f-b8c4-0152-91f5-5f01d52cd414@kernel.org \
--to=shuah@kernel.org \
--cc=brendanhiggins@google.com \
--cc=davidgow@google.com \
--cc=keescook@chromium.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox