mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Yeoreum Yun <yeoreum.yun@arm.com>
Cc: Kohei Enju <enju.kohei@fujitsu.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Suzuki Poulose <suzuki.poulose@arm.com>,
	Steven Price <steven.price@arm.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	thuth@redhat.com
Subject: Re: [PATCH v2 3/3] virt: arm-cca-guest: Add support for measurement registers
Date: Wed, 30 Sep 2026 10:54:08 -0300	[thread overview]
Message-ID: <20260930135408.GP163130@ziepe.ca> (raw)
In-Reply-To: <aryuwukTRtmd2Lft@e129823.arm.com>

On Wed, Sep 30, 2026 at 07:40:02AM +0100, Yeoreum Yun wrote:
> > My remaining concern is that since sysfs_kf_bin_write() truncates
> > oversized writes to the binary attribute size before invoking the
> > callback, tm_digest_write() sees an exact-sized write and extends the
> > MR. The following validation is useless in this case.
> > 
> >   static ssize_t tm_digest_write(struct file *filp, struct kobject *kobj,
> >   			       const struct bin_attribute *attr, char *buffer,
> >   			       loff_t off, size_t count)
> >   {
> >     [...]
> >   	/* partial writes are not supported */
> >   	if (off != 0 || count != attr->size)
> >   		return -EINVAL;
> > 
> > IMO this is not specific to Arm CCA, but do you have any thoughts on
> > this?
> 
> I think this is ultimately a limitation of sysfs. At this layer,
> simply knowing that userspace supplied a larger buffer does not allow us to
> determine whether all of the data in that buffer is valid.

sysfs is a bad choice for this interface, it always was, this is one
more example why.

We should have learned that from TPM's mistakes, not copied its bad
ideas into tsm_mr.

Jason

  parent reply	other threads:[~2026-09-30 13:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 16:57 [PATCH v2 0/3] arm64/virt: Add Arm CCA measurement register support Yeoreum Yun
2026-09-29 16:57 ` [PATCH v2 1/3] arm64: rsi: Add helpers for Arm CCA measurement register operations Yeoreum Yun
2026-09-30  2:04   ` Kohei Enju
2026-09-30  5:13     ` Yeoreum Yun
2026-09-29 16:57 ` [PATCH v2 2/3] arm64: rsi: Add realm hash algorithm defines Yeoreum Yun
2026-09-30  2:39   ` Kohei Enju
2026-09-30  5:10     ` Yeoreum Yun
2026-09-29 16:57 ` [PATCH v2 3/3] virt: arm-cca-guest: Add support for measurement registers Yeoreum Yun
2026-09-30  3:24   ` Kohei Enju
2026-09-30  4:45     ` Kohei Enju
2026-09-30  5:09     ` Yeoreum Yun
2026-09-30  5:59       ` Kohei Enju
2026-09-30  6:40         ` Yeoreum Yun
2026-09-30  7:04           ` Kohei Enju
2026-09-30  7:54             ` Yeoreum Yun
2026-09-30 13:54           ` Jason Gunthorpe [this message]
2026-09-30 14:12             ` Yeoreum Yun
2026-09-30 14:17               ` Jason Gunthorpe
2026-09-30 14:28                 ` Yeoreum Yun
2026-09-29 19:20 ` [PATCH v2 0/3] arm64/virt: Add Arm CCA measurement register support Jason Gunthorpe
2026-09-29 19:42   ` Yeoreum Yun
2026-09-29 19:45     ` Jason Gunthorpe

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=20260930135408.GP163130@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=catalin.marinas@arm.com \
    --cc=enju.kohei@fujitsu.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sami.mujawar@arm.com \
    --cc=steven.price@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=thuth@redhat.com \
    --cc=will@kernel.org \
    --cc=yeoreum.yun@arm.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®