Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
On Fri, Jan 11, 2008 at 12:21:50AM +0100, Torben Viets wrote: > > Why I can't see both in /proc/crypto and of course not use in int > cryptsetup, till I make a /etc/init.d/udev restart ist ths a kernel bug, > or a ubuntu bug? The algorithm xts(aes) is an instantiation of the xts template. As such you won't see it until someone tries to use it or you instantiate it explicitly (which isn't possible yet :) Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
Woot, it works, in XTS and LRW mode thanks, but I have one last question (it sounds like I'm columbo ;) ) Why I can't see both in /proc/crypto and of course not use in int cryptsetup, till I make a /etc/init.d/udev restart ist ths a kernel bug, or a ubuntu bug? Thanks Torben Viets Herbert Xu wrote: Torben Viets <[EMAIL PROTECTED]> wrote: After rebuilding the kernel, I tried: cryptsetup -c aes-xts-plain -s 256 luksFormat /dev/raid/test It does the same as before, dmesg says: general protection fault: [#1] Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE xt_tcpudp pppoe pppox xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables af_packet ppp_generic slhc aes_i586 dm_crypt dm_mod Pid: 4409, comm: kcryptd Not tainted (2.6.24-rc7 #2) EIP: 0060:[] EFLAGS: 00010282 CPU: 0 EIP is at aes_crypt_copy+0x2c/0x50 EAX: f62e1ff0 EBX: f60ab850 ECX: 0001 EDX: f60ab830 ESI: f620dda8 EDI: f620dda8 EBP: f62e1ff0 ESP: f620dda8 Oh I see. I misdiagnosed the problem. The problem is that for some reason gcc cannot guarantee 16-byte alignment for variables on the stack in the kernel. As you can see from ESI/EDI above the temporary buffer is unaligned. Please try this patch instead. Thanks, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
Torben Viets <[EMAIL PROTECTED]> wrote: > > After rebuilding the kernel, I tried: cryptsetup -c aes-xts-plain -s 256 > luksFormat /dev/raid/test > > It does the same as before, dmesg says: > > general protection fault: [#1] > Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE > xt_tcpudp pppoe pppox xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 > iptable_filter ip_tables x_tables af_packet ppp_generic slhc aes_i586 > dm_crypt dm_mod > > Pid: 4409, comm: kcryptd Not tainted (2.6.24-rc7 #2) > EIP: 0060:[] EFLAGS: 00010282 CPU: 0 > EIP is at aes_crypt_copy+0x2c/0x50 > EAX: f62e1ff0 EBX: f60ab850 ECX: 0001 EDX: f60ab830 > ESI: f620dda8 EDI: f620dda8 EBP: f62e1ff0 ESP: f620dda8 Oh I see. I misdiagnosed the problem. The problem is that for some reason gcc cannot guarantee 16-byte alignment for variables on the stack in the kernel. As you can see from ESI/EDI above the temporary buffer is unaligned. Please try this patch instead. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c index a337b69..5f7e718 100644 --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c @@ -429,8 +429,8 @@ static inline void padlock_xcrypt(const u8 *input, u8 *output, void *key, static void aes_crypt_copy(const u8 *in, u8 *out, u32 *key, struct cword *cword) { - u8 tmp[AES_BLOCK_SIZE * 2] - __attribute__ ((__aligned__(PADLOCK_ALIGNMENT))); + u8 buf[AES_BLOCK_SIZE * 2 + PADLOCK_ALIGNMENT - 1]; + u8 *tmp = PTR_ALIGN([0], PADLOCK_ALIGNMENT); memcpy(tmp, in, AES_BLOCK_SIZE); padlock_xcrypt(tmp, out, key, cword); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
Thanks for the reply, the patch doesn't work witch the patch utility, so I did it manually, hope this was rigth: static void aes_crypt_copy(const u8 *in, u8 *out, u32 *key, struct cword *cword) { u8 tmp[AES_BLOCK_SIZE * 2] __attribute__ ((__aligned__(PADLOCK_ALIGNMENT))); memcpy(tmp, in, AES_BLOCK_SIZE); // padlock_xcrypt(tmp, out, key, cword); padlock_xcrypt(tmp, tmp, key, cword); memcpy(out, tmp, AES_BLOCK_SIZE); } After rebuilding the kernel, I tried: cryptsetup -c aes-xts-plain -s 256 luksFormat /dev/raid/test It does the same as before, dmesg says: general protection fault: [#1] Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE xt_tcpudp pppoe pppox xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables af_packet ppp_generic slhc aes_i586 dm_crypt dm_mod Pid: 4409, comm: kcryptd Not tainted (2.6.24-rc7 #2) EIP: 0060:[] EFLAGS: 00010282 CPU: 0 EIP is at aes_crypt_copy+0x2c/0x50 EAX: f62e1ff0 EBX: f60ab850 ECX: 0001 EDX: f60ab830 ESI: f620dda8 EDI: f620dda8 EBP: f62e1ff0 ESP: f620dda8 DS: 007b ES: 007b FS: GS: SS: 0068 Process kcryptd (pid: 4409, ti=f620c000 task=f61f5030 task.ti=f620c000) Stack: 638522f6 b587b135 a30487c5 d57aa809 f620de50 f620defc c02613e1 007b f60ab850 f62e1ff0 f62e1ff0 f620de00 c0359ad6 f60ab830 f62e1ff0 f62e1ff0 0010 c0267cfc f6edf6e0 f620de34 f620dea8 0010 8f88b41a 3ba46549 Call Trace: [] blkcipher_walk_next+0x151/0x320 [] aes_decrypt+0x56/0x60 [] crypt+0xdc/0x110 [] aes_decrypt+0x0/0x60 [] decrypt+0x42/0x50 [] aes_encrypt+0x0/0x60 [] aes_decrypt+0x0/0x60 [] crypt_convert_scatterlist+0x6e/0xe0 [dm_crypt] [] crypt_convert+0x19a/0x1c0 [dm_crypt] [] kcryptd_do_crypt+0x0/0x260 [dm_crypt] [] kcryptd_do_crypt+0x49/0x260 [dm_crypt] [] update_curr+0xfa/0x110 [] kcryptd_do_crypt+0x0/0x260 [dm_crypt] [] run_workqueue+0x66/0xe0 [] schedule+0x149/0x270 [] worker_thread+0x0/0x100 [] worker_thread+0x9d/0x100 [] autoremove_wake_function+0x0/0x50 [] worker_thread+0x0/0x100 [] kthread+0x42/0x70 [] kthread+0x0/0x70 [] kernel_thread_helper+0x7/0x18 === Code: ec 30 89 5c 24 20 89 cb 89 74 24 24 89 c6 89 7c 24 28 89 e7 89 6c 24 2c 89 d5 8b 54 24 34 a5 a5 a5 a5 b9 01 00 00 00 89 e6 89 e7 0f a7 c8 89 ef 89 e6 a5 a5 a5 a5 8b 5c 24 20 8b 74 24 24 8b EIP: [] aes_crypt_copy+0x2c/0x50 SS:ESP 0068:f620dda8 ---[ end trace 927124c395b6378a ]--- note: kcryptd[4409] exited with preempt_count 1 One other strange thing ist, that after rebooting the entry: name : xts(aes) driver : xts(aes-padlock) module : kernel priority : 300 refcnt : 2 type : blkcipher blocksize: 16 min keysize : 32 max keysize : 64 ivsize : 16 is not visible in /proc/crypt (and of course not useable with cryptsetup), till I use /etc/init.d/udev restart. Sorry I don't no why this happens. I guess it is because of reloading the modules, these are my modules: xt_TCPMSS 3840 1 xt_tcpmss 2176 1 iptable_mangle 2752 1 ipt_MASQUERADE 3456 1 xt_tcpudp 3136 6 pppoe 12800 2 pppox 3852 1 pppoe xt_mark 1792 1 xt_state2368 1 iptable_nat 7236 1 nf_nat 17964 2 ipt_MASQUERADE,iptable_nat nf_conntrack_ipv4 9988 3 iptable_nat iptable_filter 2880 1 ip_tables 12232 3 iptable_mangle,iptable_nat,iptable_filter x_tables 14724 8 xt_TCPMSS,xt_tcpmss,ipt_MASQUERADE,xt_tcpudp,xt_mark,xt_state,iptable_nat,ip_tables af_packet 21188 4 ppp_generic23700 6 pppoe,pppox slhc6464 1 ppp_generic aes_i586 33280 0 dm_crypt 13956 1 dm_mod 54976 14 dm_crypt grettings Torben Viets > -Ursprüngliche Nachricht- > Von: "Herbert Xu" <[EMAIL PROTECTED]> > Gesendet: 10.01.08 04:03:26 > An: Torben Viets <[EMAIL PROTECTED]> > CC: linux-kernel@vger.kernel.org, Linux Crypto Mailing List <[EMAIL > PROTECTED]> > Betreff: Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7? > > On Wed, Jan 09, 2008 at 10:55:27PM +, Torben Viets wrote: > > > > eneral protection fault: [#1] > > Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE > > xt_tcpudp xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 > > iptable_filter ip_tables x_tables pppoe pppox af_packet ppp_generic slhc > > aes_i586 > > CPU:0 > > EIP:0060:[]Not tainted VLI > > EFLAGS: 00010292 (2.6.23.12 #7) > > EIP is at aes_crypt_copy+0x28/0x40 > > eax: f7639ff0 ebx: f6c24050 ecx: 0001 edx: f6c24030 > > esi: f7e89dc8 edi: f7639ff0 ebp: 0001 esp: f7e89dc8 > >
Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
Thanks for the reply, the patch doesn't work witch the patch utility, so I did it manually, hope this was rigth: static void aes_crypt_copy(const u8 *in, u8 *out, u32 *key, struct cword *cword) { u8 tmp[AES_BLOCK_SIZE * 2] __attribute__ ((__aligned__(PADLOCK_ALIGNMENT))); memcpy(tmp, in, AES_BLOCK_SIZE); // padlock_xcrypt(tmp, out, key, cword); padlock_xcrypt(tmp, tmp, key, cword); memcpy(out, tmp, AES_BLOCK_SIZE); } After rebuilding the kernel, I tried: cryptsetup -c aes-xts-plain -s 256 luksFormat /dev/raid/test It does the same as before, dmesg says: general protection fault: [#1] Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE xt_tcpudp pppoe pppox xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables af_packet ppp_generic slhc aes_i586 dm_crypt dm_mod Pid: 4409, comm: kcryptd Not tainted (2.6.24-rc7 #2) EIP: 0060:[c03599cc] EFLAGS: 00010282 CPU: 0 EIP is at aes_crypt_copy+0x2c/0x50 EAX: f62e1ff0 EBX: f60ab850 ECX: 0001 EDX: f60ab830 ESI: f620dda8 EDI: f620dda8 EBP: f62e1ff0 ESP: f620dda8 DS: 007b ES: 007b FS: GS: SS: 0068 Process kcryptd (pid: 4409, ti=f620c000 task=f61f5030 task.ti=f620c000) Stack: 638522f6 b587b135 a30487c5 d57aa809 f620de50 f620defc c02613e1 007b f60ab850 f62e1ff0 f62e1ff0 f620de00 c0359ad6 f60ab830 f62e1ff0 f62e1ff0 0010 c0267cfc f6edf6e0 f620de34 f620dea8 0010 8f88b41a 3ba46549 Call Trace: [c02613e1] blkcipher_walk_next+0x151/0x320 [c0359ad6] aes_decrypt+0x56/0x60 [c0267cfc] crypt+0xdc/0x110 [c0359a80] aes_decrypt+0x0/0x60 [c0267e22] decrypt+0x42/0x50 [c035a1c0] aes_encrypt+0x0/0x60 [c0359a80] aes_decrypt+0x0/0x60 [f886a7de] crypt_convert_scatterlist+0x6e/0xe0 [dm_crypt] [f886a9ea] crypt_convert+0x19a/0x1c0 [dm_crypt] [f886aa10] kcryptd_do_crypt+0x0/0x260 [dm_crypt] [f886aa59] kcryptd_do_crypt+0x49/0x260 [dm_crypt] [c011964a] update_curr+0xfa/0x110 [f886aa10] kcryptd_do_crypt+0x0/0x260 [dm_crypt] [c012aeb6] run_workqueue+0x66/0xe0 [c03f3339] schedule+0x149/0x270 [c012b620] worker_thread+0x0/0x100 [c012b6bd] worker_thread+0x9d/0x100 [c012e4c0] autoremove_wake_function+0x0/0x50 [c012b620] worker_thread+0x0/0x100 [c012e182] kthread+0x42/0x70 [c012e140] kthread+0x0/0x70 [c0104acf] kernel_thread_helper+0x7/0x18 === Code: ec 30 89 5c 24 20 89 cb 89 74 24 24 89 c6 89 7c 24 28 89 e7 89 6c 24 2c 89 d5 8b 54 24 34 a5 a5 a5 a5 b9 01 00 00 00 89 e6 89 e7 f3 0f a7 c8 89 ef 89 e6 a5 a5 a5 a5 8b 5c 24 20 8b 74 24 24 8b EIP: [c03599cc] aes_crypt_copy+0x2c/0x50 SS:ESP 0068:f620dda8 ---[ end trace 927124c395b6378a ]--- note: kcryptd[4409] exited with preempt_count 1 One other strange thing ist, that after rebooting the entry: name : xts(aes) driver : xts(aes-padlock) module : kernel priority : 300 refcnt : 2 type : blkcipher blocksize: 16 min keysize : 32 max keysize : 64 ivsize : 16 is not visible in /proc/crypt (and of course not useable with cryptsetup), till I use /etc/init.d/udev restart. Sorry I don't no why this happens. I guess it is because of reloading the modules, these are my modules: xt_TCPMSS 3840 1 xt_tcpmss 2176 1 iptable_mangle 2752 1 ipt_MASQUERADE 3456 1 xt_tcpudp 3136 6 pppoe 12800 2 pppox 3852 1 pppoe xt_mark 1792 1 xt_state2368 1 iptable_nat 7236 1 nf_nat 17964 2 ipt_MASQUERADE,iptable_nat nf_conntrack_ipv4 9988 3 iptable_nat iptable_filter 2880 1 ip_tables 12232 3 iptable_mangle,iptable_nat,iptable_filter x_tables 14724 8 xt_TCPMSS,xt_tcpmss,ipt_MASQUERADE,xt_tcpudp,xt_mark,xt_state,iptable_nat,ip_tables af_packet 21188 4 ppp_generic23700 6 pppoe,pppox slhc6464 1 ppp_generic aes_i586 33280 0 dm_crypt 13956 1 dm_mod 54976 14 dm_crypt grettings Torben Viets -Ursprüngliche Nachricht- Von: Herbert Xu [EMAIL PROTECTED] Gesendet: 10.01.08 04:03:26 An: Torben Viets [EMAIL PROTECTED] CC: linux-kernel@vger.kernel.org, Linux Crypto Mailing List [EMAIL PROTECTED] Betreff: Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7? On Wed, Jan 09, 2008 at 10:55:27PM +, Torben Viets wrote: eneral protection fault: [#1] Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE xt_tcpudp xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables pppoe pppox af_packet ppp_generic slhc aes_i586 CPU:0 EIP:0060:[c035b828]Not tainted VLI EFLAGS: 00010292 (2.6.23.12 #7) EIP is at aes_crypt_copy+0x28/0x40 eax: f7639ff0 ebx: f6c24050 ecx: 0001 edx: f6c24030 esi: f7e89dc8 edi: f7639ff0 ebp: 0001
Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
Torben Viets [EMAIL PROTECTED] wrote: After rebuilding the kernel, I tried: cryptsetup -c aes-xts-plain -s 256 luksFormat /dev/raid/test It does the same as before, dmesg says: general protection fault: [#1] Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE xt_tcpudp pppoe pppox xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables af_packet ppp_generic slhc aes_i586 dm_crypt dm_mod Pid: 4409, comm: kcryptd Not tainted (2.6.24-rc7 #2) EIP: 0060:[c03599cc] EFLAGS: 00010282 CPU: 0 EIP is at aes_crypt_copy+0x2c/0x50 EAX: f62e1ff0 EBX: f60ab850 ECX: 0001 EDX: f60ab830 ESI: f620dda8 EDI: f620dda8 EBP: f62e1ff0 ESP: f620dda8 Oh I see. I misdiagnosed the problem. The problem is that for some reason gcc cannot guarantee 16-byte alignment for variables on the stack in the kernel. As you can see from ESI/EDI above the temporary buffer is unaligned. Please try this patch instead. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c index a337b69..5f7e718 100644 --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c @@ -429,8 +429,8 @@ static inline void padlock_xcrypt(const u8 *input, u8 *output, void *key, static void aes_crypt_copy(const u8 *in, u8 *out, u32 *key, struct cword *cword) { - u8 tmp[AES_BLOCK_SIZE * 2] - __attribute__ ((__aligned__(PADLOCK_ALIGNMENT))); + u8 buf[AES_BLOCK_SIZE * 2 + PADLOCK_ALIGNMENT - 1]; + u8 *tmp = PTR_ALIGN(buf[0], PADLOCK_ALIGNMENT); memcpy(tmp, in, AES_BLOCK_SIZE); padlock_xcrypt(tmp, out, key, cword); -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
Woot, it works, in XTS and LRW mode thanks, but I have one last question (it sounds like I'm columbo ;) ) Why I can't see both in /proc/crypto and of course not use in int cryptsetup, till I make a /etc/init.d/udev restart ist ths a kernel bug, or a ubuntu bug? Thanks Torben Viets Herbert Xu wrote: Torben Viets [EMAIL PROTECTED] wrote: After rebuilding the kernel, I tried: cryptsetup -c aes-xts-plain -s 256 luksFormat /dev/raid/test It does the same as before, dmesg says: general protection fault: [#1] Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE xt_tcpudp pppoe pppox xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables af_packet ppp_generic slhc aes_i586 dm_crypt dm_mod Pid: 4409, comm: kcryptd Not tainted (2.6.24-rc7 #2) EIP: 0060:[c03599cc] EFLAGS: 00010282 CPU: 0 EIP is at aes_crypt_copy+0x2c/0x50 EAX: f62e1ff0 EBX: f60ab850 ECX: 0001 EDX: f60ab830 ESI: f620dda8 EDI: f620dda8 EBP: f62e1ff0 ESP: f620dda8 Oh I see. I misdiagnosed the problem. The problem is that for some reason gcc cannot guarantee 16-byte alignment for variables on the stack in the kernel. As you can see from ESI/EDI above the temporary buffer is unaligned. Please try this patch instead. Thanks, -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
On Fri, Jan 11, 2008 at 12:21:50AM +0100, Torben Viets wrote: Why I can't see both in /proc/crypto and of course not use in int cryptsetup, till I make a /etc/init.d/udev restart ist ths a kernel bug, or a ubuntu bug? The algorithm xts(aes) is an instantiation of the xts template. As such you won't see it until someone tries to use it or you instantiate it explicitly (which isn't possible yet :) Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
On Wed, Jan 09, 2008 at 10:55:27PM +, Torben Viets wrote: > > eneral protection fault: [#1] > Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE > xt_tcpudp xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 > iptable_filter ip_tables x_tables pppoe pppox af_packet ppp_generic slhc > aes_i586 > CPU:0 > EIP:0060:[]Not tainted VLI > EFLAGS: 00010292 (2.6.23.12 #7) > EIP is at aes_crypt_copy+0x28/0x40 > eax: f7639ff0 ebx: f6c24050 ecx: 0001 edx: f6c24030 > esi: f7e89dc8 edi: f7639ff0 ebp: 0001 esp: f7e89dc8 Thanks for the report. It would appear that your CPU goes one step further than the other report and insists on having two blocks in the destination too. Please let me know whether this patch fixes the problem. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c index a337b69..ed3ae47 100644 --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c @@ -433,7 +433,8 @@ static void aes_crypt_copy(const u8 *in, u8 *out, u32 *key, struct cword *cword) __attribute__ ((__aligned__(PADLOCK_ALIGNMENT))); memcpy(tmp, in, AES_BLOCK_SIZE); - padlock_xcrypt(tmp, out, key, cword); + padlock_xcrypt(tmp, tmp, key, cword); + memcpy(out, tmp, AES_BLOCK_SIZE); } static inline void aes_crypt(const u8 *in, u8 *out, u32 *key, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
Hello again, I've tried a little bit more with the XTS and the LRW Cipher, XTS is unuseable it crashes with the kernel panic below. LRW doenst work in 2.6.23.12 with/without the patch from http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg244470.html or with 2.6.24-rc7 My System ist Ubuntu 7.10 with cryptsetup 2:1.0.5-2ubuntu2 everytime I use cryptsetup -c aes-lrw-benbi -s 256 luksFormat /dev/raid/test I get the following in dmesg: eneral protection fault: [#1] Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE xt_tcpudp xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables pppoe pppox af_packet ppp_generic slhc aes_i586 CPU:0 EIP:0060:[]Not tainted VLI EFLAGS: 00010292 (2.6.23.12 #7) EIP is at aes_crypt_copy+0x28/0x40 eax: f7639ff0 ebx: f6c24050 ecx: 0001 edx: f6c24030 esi: f7e89dc8 edi: f7639ff0 ebp: 0001 esp: f7e89dc8 ds: 007b es: 007b fs: gs: ss: 0068 Process kcryptd/0 (pid: 937, ti=f7e88000 task=f7d85ab0 task.ti=f7e88000) Stack: dd7f6714 1b8c0a97 19fd5394 4492154e f7e89ef8 c0262f42 007b f7e89ec8 f6c24050 f7639ff0 f7639ff0 c035bda6 f6c24030 f7639ff0 f7e89e28 c02681e6 f7639ff0 f76c6020 f7e89e58 f7e89ec8 0010 f7e89ea0 0010 Call Trace: [] blkcipher_walk_next+0x132/0x2f0 [] aes_decrypt+0x56/0x60 [] crypt+0xe6/0x220 [] aes_decrypt+0x0/0x60 [] decrypt+0x32/0x40 [] aes_decrypt+0x0/0x60 [] crypt_convert_scatterlist+0x6e/0xe0 [] __make_request+0x1a3/0x480 [] crypt_convert+0x138/0x150 [] kcryptd_do_work+0x0/0x310 [] kcryptd_do_work+0x253/0x310 [] update_stats_wait_end+0xa7/0xe0 [] kcryptd_do_work+0x0/0x310 [] run_workqueue+0x66/0xe0 [] worker_thread+0x0/0x100 [] worker_thread+0x9d/0x100 [] autoremove_wake_function+0x0/0x50 [] worker_thread+0x0/0x100 [] kthread+0x42/0x70 [] kthread+0x0/0x70 [] kernel_thread_helper+0x7/0x18 === Code: 90 90 90 83 ec 2c 89 5c 24 20 89 cb 89 74 24 24 89 c6 89 d0 89 7c 24 28 8b 54 24 30 89 e7 a5 a5 a5 a5 b9 01 00 00 00 89 e6 89 c7 0f a7 c8 8b 5c 24 20 8b 74 24 24 8b 7c 24 28 83 c4 2c c3 8d EIP: [] aes_crypt_copy+0x28/0x40 SS:ESP 0068:f7e89dc8 note: kcryptd/0[937] exited with preempt_count 1 I'm not on the list, please CC me. Thanks and greetings Torben Viets Torben Viets wrote: Hello, I have a Via Epia Sn1000 Board with a padlock-aes crypto accelerator, if I uses this with cryptsetup and LRW or XTS, I get a kernel panic and cryptsetup never ends. XTS: cryptsetup -c aes-xts-plain -s 256 luksFormat /dev/raid/test general protection fault: [#1] Modules linked in: lrw padlock_aes xts xt_TCPMSS xt_tcpmss iptable_mangle pppoe pppox ipt_MASQUERADE xt_tcpudp iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables af_packet ppp_generic slhc aes_i586 dm_crypt dm_mod Pid: 5991, comm: kcryptd Not tainted (2.6.24-rc7 #4) EIP: 0060:[] EFLAGS: 00010296 CPU: 0 EIP is at aes_crypt_copy+0x28/0x40 [padlock_aes] EAX: f6385ff0 EBX: f61ce450 ECX: 0001 EDX: f61ce430 ESI: f6235dac EDI: f6385ff0 EBP: f6235e00 ESP: f6235dac DS: 007b ES: 007b FS: GS: SS: 0068 Process kcryptd (pid: 5991, ti=f6234000 task=f63fcab0 task.ti=f6234000) Stack: 811cd642 f3a4d1ea d12d0cfa 3098ed1e ff24 c02695d8 0060 f61ce450 f6385ff0 f6385ff0 f88cf096 f61ce430 f6385ff0 f6385ff0 0010 f88c90fc f581f3e0 f6235e34 f6235ea8 0010 f89b59df c29b34ff 391d88f0 Call Trace: [] gf128mul_x_ble+0x68/0x90 [] aes_decrypt+0x56/0x60 [padlock_aes] [] crypt+0xdc/0x110 [xts] [] aes_decrypt+0x0/0x60 [padlock_aes] [] decrypt+0x42/0x50 [xts] [] aes_encrypt+0x0/0x60 [padlock_aes] [] aes_decrypt+0x0/0x60 [padlock_aes] [] crypt_convert_scatterlist+0x6e/0xe0 [dm_crypt] [] crypt_convert+0x19a/0x1c0 [dm_crypt] [] kcryptd_do_crypt+0x0/0x260 [dm_crypt] [] kcryptd_do_crypt+0x49/0x260 [dm_crypt] [] update_curr+0x70/0x110 [] kcryptd_do_crypt+0x0/0x260 [dm_crypt] [] run_workqueue+0x66/0xe0 [] schedule+0x149/0x270 [] worker_thread+0x0/0x100 [] worker_thread+0x9d/0x100 [] autoremove_wake_function+0x0/0x50 [] worker_thread+0x0/0x100 [] kthread+0x42/0x70 [] kthread+0x0/0x70 [] kernel_thread_helper+0x7/0x18 === Code: 0f a7 c8 8b 5c 24 20 8b 74 24 24 8b 7c 24 28 83 c4 2c c3 8d 74 EIP: [] aes_crypt_copy+0x28/0x40 [padlock_aes] SS:ESP 0068:f6235dac ---[ end trace 9ae4eb03d4e4c477 ]--- note: kcryptd[5991] exited with preempt_count 1 I'm not on the lklm, so please CC me. I hope you have enough information. Thank you and greetings Torben Viets -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
Hello again, I've tried a little bit more with the XTS and the LRW Cipher, XTS is unuseable it crashes with the kernel panic below. LRW doenst work in 2.6.23.12 with/without the patch from http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg244470.html or with 2.6.24-rc7 My System ist Ubuntu 7.10 with cryptsetup 2:1.0.5-2ubuntu2 everytime I use cryptsetup -c aes-lrw-benbi -s 256 luksFormat /dev/raid/test I get the following in dmesg: eneral protection fault: [#1] Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE xt_tcpudp xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables pppoe pppox af_packet ppp_generic slhc aes_i586 CPU:0 EIP:0060:[c035b828]Not tainted VLI EFLAGS: 00010292 (2.6.23.12 #7) EIP is at aes_crypt_copy+0x28/0x40 eax: f7639ff0 ebx: f6c24050 ecx: 0001 edx: f6c24030 esi: f7e89dc8 edi: f7639ff0 ebp: 0001 esp: f7e89dc8 ds: 007b es: 007b fs: gs: ss: 0068 Process kcryptd/0 (pid: 937, ti=f7e88000 task=f7d85ab0 task.ti=f7e88000) Stack: dd7f6714 1b8c0a97 19fd5394 4492154e f7e89ef8 c0262f42 007b f7e89ec8 f6c24050 f7639ff0 f7639ff0 c035bda6 f6c24030 f7639ff0 f7e89e28 c02681e6 f7639ff0 f76c6020 f7e89e58 f7e89ec8 0010 f7e89ea0 0010 Call Trace: [c0262f42] blkcipher_walk_next+0x132/0x2f0 [c035bda6] aes_decrypt+0x56/0x60 [c02681e6] crypt+0xe6/0x220 [c035bd50] aes_decrypt+0x0/0x60 [c0268352] decrypt+0x32/0x40 [c035bd50] aes_decrypt+0x0/0x60 [c0357d5e] crypt_convert_scatterlist+0x6e/0xe0 [c0271e43] __make_request+0x1a3/0x480 [c0357f08] crypt_convert+0x138/0x150 [c03580e0] kcryptd_do_work+0x0/0x310 [c0358333] kcryptd_do_work+0x253/0x310 [c0118647] update_stats_wait_end+0xa7/0xe0 [c03580e0] kcryptd_do_work+0x0/0x310 [c012a206] run_workqueue+0x66/0xe0 [c012a9e0] worker_thread+0x0/0x100 [c012aa7d] worker_thread+0x9d/0x100 [c012d5c0] autoremove_wake_function+0x0/0x50 [c012a9e0] worker_thread+0x0/0x100 [c012d282] kthread+0x42/0x70 [c012d240] kthread+0x0/0x70 [c0104acf] kernel_thread_helper+0x7/0x18 === Code: 90 90 90 83 ec 2c 89 5c 24 20 89 cb 89 74 24 24 89 c6 89 d0 89 7c 24 28 8b 54 24 30 89 e7 a5 a5 a5 a5 b9 01 00 00 00 89 e6 89 c7 f3 0f a7 c8 8b 5c 24 20 8b 74 24 24 8b 7c 24 28 83 c4 2c c3 8d EIP: [c035b828] aes_crypt_copy+0x28/0x40 SS:ESP 0068:f7e89dc8 note: kcryptd/0[937] exited with preempt_count 1 I'm not on the list, please CC me. Thanks and greetings Torben Viets Torben Viets wrote: Hello, I have a Via Epia Sn1000 Board with a padlock-aes crypto accelerator, if I uses this with cryptsetup and LRW or XTS, I get a kernel panic and cryptsetup never ends. XTS: cryptsetup -c aes-xts-plain -s 256 luksFormat /dev/raid/test general protection fault: [#1] Modules linked in: lrw padlock_aes xts xt_TCPMSS xt_tcpmss iptable_mangle pppoe pppox ipt_MASQUERADE xt_tcpudp iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables af_packet ppp_generic slhc aes_i586 dm_crypt dm_mod Pid: 5991, comm: kcryptd Not tainted (2.6.24-rc7 #4) EIP: 0060:[f88cf028] EFLAGS: 00010296 CPU: 0 EIP is at aes_crypt_copy+0x28/0x40 [padlock_aes] EAX: f6385ff0 EBX: f61ce450 ECX: 0001 EDX: f61ce430 ESI: f6235dac EDI: f6385ff0 EBP: f6235e00 ESP: f6235dac DS: 007b ES: 007b FS: GS: SS: 0068 Process kcryptd (pid: 5991, ti=f6234000 task=f63fcab0 task.ti=f6234000) Stack: 811cd642 f3a4d1ea d12d0cfa 3098ed1e ff24 c02695d8 0060 f61ce450 f6385ff0 f6385ff0 f88cf096 f61ce430 f6385ff0 f6385ff0 0010 f88c90fc f581f3e0 f6235e34 f6235ea8 0010 f89b59df c29b34ff 391d88f0 Call Trace: [c02695d8] gf128mul_x_ble+0x68/0x90 [f88cf096] aes_decrypt+0x56/0x60 [padlock_aes] [f88c90fc] crypt+0xdc/0x110 [xts] [f88cf040] aes_decrypt+0x0/0x60 [padlock_aes] [f88c9222] decrypt+0x42/0x50 [xts] [f88cf810] aes_encrypt+0x0/0x60 [padlock_aes] [f88cf040] aes_decrypt+0x0/0x60 [padlock_aes] [f886a7de] crypt_convert_scatterlist+0x6e/0xe0 [dm_crypt] [f886a9ea] crypt_convert+0x19a/0x1c0 [dm_crypt] [f886aa10] kcryptd_do_crypt+0x0/0x260 [dm_crypt] [f886aa59] kcryptd_do_crypt+0x49/0x260 [dm_crypt] [c01195c0] update_curr+0x70/0x110 [f886aa10] kcryptd_do_crypt+0x0/0x260 [dm_crypt] [c012b116] run_workqueue+0x66/0xe0 [c03f5279] schedule+0x149/0x270 [c012b8f0] worker_thread+0x0/0x100 [c012b98d] worker_thread+0x9d/0x100 [c012e790] autoremove_wake_function+0x0/0x50 [c012b8f0] worker_thread+0x0/0x100 [c012e452] kthread+0x42/0x70 [c012e410] kthread+0x0/0x70 [c0104acf] kernel_thread_helper+0x7/0x18 === Code: f3 0f a7 c8 8b 5c 24 20 8b 74 24 24 8b 7c 24 28 83 c4 2c c3 8d 74 EIP: [f88cf028] aes_crypt_copy+0x28/0x40 [padlock_aes] SS:ESP 0068:f6235dac ---[ end trace 9ae4eb03d4e4c477 ]--- note: kcryptd[5991] exited with preempt_count 1 I'm not on the lklm, so please CC me. I hope you have enough information. Thank you and greetings Torben Viets -- To unsubscribe from this list: send the line
Re: LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
On Wed, Jan 09, 2008 at 10:55:27PM +, Torben Viets wrote: eneral protection fault: [#1] Modules linked in: xt_TCPMSS xt_tcpmss iptable_mangle ipt_MASQUERADE xt_tcpudp xt_mark xt_state iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables pppoe pppox af_packet ppp_generic slhc aes_i586 CPU:0 EIP:0060:[c035b828]Not tainted VLI EFLAGS: 00010292 (2.6.23.12 #7) EIP is at aes_crypt_copy+0x28/0x40 eax: f7639ff0 ebx: f6c24050 ecx: 0001 edx: f6c24030 esi: f7e89dc8 edi: f7639ff0 ebp: 0001 esp: f7e89dc8 Thanks for the report. It would appear that your CPU goes one step further than the other report and insists on having two blocks in the destination too. Please let me know whether this patch fixes the problem. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c index a337b69..ed3ae47 100644 --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c @@ -433,7 +433,8 @@ static void aes_crypt_copy(const u8 *in, u8 *out, u32 *key, struct cword *cword) __attribute__ ((__aligned__(PADLOCK_ALIGNMENT))); memcpy(tmp, in, AES_BLOCK_SIZE); - padlock_xcrypt(tmp, out, key, cword); + padlock_xcrypt(tmp, tmp, key, cword); + memcpy(out, tmp, AES_BLOCK_SIZE); } static inline void aes_crypt(const u8 *in, u8 *out, u32 *key, -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
LRW/XTS + Via Padlock Bug in 2.6.24-rc7?
Hello, I have a Via Epia Sn1000 Board with a padlock-aes crypto accelerator, if I uses this with cryptsetup and LRW or XTS, I get a kernel panic and cryptsetup never ends. XTS: cryptsetup -c aes-xts-plain -s 256 luksFormat /dev/raid/test general protection fault: [#1] Modules linked in: lrw padlock_aes xts xt_TCPMSS xt_tcpmss iptable_mangle pppoe pppox ipt_MASQUERADE xt_tcpudp iptable_nat nf_nat nf_conntrack_ipv4 iptable_filter ip_tables x_tables af_packet ppp_generic slhc aes_i586 dm_crypt dm_mod Pid: 5991, comm: kcryptd Not tainted (2.6.24-rc7 #4) EIP: 0060:[] EFLAGS: 00010296 CPU: 0 EIP is at aes_crypt_copy+0x28/0x40 [padlock_aes] EAX: f6385ff0 EBX: f61ce450 ECX: 0001 EDX: f61ce430 ESI: f6235dac EDI: f6385ff0 EBP: f6235e00 ESP: f6235dac DS: 007b ES: 007b FS: GS: SS: 0068 Process kcryptd (pid: 5991, ti=f6234000 task=f63fcab0 task.ti=f6234000) Stack: 811cd642 f3a4d1ea d12d0cfa 3098ed1e ff24 c02695d8 0060 f61ce450 f6385ff0 f6385ff0 f88cf096 f61ce430 f6385ff0 f6385ff0 0010 f88c90fc f581f3e0 f6235e34 f6235ea8 0010 f89b59df c29b34ff 391d88f0 Call Trace: [] gf128mul_x_ble+0x68/0x90 [] aes_decrypt+0x56/0x60 [padlock_aes] [] crypt+0xdc/0x110 [xts] [] aes_decrypt+0x0/0x60 [padlock_aes] [] decrypt+0x42/0x50 [xts] [] aes_encrypt+0x0/0x60 [padlock_aes] [] aes_decrypt+0x0/0x60 [padlock_aes] [] crypt_convert_scatterlist+0x6e/0xe0 [dm_crypt] [] crypt_convert+0x19a/0x1c0 [dm_crypt] [] kcryptd_do_crypt+0x0/0x260 [dm_crypt] [] kcryptd_do_crypt+0x49/0x260 [dm_crypt] [] update_curr+0x70/0x110 [] kcryptd_do_crypt+0x0/0x260 [dm_crypt] [] run_workqueue+0x66/0xe0 [] schedule+0x149/0x270 [] worker_thread+0x0/0x100 [] worker_thread+0x9d/0x100 [] autoremove_wake_function+0x0/0x50 [] worker_thread+0x0/0x100 [] kthread+0x42/0x70 [] kthread+0x0/0x70 [] kernel_thread_helper+0x7/0x18 === Code: 0f a7 c8 8b 5c 24 20 8b 74 24 24 8b 7c 24 28 83 c4 2c c3 8d 74 EIP: [] aes_crypt_copy+0x28/0x40 [padlock_aes] SS:ESP 0068:f6235dac ---[ end trace 9ae4eb03d4e4c477 ]--- note: kcryptd[5991] exited with preempt_count 1 I'm not on the lklm, so please CC me. I hope you have enough information. Thank you and greetings Torben Viets config.gz Description: GNU Zip compressed data