<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/android_kernel_m2note/lib, branch mm-6.0</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=mm-6.0</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=mm-6.0'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/'/>
<updated>2016-11-07T12:46:55+00:00</updated>
<entry>
<title>KEYS: Fix ASN.1 indefinite length object parsing</title>
<updated>2016-11-07T12:46:55+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2016-02-23T11:03:12+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=14523ee1eb8ce53763ffc4b683ee33976b0236cf'/>
<id>urn:sha1:14523ee1eb8ce53763ffc4b683ee33976b0236cf</id>
<content type='text'>
This fixes CVE-2016-0758.

In the ASN.1 decoder, when the length field of an ASN.1 value is extracted,
it isn't validated against the remaining amount of data before being added
to the cursor.  With a sufficiently large size indicated, the check:

	datalen - dp &lt; 2

may then fail due to integer overflow.

Fix this by checking the length indicated against the amount of remaining
data in both places a definite length is determined.

Whilst we're at it, make the following changes:

 (1) Check the maximum size of extended length does not exceed the capacity
     of the variable it's being stored in (len) rather than the type that
     variable is assumed to be (size_t).

 (2) Compare the EOC tag to the symbolic constant ASN1_EOC rather than the
     integer 0.

 (3) To reduce confusion, move the initialisation of len outside of:

	for (len = 0; n &gt; 0; n--) {

     since it doesn't have anything to do with the loop counter n.

Change-Id: I2a103f4c191ff6c463d68d6fe703edd96aa8f0ef
Ticket: PORRIDGE-485
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Reviewed-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
Acked-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
Acked-by: Peter Jones &lt;pjones@redhat.com&gt;
</content>
</entry>
<entry>
<title>int_sqrt: Improve 3x faster integer sqrt.</title>
<updated>2016-09-10T10:06:55+00:00</updated>
<author>
<name>FlyFrog</name>
<email>ramgear@gmail.com</email>
</author>
<published>2013-09-04T05:45:44+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=b98f7895180818a0737d59d60d8e81d729f4ea46'/>
<id>urn:sha1:b98f7895180818a0737d59d60d8e81d729f4ea46</id>
<content type='text'>
Result on 10,000,000 call.
Old:
sqrt(12345689) = 3513
real	0m0.768s
user	0m0.760s
sys	0m0.004s

New:
sqrt(12345689) = 3513
real	0m0.222s
user	0m0.224s
sys	0m0.000s

Signed-off-by: engstk &lt;eng.stk@sapo.pt&gt;
</content>
</entry>
<entry>
<title>int_sqrt: correction square root algo with naming</title>
<updated>2016-09-10T10:06:54+00:00</updated>
<author>
<name>ramgear</name>
<email>ramgear@gmail.com</email>
</author>
<published>2013-09-03T07:25:04+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=3c3c4a97a2e92d835a2eb00b380ae3811c4be1a5'/>
<id>urn:sha1:3c3c4a97a2e92d835a2eb00b380ae3811c4be1a5</id>
<content type='text'>
Signed-off-by: engstk &lt;eng.stk@sapo.pt&gt;
</content>
</entry>
<entry>
<title>random: sprinkle e/f/prandom in places that deplete entropy often</title>
<updated>2016-09-10T10:06:52+00:00</updated>
<author>
<name>imoseyon</name>
<email>imoseyon@gmail.com</email>
</author>
<published>2014-12-14T18:36:51+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=e9c9fff8d3d4e053157db364ae4840882ab30eac'/>
<id>urn:sha1:e9c9fff8d3d4e053157db364ae4840882ab30eac</id>
<content type='text'>
</content>
</entry>
<entry>
<title>random32: use e/frandom for reseeding, and a merge fixup</title>
<updated>2016-09-10T10:06:49+00:00</updated>
<author>
<name>imoseyon</name>
<email>imoseyon@gmail.com</email>
</author>
<published>2014-12-14T00:39:49+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=28dcd63ec88da85c14041e1c737a89a8ac8b4dfd'/>
<id>urn:sha1:28dcd63ec88da85c14041e1c737a89a8ac8b4dfd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>random32: improvements to prandom_bytes</title>
<updated>2016-09-10T10:06:47+00:00</updated>
<author>
<name>Daniel Borkmann</name>
<email>dborkman@redhat.com</email>
</author>
<published>2014-08-23T15:03:28+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=f1c5c20a660ab23727deaee530bacf3e2dc9a921'/>
<id>urn:sha1:f1c5c20a660ab23727deaee530bacf3e2dc9a921</id>
<content type='text'>
This patch addresses a couple of minor items, mostly addesssing
prandom_bytes(): 1) prandom_bytes{,_state}() should use size_t
for length arguments, 2) We can use put_unaligned() when filling
the array instead of open coding it [ perhaps some archs will
further benefit from their own arch specific implementation when
GCC cannot make up for it ], 3) Fix a typo, 4) Better use unsigned
int as type for getting the arch seed, 5) Make use of
prandom_u32_max() for timer slack.

Regarding the change to put_unaligned(), callers of prandom_bytes()
which internally invoke prandom_bytes_state(), don't bother as
they expect the array to be filled randomly and don't have any
control of the internal state what-so-ever (that's also why we
have periodic reseeding there, etc), so they really don't care.

Now for the direct callers of prandom_bytes_state(), which
are solely located in test cases for MTD devices, that is,
drivers/mtd/tests/{oobtest.c,pagetest.c,subpagetest.c}:

These tests basically fill a test write-vector through
prandom_bytes_state() with an a-priori defined seed each time
and write that to a MTD device. Later on, they set up a read-vector
and read back that blocks from the device. So in the verification
phase, the write-vector is being re-setup [ so same seed and
prandom_bytes_state() called ], and then memcmp()'ed against the
read-vector to check if the data is the same.

Akinobu, Lothar and I also tested this patch and it runs through
the 3 relevant MTD test cases w/o any errors on the nandsim device
(simulator for MTD devs) for x86_64, ppc64, ARM (i.MX28, i.MX53
and i.MX6):

  # modprobe nandsim first_id_byte=0x20 second_id_byte=0xac \
                     third_id_byte=0x00 fourth_id_byte=0x15
  # modprobe mtd_oobtest dev=0
  # modprobe mtd_pagetest dev=0
  # modprobe mtd_subpagetest dev=0

We also don't have any users depending directly on a particular
result of the PRNG (except the PRNG self-test itself), and that's
just fine as it e.g. allowed us easily to do things like upgrading
from taus88 to taus113.

Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Tested-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Tested-by: Lothar Waßmann &lt;LW@KARO-electronics.de&gt;
Cc: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>random32: mix in entropy from core to late initcall</title>
<updated>2016-09-10T10:06:46+00:00</updated>
<author>
<name>Hannes Frederic Sowa</name>
<email>hannes@stressinduktion.org</email>
</author>
<published>2014-07-28T12:01:38+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=3c8dcc70661270fa85d01c47b8dfeec99eea56fa'/>
<id>urn:sha1:3c8dcc70661270fa85d01c47b8dfeec99eea56fa</id>
<content type='text'>
Currently, we have a 3-stage seeding process in prandom():

Phase 1 is from the early actual initialization of prandom()
subsystem which happens during core_initcall() and remains
most likely until the beginning of late_initcall() phase.
Here, the system might not have enough entropy available
for seeding with strong randomness from the random driver.
That means, we currently have a 32bit weak LCG() seeding
the PRNG status register 1 and mixing that successively
into the other 3 registers just to get it up and running.

Phase 2 starts with late_initcall() phase resp. when the
random driver has initialized its non-blocking pool with
enough entropy. At that time, we throw away *all* inner
state from its 4 registers and do a full reseed with strong
randomness.

Phase 3 starts right after that and does a periodic reseed
with random slack of status register 1 by a strong random
source again.

A problem in phase 1 is that during bootup data structures
can be initialized, e.g. on module load time, and thus access
a weakly seeded prandom and are never changed for the rest
of their live-time, thus carrying along the results from a
week seed. Lets make sure that current but also future users
access a possibly better early seeded prandom.

This patch therefore improves phase 1 by trying to make it
more 'unpredictable' through mixing in seed from a possible
hardware source. Now, the mix-in xors inner state with the
outcome of either of the two functions arch_get_random_{,seed}_int(),
preferably arch_get_random_seed_int() as it likely represents
a non-deterministic random bit generator in hw rather than
a cryptographically secure PRNG in hw. However, not all might
have the first one, so we use the PRNG as a fallback if
available. As we xor the seed into the current state, the
worst case would be that a hardware source could be unverifiable
compromised or backdoored. In that case nevertheless it
would be as good as our original early seeding function
prandom_seed_very_weak() since we mix through xor which is
entropy preserving.

Joint work with Daniel Borkmann.

Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>lib/random32.c: minor cleanups and kdoc fix</title>
<updated>2016-09-10T10:06:45+00:00</updated>
<author>
<name>Daniel Borkmann</name>
<email>dborkman@redhat.com</email>
</author>
<published>2014-04-03T21:49:08+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=319b110b2f6903fba6716dffe2b7be33aa9d0130'/>
<id>urn:sha1:319b110b2f6903fba6716dffe2b7be33aa9d0130</id>
<content type='text'>
These are just some very minor and misc cleanups in the PRNG.  In
prandom_u32() we store the result in an unsigned long which is
unnecessary as it should be u32 instead that we get from
prandom_u32_state().  prandom_bytes_state()'s comment is in kdoc format,
so change it into such as it's done everywhere else.  Also, use the
normal comment style for the header comment.  Last but not least for
readability, add some newlines.

Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Cc: Joe Perches &lt;joe@perches.com&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>random32: avoid attempt to late reseed if in the middle of seeding</title>
<updated>2016-09-10T10:06:19+00:00</updated>
<author>
<name>Sasha Levin</name>
<email>sasha.levin@oracle.com</email>
</author>
<published>2014-03-28T16:38:42+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=ba363b525a0c9c8e3ba8a35df38e8d645212eda4'/>
<id>urn:sha1:ba363b525a0c9c8e3ba8a35df38e8d645212eda4</id>
<content type='text'>
Commit 4af712e8df ("random32: add prandom_reseed_late() and call when
nonblocking pool becomes initialized") has added a late reseed stage
that happens as soon as the nonblocking pool is marked as initialized.

This fails in the case that the nonblocking pool gets initialized
during __prandom_reseed()'s call to get_random_bytes(). In that case
we'd double back into __prandom_reseed() in an attempt to do a late
reseed - deadlocking on 'lock' early on in the boot process.

Instead, just avoid even waiting to do a reseed if a reseed is already
occuring.

Fixes: 4af712e8df99 ("random32: add prandom_reseed_late() and call when nonblocking pool becomes initialized")
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Acked-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>random32: use msecs_to_jiffies for reseed timer</title>
<updated>2016-09-10T10:06:19+00:00</updated>
<author>
<name>Daniel Borkmann</name>
<email>dborkman@redhat.com</email>
</author>
<published>2013-11-12T22:45:42+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=db0796e74cc9208d7c34ba8d6392f045b92a8222'/>
<id>urn:sha1:db0796e74cc9208d7c34ba8d6392f045b92a8222</id>
<content type='text'>
Use msecs_to_jiffies, for these calculations as different HZ
considerations are taken into account for conversion of the timer
shot, and also it makes the code more readable.

Signed-off-by: Daniel Borkmann &lt;dborkman@redhat.com&gt;
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
