From: Jarkko Sakkinen <jarkko@kernel.org>
To: "William Chuang, Founder – Logarcheon" <founder@logarcheon.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Howells <dhowells@redhat.com>,
keyrings@vger.kernel.org, kunit-dev@googlegroups.com,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] lib/asn1_decoder: add KUnit test suite
Date: Tue, 17 Nov 2026 05:24:04 +0200 [thread overview]
Message-ID: <avvI1PuQUtBlfZWP@kernel.org> (raw)
In-Reply-To: <avvFgRqiYnBo9Q7c@kernel.org>
On Tue, Nov 17, 2026 at 05:09:57AM +0200, Jarkko Sakkinen wrote:
> On Tue, Nov 17, 2026 at 02:39:37AM +0000, William Chuang, Founder – Logarcheon wrote:
> > Fair questions.
> >
> > Why at all: asn1_ber_decoder() parses untrusted ASN.1 BER/DER input. X.509 certificates (keyrings) and PKCS#7 signatures (module signing) both go through it, and it has had a length-validation bug of this kind before — CVE-2016-0758, in asn1_find_indefinite_length().
> > Scope: the suite checks that malformed and truncated input is rejected rather than over-read, in the cases it exercises. It does not reproduce that CVE or prove the decoder memory-safe. That it isn’t vacuous: I weakened one bounds check in asn1_decoder.c to allow a short over-read. asn1_test_truncated_content then fails its return-value check — the decoder accepts a truncated SEQUENCE (returns 0 instead of -EBADMSG). The other 12 cases pass; reverting restores 13/13.
> >
> > Why KUnit: it exercises the in-kernel decoder directly, with no
> > userspace harness, and the cases can also run under KASAN/UBSAN
> > (verified in my config). It is deterministic and is not built into production kernels.
> >
> > Why in-kernel: the coverage travels with the code. An out-of-tree test does not run when someone changes lib/asn1_decoder.c.
> >
> > I agree the maintenance has to be justified by the coverage. If the current cases are too thin to carry, I’m happy to strengthen or narrow them on your feedback.
> >
> > Thanks,
> > William
>
> I'd start by learning to use the email client properly at first:
>
> https://docs.kernel.org/process/email-clients.html
Within past 17 years the total number of commits is 22. This includes
all the possible. Of these total six carry a Fixes tag.
That makes about 0.35 bug fixes annually. How do you explain this?
For me this looks whole a lot like LLM lottery i.e., sending random
and useless patches in the hopes that something might happen to get
in.
Your previous kunit supports this point of view given that it is
a possible "LLM remix" of a patch (kunit for assoc_array) that I
sent a month ago but we discarded the idea in favor of a better
solution.
Stop doing this.
Br, Jarkko
prev parent reply other threads:[~2026-11-17 3:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 0:17 William Chuang
2026-11-17 1:32 ` Jarkko Sakkinen
2026-11-17 2:39 ` William Chuang, Founder – Logarcheon
2026-11-17 3:09 ` Jarkko Sakkinen
2026-11-17 3:24 ` Jarkko Sakkinen [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=avvI1PuQUtBlfZWP@kernel.org \
--to=jarkko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=founder@logarcheon.com \
--cc=keyrings@vger.kernel.org \
--cc=kunit-dev@googlegroups.com \
--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
all inboxes | Powered by JetHome®