Re: [PATCH v4] crypto: caam - map src buffer before access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/23/2013 9:51 PM, Kim Phillips wrote:
On Sat, 21 Sep 2013 14:26:35 +0530
Yashpal Dutta <yashpal.dutta@xxxxxxxxxxxxx> wrote:

KMap the buffers before copying trailing bytes during hmac into a session
temporary buffer. This is required if pinned buffer from user-space is send
during hmac and is safe even if hmac request is generated from within kernel.
it may be "safe" but it adversely affects performance for AF_ALG users,
no?

why does ocf-linux need this, and not AF_ALG?  Is a patch to ocf-linux
more appropriate here?

SW hashing (crypto/ahash.c, crypto/shash.c) do the kmap/kunmap.
Crypto engine drivers should do this too. Either by themselves or (probably better) try to use existing support in crypto/scatterwalk.c

At the interface level, AF_ALG issues get_user_pages via af_alg_make_sg(), similar to what ocf-linux does.


Cc:stable@xxxxxxxxxxxxxxx
fyi, this violates the following rule in
Documentation/stable_kernel_rules.txt:

  - It or an equivalent fix must already exist in Linus' tree (upstream).

AFAICT, rules are more flexible, at least that's my understanding. Adding a Cc:stable in the signed-off area is more convenient, since it provides for automatic inclusion in -stable tree (once patch reaches Linus' tree):
 - To have the patch automatically included in the stable tree, add the tag
     Cc: stable@xxxxxxxxxxxxxxx
   in the sign-off area. Once the patch is merged it will be applied to
   the stable tree without anything else needing to be done by the author
   or subsystem maintainer.

Horia


--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]