<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/crypto, branch v2.6.26</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.26</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.26'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2008-07-10T12:34:38Z</updated>
<entry>
<title>crypto: chainiv - Invoke completion function</title>
<updated>2008-07-10T12:34:38Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2008-07-10T09:42:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=872ac8743cb400192a9fce4ba2d3ffd7bb309685'/>
<id>urn:sha1:872ac8743cb400192a9fce4ba2d3ffd7bb309685</id>
<content type='text'>
When chainiv postpones requests it never calls their completion functions.
This causes symptoms such as memory leaks when IPsec is in use.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: tcrypt - Fix memory leak in test_cipher</title>
<updated>2008-07-08T07:51:44Z</updated>
<author>
<name>Darren Jenkins</name>
<email>darrenrjenkins@gmailcom</email>
</author>
<published>2008-07-08T07:51:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dbb018cd8a0fd073eaabf9de5a93f62d98bd7723'/>
<id>urn:sha1:dbb018cd8a0fd073eaabf9de5a93f62d98bd7723</id>
<content type='text'>
Coverity CID: 2306 &amp; 2307 RESOURCE_LEAK

In the second for loop in test_cipher(), data is allocated space with
kzalloc() and is only ever freed in an error case.
Looking at this loop, data is written to this memory but nothing seems
to read from it. 
So here is a patch removing the allocation, I think this is the right
fix.

Only compile tested.

Signed-off-by: Darren Jenkins &lt;darrenrjenkins@gmailcom&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>[CRYPTO] cts: Init SG tables</title>
<updated>2008-06-02T05:46:51Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2008-06-02T05:46:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c4913c7b71abc79b008a3c118628cfb59bdb0efc'/>
<id>urn:sha1:c4913c7b71abc79b008a3c118628cfb59bdb0efc</id>
<content type='text'>
Steps to reproduce:

	modprobe tcrypt		# with CONFIG_DEBUG_SG=y

testing cts(cbc(aes)) encryption
test 1 (128 bit key):
------------[ cut here ]------------
kernel BUG at include/linux/scatterlist.h:65!
invalid opcode: 0000 [1] PREEMPT SMP DEBUG_PAGEALLOC
CPU 0 
Modules linked in: tea xts twofish twofish_common tcrypt(+) [maaaany]
Pid: 16151, comm: modprobe Not tainted 2.6.26-rc4-fat #7
RIP: 0010:[&lt;ffffffffa0bf032e&gt;]  [&lt;ffffffffa0bf032e&gt;] :cts:cts_cbc_encrypt+0x151/0x355
RSP: 0018:ffff81016f497a88  EFLAGS: 00010286
RAX: ffffe20009535d58 RBX: ffff81016f497af0 RCX: 0000000087654321
RDX: ffff8100010d4f28 RSI: ffff81016f497ee8 RDI: ffff81016f497ac0
RBP: ffff81016f497c38 R08: 0000000000000000 R09: 0000000000000011
R10: ffffffff00000008 R11: ffff8100010d4f28 R12: ffff81016f497ac0
R13: ffff81016f497b30 R14: 0000000000000010 R15: 0000000000000010
FS:  00007fac6fa276f0(0000) GS:ffffffff8060e000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f12ca7cc000 CR3: 000000016f441000 CR4: 00000000000026e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff4ff0 DR7: 0000000000000400
Process modprobe (pid: 16151, threadinfo ffff81016f496000, task ffff8101755b4ae0)
Stack:  0000000000000001 ffff81016f496000 ffffffff80719f78 0000000000000001
 0000000000000001 ffffffff8020c87c ffff81016f99c918 20646c756f772049
 65687420656b696c 0000000000000020 0000000000000000 0000000033341102
Call Trace:
 [&lt;ffffffff8020c87c&gt;] ? restore_args+0x0/0x30
 [&lt;ffffffffa04aa311&gt;] ? :aes_generic:crypto_aes_expand_key+0x311/0x369
 [&lt;ffffffff802ab453&gt;] ? check_object+0x15a/0x213
 [&lt;ffffffff802aad22&gt;] ? init_object+0x6e/0x76
 [&lt;ffffffff802ac3ae&gt;] ? __slab_free+0xfc/0x371
 [&lt;ffffffffa0bf05ed&gt;] :cts:crypto_cts_encrypt+0xbb/0xca
 [&lt;ffffffffa07108de&gt;] ? :crypto_blkcipher:setkey+0xc7/0xec
 [&lt;ffffffffa07110b8&gt;] :crypto_blkcipher:async_encrypt+0x38/0x3a
 [&lt;ffffffffa2ce9341&gt;] :tcrypt:test_cipher+0x261/0x7c6
 [&lt;ffffffffa2cfd9df&gt;] :tcrypt:tcrypt_mod_init+0x9df/0x1b30
 [&lt;ffffffff80261e35&gt;] sys_init_module+0x9e/0x1b2
 [&lt;ffffffff8020c15a&gt;] system_call_after_swapgs+0x8a/0x8f
Code: 45 c0 e8 aa 24 63 df 48 c1 e8 0c 48 b9 00 00 00 00 00 e2 ff ff 48 8b 55 88 48 6b c0 68 48 01 c8 b9 21 43 65 87 48 39 4d 80 74 04 &lt;0f&gt; 0b eb fe f6 c2 01 74 04 0f 0b eb fe 83 e2 03 4c 89 ef 44 89 
RIP  [&lt;ffffffffa0bf032e&gt;] :cts:cts_cbc_encrypt+0x151/0x355
 RSP &lt;ffff81016f497a88&gt;
---[ end trace e8bahiarjand37fd ]---

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>[CRYPTO] hmac: Avoid calling virt_to_page on key</title>
<updated>2008-05-07T13:08:56Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2008-05-06T12:46:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=67412f0e78dfbbbcb36e631d9df70c6c559d60d4'/>
<id>urn:sha1:67412f0e78dfbbbcb36e631d9df70c6c559d60d4</id>
<content type='text'>
When HMAC gets a key longer than the block size of the hash, it needs
to feed it as input to the hash to reduce it to a fixed length.  As
it is HMAC converts the key to a scatter and gather list.  However,
this doesn't work on certain platforms if the key is not allocated
via kmalloc.  For example, the keys from tcrypt are stored in the
rodata section and this causes it to fail with HMAC on x86-64.

This patch fixes this by copying the key to memory obtained via
kmalloc before hashing it.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>[CRYPTO] cryptd: Correct kzalloc error test</title>
<updated>2008-05-01T10:22:28Z</updated>
<author>
<name>Julia Lawall</name>
<email>julia@diku.dk</email>
</author>
<published>2008-04-29T16:27:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b1145ce395f7785487c128fe8faf8624e6586d84'/>
<id>urn:sha1:b1145ce395f7785487c128fe8faf8624e6586d84</id>
<content type='text'>
Normally, kzalloc returns NULL or a valid pointer value, not a value to be
tested using IS_ERR.

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>[CRYPTO] eseqiv: Fix off-by-one encryption</title>
<updated>2008-05-01T10:22:28Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2008-04-29T13:57:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=46f8153cc59384eb09a426d044668d4801f818ce'/>
<id>urn:sha1:46f8153cc59384eb09a426d044668d4801f818ce</id>
<content type='text'>
After attaching the IV to the head during encryption, eseqiv does not
increase the encryption length by that amount.  As such the last block
of the actual plain text will be left unencrypted.

Fortunately the only user of this code hifn currently crashes so this
shouldn't affect anyone :)

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>[CRYPTO] authenc: Fix async crypto crash in crypto_authenc_genicv()</title>
<updated>2008-05-01T10:22:28Z</updated>
<author>
<name>Patrick McHardy</name>
<email>kaber@trash.net</email>
</author>
<published>2008-04-29T13:44:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=161613293fd4b7d5ceb1faab788f47e688e07a67'/>
<id>urn:sha1:161613293fd4b7d5ceb1faab788f47e688e07a67</id>
<content type='text'>
crypto_authenc_givencrypt_done uses req-&gt;data as struct aead_givcrypt_request,
while it really points to a struct aead_request, causing this crash:

BUG: unable to handle kernel paging request at 6b6b6b6b
IP: [&lt;dc87517b&gt;] :authenc:crypto_authenc_genicv+0x23/0x109
*pde = 00000000
Oops: 0000 [#1] PREEMPT DEBUG_PAGEALLOC
Modules linked in: hifn_795x authenc esp4 aead xfrm4_mode_tunnel sha1_generic hmac crypto_hash]

Pid: 3074, comm: ping Not tainted (2.6.25 #4)
EIP: 0060:[&lt;dc87517b&gt;] EFLAGS: 00010296 CPU: 0
EIP is at crypto_authenc_genicv+0x23/0x109 [authenc]
EAX: daa04690 EBX: daa046e0 ECX: dab0a100 EDX: daa046b0
ESI: 6b6b6b6b EDI: dc872054 EBP: c033ff60 ESP: c033ff0c
 DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
Process ping (pid: 3074, ti=c033f000 task=db883a80 task.ti=dab6c000)
Stack: 00000000 daa046b0 c0215a3e daa04690 dab0a100 00000000 ffffffff db9fd7f0
       dba208c0 dbbb1720 00000001 daa04720 00000001 c033ff54 c0119ca9 dc852a75
       c033ff60 c033ff60 daa046e0 00000000 00000001 c033ff6c dc87527b 00000001
Call Trace:
 [&lt;c0215a3e&gt;] ? dev_alloc_skb+0x14/0x29
 [&lt;c0119ca9&gt;] ? printk+0x15/0x17
 [&lt;dc87527b&gt;] ? crypto_authenc_givencrypt_done+0x1a/0x27 [authenc]
 [&lt;dc850cca&gt;] ? hifn_process_ready+0x34a/0x352 [hifn_795x]
 [&lt;dc8353c7&gt;] ? rhine_napipoll+0x3f2/0x3fd [via_rhine]
 [&lt;dc851a56&gt;] ? hifn_check_for_completion+0x4d/0xa6 [hifn_795x]
 [&lt;dc851ab9&gt;] ? hifn_tasklet_callback+0xa/0xc [hifn_795x]
 [&lt;c011d046&gt;] ? tasklet_action+0x3f/0x66
 [&lt;c011d230&gt;] ? __do_softirq+0x38/0x7a
 [&lt;c0105a5f&gt;] ? do_softirq+0x3e/0x71
 [&lt;c011d17c&gt;] ? irq_exit+0x2c/0x65
 [&lt;c010e0c0&gt;] ? smp_apic_timer_interrupt+0x5f/0x6a
 [&lt;c01042e4&gt;] ? apic_timer_interrupt+0x28/0x30
 [&lt;dc851640&gt;] ? hifn_handle_req+0x44a/0x50d [hifn_795x]
 ...

Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>[CRYPTO] kconfig: Ordering cleanup</title>
<updated>2008-04-21T02:19:34Z</updated>
<author>
<name>Sebastian Siewior</name>
<email>sebastian@breakpoint.cc</email>
</author>
<published>2008-04-05T13:04:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=584fffc8b1965cc09ebc4b7608bafcbf12ad5244'/>
<id>urn:sha1:584fffc8b1965cc09ebc4b7608bafcbf12ad5244</id>
<content type='text'>
Ciphers, block modes, name it, are grouped together and sorted.

Signed-off-by: Sebastian Siewior &lt;sebastian@breakpoint.cc&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>[CRYPTO] all: Clean up init()/fini()</title>
<updated>2008-04-21T02:19:34Z</updated>
<author>
<name>Kamalesh Babulal</name>
<email>kamalesh@linux.vnet.ibm.com</email>
</author>
<published>2008-04-05T13:00:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3af5b90bde5000abc739996cb03fd718e753d053'/>
<id>urn:sha1:3af5b90bde5000abc739996cb03fd718e753d053</id>
<content type='text'>
On Thu, Mar 27, 2008 at 03:40:36PM +0100, Bodo Eggert wrote:
&gt; Kamalesh Babulal &lt;kamalesh@linux.vnet.ibm.com&gt; wrote:
&gt; 
&gt; &gt; This patch cleanups the crypto code, replaces the init() and fini()
&gt; &gt; with the &lt;algorithm name&gt;_init/_fini
&gt; 
&gt; This part ist OK.
&gt; 
&gt; &gt; or init/fini_&lt;algorithm name&gt; (if the 
&gt; &gt; &lt;algorithm name&gt;_init/_fini exist)
&gt; 
&gt; Having init_foo and foo_init won't be a good thing, will it? I'd start
&gt; confusing them.
&gt; 
&gt; What about foo_modinit instead?

Thanks for the suggestion, the init() is replaced with

	&lt;algorithm name&gt;_mod_init ()

and fini () is replaced with &lt;algorithm name&gt;_mod_fini.
 
Signed-off-by: Kamalesh Babulal &lt;kamalesh@linux.vnet.ibm.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>[CRYPTO] aes: Export generic setkey</title>
<updated>2008-04-21T02:19:34Z</updated>
<author>
<name>Sebastian Siewior</name>
<email>sebastian@breakpoint.cc</email>
</author>
<published>2008-04-01T12:58:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5427663f498e19b441277de72ce7a685511f247c'/>
<id>urn:sha1:5427663f498e19b441277de72ce7a685511f247c</id>
<content type='text'>
The key expansion routine could be get little more generic, become
a kernel doc entry and then get exported.

Signed-off-by: Sebastian Siewior &lt;sebastian@breakpoint.cc&gt;
Tested-by: Stefan Hellermann &lt;stefan@the2masters.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
