From: Mimi Zohar <zohar@linux.ibm.com>
To: Nicolai Kuntze <nicolai.kuntze@hs-mainz.de>,
linux-integrity@vger.kernel.org
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
Roberto Sassu <roberto.sassu@huawei.com>,
Dmitry Kasatkin <dmitry.kasatkin@gmail.com>,
Eric Snowberg <eric.snowberg@oracle.com>,
Paul Moore <paul@paul-moore.com>,
James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC] IMA: periodic runtime re-measurement of process .text/GOT
Date: Mon, 24 Aug 2026 10:22:52 -0400 [thread overview]
Message-ID: <cf79fc0314c1984e68f683d26cbee3ac0859b5d6.camel@linux.ibm.com> (raw)
In-Reply-To: <1805cb973c0e38e1ca8cbeb6dadc4f46f9475a0c.camel@linux.ibm.com>
On Mon, 2026-08-24 at 09:17 -0400, Mimi Zohar wrote:
> On Sat, 2026-08-22 at 21:38 +0200, Nicolai Kuntze wrote:
> [...]
>
> >
> > > This feature is continuous/periodic ... a different execution
> > > model, not an incremental addition to a hook-based architecture.
> > > The reference implementation ... bypasses IMA's measurement list
> > > and dedup entirely
> >
> > This was the strongest objection, and rather than argue it away I
> > went back and changed the design -- v2 patches attached/linked below,
> > not just a response in prose. You were right that a self-scheduling
> > timer inside ima_main.c's dispatch is a materially different execution
> > model, not an incremental addition to a hook-based one; the fix wasn't
> > to defend the timer, it was to notice the actual requirement was never
> > "recheck on a schedule," it was "answer a verifier's request," the
> > same shape a TPM Quote already has. So v2 drops the timer and
> > `interval=` entirely: RUNTIME_TEXT_CHECK/RUNTIME_GOT_CHECK/
> > KERNEL_TEXT_CHECK are now dispatched from a one-shot trigger, a new
> > write-only securityfs file (`/sys/kernel/security/ima/runtime_measure`,
> > CAP_SYS_ADMIN-gated), the same event-triggered shape every other IMA
> > hook already has -- the event is just "a verifier asked" instead of
> > "a file was opened." Boot-tested under QEMU/KVM: a 5-second idle
> > window with no write to `runtime_measure` produces zero measurement
> > log lines; one write produces exactly one correctly-scoped batch;
> > a further idle wait leaves the count unchanged, confirming it's
> > genuinely one-shot and not a disguised timer restart.
>
> Thank you.
Have you considered defining this as an IMA critical-data measurement, triggered
by the securityfs write? That way the verifier wouldn't need any information
beyond what's already in the IMA measurement list.
Mimi
>
> >
> > The measurement-list/dedup bypass you also flagged is a separate
> > point from the execution-model one, and v2 does *not* change it: it's
> > still deliberate, for the reason given in the original RFC -- an
> > external verifier replaying the full PCR-extend chain needs every
> > extend the TPM actually performed, including repeats of unchanged
> > content, which is exactly what IMA's own digest-based dedup would
> > throw away. v1's dedicated per-mapping dedup table (built to bound log
> > growth from timer ticks nobody asked for) is dropped in v2 for the
> > same reason it's no longer needed: growth is now bounded by how often
> > a verifier actually requests a measurement, not by an on-device clock.
>
> Extending the TPM is a performance concern — that's why IMA caches the result.
> CONFIG_IMA_DISABLE_HTABLE addresses the A-B-A case, where without it, a repeat
> of an earlier digest (A) gets skipped because it's already in the htable, making
> the log misleadingly show only A-B. It doesn't change consecutive-repeat
> behavior — if the last hash was B and the new hash is still B, there's still no
> need to add another B.
>
> Why does this case need to be different? With extends now triggered per verifier
> request rather than per tick, why does an unchanged digest still need a fresh
> extend on every request?
>
>
> > It stays available, unchanged, for anyone who still wants periodic
> > mode -- v1 is kept as sent-and-tested history, not deleted, just not
> > the default.
>
> Retaining v1 in your GitHub repo is up to you, but it wouldn't be upstreamed.
>
> Mimi
>
> > Does this address the concern, or is there a reason a request-driven
> > hook still doesn't belong in ima_main.c's dispatch at all? Genuinely
> > asking, not rhetorically -- if the list still prefers the
> > separate-mechanism route (kthread/LSM-adjacent/eBPF, reusing IMA's
> > measurement list and PCR extend chain as a pure data sink without
> > adopting its hook model), I'd rather hear that now than after more
> > patches build on the current shape.
prev parent reply other threads:[~2026-08-24 14:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 10:23 Nicolai Kuntze
2026-08-19 17:45 ` Mimi Zohar
2026-08-21 9:12 ` James Bottomley
2026-08-22 19:38 ` Nicolai Kuntze
2026-08-24 13:17 ` Mimi Zohar
2026-08-24 14:22 ` Mimi Zohar [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=cf79fc0314c1984e68f683d26cbee3ac0859b5d6.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=eric.snowberg@oracle.com \
--cc=jmorris@namei.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=nicolai.kuntze@hs-mainz.de \
--cc=paul@paul-moore.com \
--cc=roberto.sassu@huawei.com \
--cc=serge@hallyn.com \
/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®