From: Jerome Marchand <jmarchan@redhat.com>
To: David Howells <dhowells@redhat.com>
Cc: keyrings@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] assoc_array: don't call compare_object() on a node
Date: Mon, 22 Feb 2016 17:57:20 +0100 [thread overview]
Message-ID: <56CB3DF0.9020805@redhat.com> (raw)
In-Reply-To: <12613.1456159058@warthog.procyon.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1582 bytes --]
On 02/22/2016 05:37 PM, David Howells wrote:
> Jerome Marchand <jmarchan@redhat.com> wrote:
>
>> In assoc_array_insert_into_terminal_node(), we call the
>> compare_object() method on all empty slots,
Sorry, this is a typo. It should be "on all non-empty slots".
>
> Ummm... That shouldn't happen - the:
>
> if (!ptr) {
> free_slot = i;
> continue;
> }
>
> preceding the line you modified should cause the comparison to be skipped on a
> slot if it's empty.
>
>> even when they're not leaves, passing a pointer to an unexpected structure
>> to compare_object().
>
> Do you instead mean a metadata pointer rather than an empty slot?
Yes. In the cases I debugged, it was a node, but I guess we could
encounter a shortcut here too.
>
>> Currently it causes an out-of-bound read access in keyring_compare_object
>> detected by KASan. The issue is easily reproduced with keyutils testsuite.
>
> I don't see it. Did you modify the testsuite, or is it a matter of running it
> often enough?
Do you have KASan enabled? In my experience, the reproduction is
systematic on some test (e.g. keyctl/unlink/all). AFAIK, the testsuite
isn't modify (it's from Red Hat test infrastructure).
>
> Also, can you include the oops output you get in the patch description,
> please?
Sure.
>
> That said, I can see that there is probably an issue that your patch fixes -
> but it's not quite the one you describe (see above).
Does the description sounds correct if you add the missing negation?
Jerome
>
> David
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-02-22 16:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 16:13 [PATCH] assoc_array: don't call compare_object() on a node Jerome Marchand
2016-02-22 16:37 ` David Howells
2016-02-22 16:57 ` Jerome Marchand [this message]
2016-02-23 10:28 ` [PATCH V2] " Jerome Marchand
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=56CB3DF0.9020805@redhat.com \
--to=jmarchan@redhat.com \
--cc=dhowells@redhat.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-kernel@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