Re: [PATCH] drivers/crypto:caam:Map src buffer before access in CAAM driver

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

 



On 9/11/2013 9:02 AM, Yashpal.Dutta@xxxxxxxxxxxxx wrote:
From: Yashpal Dutta <yashpal.dutta@xxxxxxxxxxxxx>

KMap the buffers before copying trailing bytes during hmac in CAAM driver into a
session temporary buffer. This is required if pinned buffer from user-space
is send to CAAM driver during hmac and is safe even if hmac request is generated
from within kernel.

Signed-off-by: Yashpal Dutta <yashpal.dutta@xxxxxxxxxxxxx>
---

Subject not consistent with previous caam driver commits. Prefix should be "crypto: caam - ". I would drop the "in CAAM driver" since it's redundant - the prefix already mentions this.

@@ -124,15 +139,15 @@ static inline void sg_copy(u8 *dest, struct scatterlist *sg, unsigned int len)
  	int cpy_index = 0, next_cpy_index = current_sg->length;
while (next_cpy_index < len) {
-		memcpy(dest + cpy_index, (u8 *) sg_virt(current_sg),
-		       current_sg->length);
+		sg_map_copy(dest + cpy_index, current_sg, current_sg->length,
+				current_sg->offset);

CHECK: Alignment should match open parenthesis
#49: FILE: drivers/crypto/caam/sg_sw_sec4.h:143:
+ sg_map_copy(dest + cpy_index, current_sg, current_sg->length,
+                               current_sg->offset);

  		current_sg = scatterwalk_sg_next(current_sg);
  		cpy_index = next_cpy_index;
  		next_cpy_index += current_sg->length;
  	}
  	if (cpy_index < len)
-		memcpy(dest + cpy_index, (u8 *) sg_virt(current_sg),
-		       len - cpy_index);
+		sg_map_copy(dest + cpy_index, current_sg, len-cpy_index,
+				current_sg->offset);

CHECK: Alignment should match open parenthesis
#58: FILE: drivers/crypto/caam/sg_sw_sec4.h:150:
+               sg_map_copy(dest + cpy_index, current_sg, len-cpy_index,
+                               current_sg->offset);




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




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux