rpms/kernel/F-12 crypto-via-padlock-fix-nano-aes.patch, NONE, 1.1 kernel.spec, 1.1887, 1.1888

Chuck Ebbert cebbert at fedoraproject.org
Tue Oct 27 15:42:25 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9686

Modified Files:
	kernel.spec 
Added Files:
	crypto-via-padlock-fix-nano-aes.patch 
Log Message:
Fix oops in VIA padlock-aes code.

crypto-via-padlock-fix-nano-aes.patch:
 padlock-aes.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

--- NEW FILE crypto-via-padlock-fix-nano-aes.patch ---
crypto: padlock-aes: Use the correct mask when checking whether copying is required

Masking with PAGE_SIZE is just wrong... and there's no need for the braces and return
statement either.

Signed-off-by: Chuck Ebbert <cebbert at redhat.com>

--- linux-2.6.31.noarch.orig/drivers/crypto/padlock-aes.c
+++ linux-2.6.31.noarch/drivers/crypto/padlock-aes.c
@@ -236,19 +236,17 @@ static inline void ecb_crypt(const u8 *i
 	/* Padlock in ECB mode fetches at least ecb_fetch_bytes of data.
 	 * We could avoid some copying here but it's probably not worth it.
 	 */
-	if (unlikely(((unsigned long)in & PAGE_SIZE) + ecb_fetch_bytes > PAGE_SIZE)) {
+	if (unlikely(((unsigned long)in & ~PAGE_MASK) + ecb_fetch_bytes > PAGE_SIZE))
 		ecb_crypt_copy(in, out, key, cword, count);
-		return;
-	}
-
-	rep_xcrypt_ecb(in, out, key, cword, count);
+	else
+		rep_xcrypt_ecb(in, out, key, cword, count);
 }
 
 static inline u8 *cbc_crypt(const u8 *in, u8 *out, u32 *key,
 			    u8 *iv, struct cword *cword, int count)
 {
 	/* Padlock in CBC mode fetches at least cbc_fetch_bytes of data. */
-	if (unlikely(((unsigned long)in & PAGE_SIZE) + cbc_fetch_bytes > PAGE_SIZE))
+	if (unlikely(((unsigned long)in & ~PAGE_MASK) + cbc_fetch_bytes > PAGE_SIZE))
 		return cbc_crypt_copy(in, out, key, iv, cword, count);
 
 	return rep_xcrypt_cbc(in, out, key, iv, cword, count);


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-12/kernel.spec,v
retrieving revision 1.1887
retrieving revision 1.1888
diff -u -p -r1.1887 -r1.1888
--- kernel.spec	27 Oct 2009 10:27:30 -0000	1.1887
+++ kernel.spec	27 Oct 2009 15:42:23 -0000	1.1888
@@ -771,6 +771,9 @@ Patch14411: netlink-fix-typo-in-initiali
 Patch14420: perf-events-fix-swevent-hrtimer-sampling.patch
 Patch14421: perf-events-dont-generate-events-for-the-idle-task.patch
 
+# Fix oops in padlock
+Patch14430: crypto-via-padlock-fix-nano-aes.patch
+
 %endif
 
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1442,6 +1445,9 @@ ApplyPatch netlink-fix-typo-in-initializ
 ApplyPatch perf-events-fix-swevent-hrtimer-sampling.patch
 ApplyPatch perf-events-dont-generate-events-for-the-idle-task.patch
 
+# Fix oops in padlock
+ApplyPatch crypto-via-padlock-fix-nano-aes.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2094,6 +2100,9 @@ fi
 # and build.
 
 %changelog
+* Tue Oct 27 2009 Chuck Ebbert <cebbert at redhat.com>
+- Fix oops in VIA padlock-aes code.
+
 * Tue Oct 27 2009 Dave Airlie <airlied at redhat.com>
 - kms: add offb handoff patch for ppc to work
 




More information about the fedora-extras-commits mailing list