<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/libcrc32c.c, branch v4.19.204</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.19.204</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.19.204'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2018-03-26T13:09:38Z</updated>
<entry>
<title>libcrc32c: Add crc32c_impl function</title>
<updated>2018-03-26T13:09:38Z</updated>
<author>
<name>Nikolay Borisov</name>
<email>nborisov@suse.com</email>
</author>
<published>2018-01-08T09:45:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=df91f56adce1fc131e05368a0ad0ea72afd9a79a'/>
<id>urn:sha1:df91f56adce1fc131e05368a0ad0ea72afd9a79a</id>
<content type='text'>
This function returns a string with the currently in-use implementation
of the crc32c algorithm, i.e crc32c-generic (for unoptimised, generic
implementation) or crc32c-intel for the sse optimised version. This
will be used by btrfs.

Signed-off-by: Nikolay Borisov &lt;nborisov@suse.com&gt;
Acked-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
[ use crypto_shash_driver_name as suggested by Herbert ]
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>crypto: Work around deallocated stack frame reference gcc bug on sparc.</title>
<updated>2017-06-08T09:36:03Z</updated>
<author>
<name>David Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2017-06-02T15:28:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d41519a69b35b10af7fda867fb9100df24fdf403'/>
<id>urn:sha1:d41519a69b35b10af7fda867fb9100df24fdf403</id>
<content type='text'>
On sparc, if we have an alloca() like situation, as is the case with
SHASH_DESC_ON_STACK(), we can end up referencing deallocated stack
memory.  The result can be that the value is clobbered if a trap
or interrupt arrives at just the right instruction.

It only occurs if the function ends returning a value from that
alloca() area and that value can be placed into the return value
register using a single instruction.

For example, in lib/libcrc32c.c:crc32c() we end up with a return
sequence like:

        return  %i7+8
         lduw   [%o5+16], %o0   ! MEM[(u32 *)__shash_desc.1_10 + 16B],

%o5 holds the base of the on-stack area allocated for the shash
descriptor.  But the return released the stack frame and the
register window.

So if an intererupt arrives between 'return' and 'lduw', then
the value read at %o5+16 can be corrupted.

Add a data compiler barrier to work around this problem.  This is
exactly what the gcc fix will end up doing as well, and it absolutely
should not change the code generated for other cpus (unless gcc
on them has the same bug :-)

With crucial insight from Eric Sandeen.

Cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Anatoly Pugachev &lt;matorola@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6</title>
<updated>2016-01-22T19:58:43Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-01-22T19:58:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=48162a203e1d0762569d9e7d2de153d9135b35f8'/>
<id>urn:sha1:48162a203e1d0762569d9e7d2de153d9135b35f8</id>
<content type='text'>
Pull crypto fixes from Herbert Xu:
 "This fixes the following issues:

  API:
   - A large number of bug fixes for the af_alg interface, credit goes
     to Dmitry Vyukov for discovering and reporting these issues.

  Algorithms:
   - sw842 needs to select crc32.
   - The soft dependency on crc32c is now in the correct spot.

  Drivers:
   - The atmel AES driver needs HAS_DMA.
   - The atmel AES driver was a missing break statement, fortunately
     it's only a debug function.
   - A number of bug fixes for the Intel qat driver"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (24 commits)
  crypto: algif_skcipher - sendmsg SG marking is off by one
  crypto: crc32c - Fix crc32c soft dependency
  crypto: algif_skcipher - Load TX SG list after waiting
  crypto: atmel-aes - Add missing break to atmel_aes_reg_name
  crypto: algif_skcipher - Fix race condition in skcipher_check_key
  crypto: algif_hash - Fix race condition in hash_check_key
  crypto: CRYPTO_DEV_ATMEL_AES should depend on HAS_DMA
  lib: sw842: select crc32
  crypto: af_alg - Forbid bind(2) when nokey child sockets are present
  crypto: algif_skcipher - Remove custom release parent function
  crypto: algif_hash - Remove custom release parent function
  crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path
  crypto: qat - update init_esram for C3xxx dev type
  crypto: qat - fix timeout issues
  crypto: qat - remove to call get_sram_bar_id for qat_c3xxx
  crypto: algif_skcipher - Add key check exception for cipher_null
  crypto: skcipher - Add crypto_skcipher_has_setkey
  crypto: algif_hash - Require setkey before accept(2)
  crypto: hash - Add crypto_ahash_has_setkey
  crypto: algif_skcipher - Add nokey compatibility path
  ...
</content>
</entry>
<entry>
<title>lib/libcrc32c.c: fix build warning</title>
<updated>2016-01-21T01:09:18Z</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2016-01-20T22:58:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=290e0e0f2b54b2eed5018f921c585bb694f9e68a'/>
<id>urn:sha1:290e0e0f2b54b2eed5018f921c585bb694f9e68a</id>
<content type='text'>
Fix the following build warning:

  lib/libcrc32c.c:42:5: warning: no previous prototype for "crc32c" [-Wmissing-prototypes]
   u32 crc32c(u32 crc, const void *address, unsigned int length)
       ^

Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>crypto: crc32c - Fix crc32c soft dependency</title>
<updated>2016-01-19T07:52:10Z</updated>
<author>
<name>Jean Delvare</name>
<email>jdelvare@suse.de</email>
</author>
<published>2016-01-18T16:06:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fd7f6727102a1ccf6b4c1dfcc631f9b546526b26'/>
<id>urn:sha1:fd7f6727102a1ccf6b4c1dfcc631f9b546526b26</id>
<content type='text'>
I don't think it makes sense for a module to have a soft dependency
on itself. This seems quite cyclic by nature and I can't see what
purpose it could serve.

OTOH libcrc32c calls crypto_alloc_shash("crc32c", 0, 0) so it pretty
much assumes that some incarnation of the "crc32c" hash algorithm has
been loaded. Therefore it makes sense to have the soft dependency
there (as crc-t10dif does.)

Cc: stable@vger.kernel.org
Cc: Tim Chen &lt;tim.c.chen@linux.intel.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: Jean Delvare &lt;jdelvare@suse.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: LLVMLinux: Remove VLAIS usage from libcrc32c.c</title>
<updated>2014-10-14T08:51:23Z</updated>
<author>
<name>Jan-Simon Möller</name>
<email>dl9pf@gmx.de</email>
</author>
<published>2012-07-02T10:54:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ea0e0de69fc413aa80dbf1ec1fb9702ea1b6faca'/>
<id>urn:sha1:ea0e0de69fc413aa80dbf1ec1fb9702ea1b6faca</id>
<content type='text'>
Replaced the use of a Variable Length Array In Struct (VLAIS) with a C99
compliant equivalent. This patch allocates the appropriate amount of memory
using a char array using the SHASH_DESC_ON_STACK macro.

The new code can be compiled with both gcc and clang.

Signed-off-by: Jan-Simon Möller &lt;dl9pf@gmx.de&gt;
Signed-off-by: Behan Webster &lt;behanw@converseincode.com&gt;
Reviewed-by: Mark Charlebois &lt;charlebm@gmail.com&gt;
Acked-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: pageexec@freemail.hu
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>lib/libcrc32c.c: use PTR_ERR_OR_ZERO</title>
<updated>2014-06-04T23:54:18Z</updated>
<author>
<name>Fabian Frederick</name>
<email>fabf@skynet.be</email>
</author>
<published>2014-06-04T23:11:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f8eaf298c8dc034e88d772c7d4bef7e5f5a490e2'/>
<id>urn:sha1:f8eaf298c8dc034e88d772c7d4bef7e5f5a490e2</id>
<content type='text'>
replace IS_ERR/PTR_ERR

Signed-off-by: Fabian Frederick &lt;fabf@skynet.be&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>libcrc32c: Fix "crc32c undefined" compilation error</title>
<updated>2008-12-25T00:01:42Z</updated>
<author>
<name>Adrian-Ken Rueegsegger</name>
<email>rueegsegger@swiss-it.ch</email>
</author>
<published>2008-11-11T04:14:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=53b146ae598268edbe2bf7ea7dfec721d51adddd'/>
<id>urn:sha1:53b146ae598268edbe2bf7ea7dfec721d51adddd</id>
<content type='text'>
The latest shash changes leave crc32c undefined:

[...]
Building modules, stage 2.
  MODPOST 1381 modules
  ERROR: "crc32c" [net/sctp/sctp.ko] undefined!
  ERROR: "crc32c" [net/ipv4/netfilter/nf_nat_proto_sctp.ko] undefined!

Adding EXPORT_SYMBOL(crc32c) to lib/libcrc32c.c fixes the compile error.
This patch has been compile-tested only.

Signed-off-by: Adrian-Ken Rueegsegger &lt;rueegsegger@swiss-it.ch&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>libcrc32c: Move implementation to crypto crc32c</title>
<updated>2008-12-25T00:01:40Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2008-11-07T07:11:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=69c35efcf1576ab5f00cba83e8ca740923afb6c9'/>
<id>urn:sha1:69c35efcf1576ab5f00cba83e8ca740923afb6c9</id>
<content type='text'>
This patch swaps the role of libcrc32c and crc32c.  Previously
the implementation was in libcrc32c and crc32c was a wrapper.
Now the code is in crc32c and libcrc32c just calls the crypto
layer.

The reason for the change is to tap into the algorithm selection
capability of the crypto API so that optimised implementations
such as the one utilising Intel's CRC32C instruction can be
used where available.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>[LIB] crc32c: Keep intermediate crc state in cpu order</title>
<updated>2007-11-08T13:34:09Z</updated>
<author>
<name>Benny Halevy</name>
<email>bhalevy@fs1.bhalevy.com</email>
</author>
<published>2007-11-08T13:34:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ef19454bd437b2ba14c9cda1de85debd9f383484'/>
<id>urn:sha1:ef19454bd437b2ba14c9cda1de85debd9f383484</id>
<content type='text'>
crypto/crc32.c:chksum_final() is computing the digest as
*(__le32 *)out = ~cpu_to_le32(mctx-&gt;crc);
so the low-level crc32c_le routines should just keep
the crc in cpu order, otherwise it is getting swabbed
one too many times on big-endian machines.

Signed-off-by: Benny Halevy &lt;bhalevy@fs1.bhalevy.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
