linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Holger Dengler <dengler@linux.ibm.com>
To: Harald Freudenberger <freude@linux.ibm.com>
Cc: linux-crypto@vger.kernel.org, linux-s390@vger.kernel.org,
	herbert@gondor.apana.org.au, ifranzki@linux.ibm.com,
	mpatocka@redhat.com
Subject: Re: [PATCH v2] crypto: s390/phmac - Do not modify the req->nbytes value
Date: Tue, 14 Oct 2025 13:01:05 +0200	[thread overview]
Message-ID: <2b7bbd44-dd3f-42f8-bc7a-75f5b6b2a0e3@linux.ibm.com> (raw)
In-Reply-To: <20251014105308.27663-1-freude@linux.ibm.com>

On 14/10/2025 12:53, Harald Freudenberger wrote:
> The phmac implementation used the req->nbytes field on combined
> operations (finup, digest) to track the state:
> with req->nbytes > 0 the update needs to be processed,
> while req->nbytes == 0 means to do the final operation. For
> this purpose the req->nbytes field was set to 0 after successful
> update operation. However, aead uses the req->nbytes field after a
> successful hash operation to determine the amount of data to
> en/decrypt. So an implementation must not modify the nbytes field.
> 
> Fixed by a slight rework on the phmac implementation. There is
> now a new field async_op in the request context which tracks
> the (asynch) operation to process. So the 'state' via req->nbytes
> is not needed any more and now this field is untouched and may
> be evaluated even after a request is processed by the phmac
> implementation.
> 
> Fixes: cbbc675506cc ("crypto: s390 - New s390 specific protected key hash phmac")
> Reported-by: Ingo Franzki <ifranzki@linux.ibm.com>
> Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>

Reviewed-by: Holger Dengler <dengler@linux.ibm.com>

And please don't forget to pick Ingo's R-b and T-b tags (or let b4 do the job).

-- 
Mit freundlichen Grüßen / Kind regards
Holger Dengler
--
IBM Systems, Linux on IBM Z Development
dengler@linux.ibm.com


      reply	other threads:[~2025-10-14 11:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14 10:53 [PATCH v2] crypto: s390/phmac - Do not modify the req->nbytes value Harald Freudenberger
2025-10-14 11:01 ` Holger Dengler [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=2b7bbd44-dd3f-42f8-bc7a-75f5b6b2a0e3@linux.ibm.com \
    --to=dengler@linux.ibm.com \
    --cc=freude@linux.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=ifranzki@linux.ibm.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mpatocka@redhat.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;
as well as URLs for NNTP newsgroup(s).