Re: [PATCH v3 3/3] s390/crypto: Rewrite AES ctr mode to be prepared for context analysis
Heiko Carstens <[email protected]>
| Newsgroups | org.kernel.vger.linux-s390,org.kernel.vger.linux-crypto |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Aug 13, 2026 at 05:54:06PM +0200, Harald Freudenberger wrote:
> Also cover a finding from Sashiko about that the mutex_trylock() may
> be invoked from a softirq context. So add a check to make sure only in
> process context try to lock the mutex.
...
> + if (in_task() && mutex_trylock(&ctrblk_lock)) {
> + /* process context and mutex acquired */
> + ret = __ctr_aes_crypt(sctx, &walk, true);
> mutex_unlock(&ctrblk_lock);
Something similar came also up when converting the dasd code: better
convert to semaphore and simply use down_trylock() and up() instead.
Please make the conversion from mutex to semaphore a separate patch,
so it can be easily backported if required.