<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/char, branch v3.4.40</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.40</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.40'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-03-20T20:04:57Z</updated>
<entry>
<title>virtio: rng: disallow multiple device registrations, fixes crashes</title>
<updated>2013-03-20T20:04:57Z</updated>
<author>
<name>Amit Shah</name>
<email>amit.shah@redhat.com</email>
</author>
<published>2013-03-08T00:30:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c8fba5853260c3114ed0a24f721cd4c415ea011c'/>
<id>urn:sha1:c8fba5853260c3114ed0a24f721cd4c415ea011c</id>
<content type='text'>
commit e84e7a56a3aa2963db506299e29a5f3f09377f9b upstream.

The code currently only supports one virtio-rng device at a time.
Invoking guests with multiple devices causes the guest to blow up.

Check if we've already registered and initialised the driver.  Also
cleanup in case of registration errors or hot-unplug so that a new
device can be used.

Reported-by: Peter Krempa &lt;pkrempa@redhat.com&gt;
Reported-by: &lt;yunzheng@redhat.com&gt;
Signed-off-by: Amit Shah &lt;amit.shah@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>hw_random: make buffer usable in scatterlist.</title>
<updated>2013-03-14T18:29:42Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2013-03-04T23:37:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=681e3b15fef858a9512d5fb2baceb85b0913385f'/>
<id>urn:sha1:681e3b15fef858a9512d5fb2baceb85b0913385f</id>
<content type='text'>
commit f7f154f1246ccc5a0a7e9ce50932627d60a0c878 upstream.

virtio_rng feeds the randomness buffer handed by the core directly
into the scatterlist, since commit bb347d98079a547e80bd4722dee1de61e4dca0e8.

However, if CONFIG_HW_RANDOM=m, the static buffer isn't a linear address
(at least on most archs).  We could fix this in virtio_rng, but it's actually
far easier to just do it in the core as virtio_rng would have to allocate
a buffer every time (it doesn't know how much the core will want to read).

Reported-by: Aurelien Jarno &lt;aurelien@aurel32.net&gt;
Tested-by: Aurelien Jarno &lt;aurelien@aurel32.net&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>virtio_console: Don't access uninitialized data.</title>
<updated>2013-02-14T18:48:51Z</updated>
<author>
<name>Sjur Brændeland</name>
<email>sjur.brandeland@stericsson.com</email>
</author>
<published>2013-01-21T23:20:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0b2d4e113bf714732b041aa879945c4c5ae4b139'/>
<id>urn:sha1:0b2d4e113bf714732b041aa879945c4c5ae4b139</id>
<content type='text'>
commit aded024a12b32fc1ed9a80639681daae2d07ec25 upstream.

Don't access uninitialized work-queue when removing device.
The work queue is initialized only if the device multi-queue.
So don't call cancel_work unless this is a multi-queue device.

This fixes the following panic:

Kernel panic - not syncing: BUG!
Call Trace:
62031b28:  [&lt;6026085d&gt;] panic+0x16b/0x2d3
62031b30:  [&lt;6004ef5e&gt;] flush_work+0x0/0x1d7
62031b60:  [&lt;602606f2&gt;] panic+0x0/0x2d3
62031b68:  [&lt;600333b0&gt;] memcpy+0x0/0x140
62031b80:  [&lt;6002d58a&gt;] unblock_signals+0x0/0x84
62031ba0:  [&lt;602609c5&gt;] printk+0x0/0xa0
62031bd8:  [&lt;60264e51&gt;] __mutex_unlock_slowpath+0x13d/0x148
62031c10:  [&lt;6004ef5e&gt;] flush_work+0x0/0x1d7
62031c18:  [&lt;60050234&gt;] try_to_grab_pending+0x0/0x17e
62031c38:  [&lt;6004e984&gt;] get_work_gcwq+0x71/0x8f
62031c48:  [&lt;60050539&gt;] __cancel_work_timer+0x5b/0x115
62031c78:  [&lt;628acc85&gt;] unplug_port+0x0/0x191 [virtio_console]
62031c98:  [&lt;6005061c&gt;] cancel_work_sync+0x12/0x14
62031ca8:  [&lt;628ace96&gt;] virtcons_remove+0x80/0x15c [virtio_console]
62031ce8:  [&lt;628191de&gt;] virtio_dev_remove+0x1e/0x7e [virtio]
62031d08:  [&lt;601cf242&gt;] __device_release_driver+0x75/0xe4
62031d28:  [&lt;601cf2dd&gt;] device_release_driver+0x2c/0x40
62031d48:  [&lt;601ce0dd&gt;] driver_unbind+0x7d/0xc6
62031d88:  [&lt;601cd5d9&gt;] drv_attr_store+0x27/0x29
62031d98:  [&lt;60115f61&gt;] sysfs_write_file+0x100/0x14d
62031df8:  [&lt;600b737d&gt;] vfs_write+0xcb/0x184
62031e08:  [&lt;600b58b8&gt;] filp_close+0x88/0x94
62031e38:  [&lt;600b7686&gt;] sys_write+0x59/0x88
62031e88:  [&lt;6001ced1&gt;] handle_syscall+0x5d/0x80
62031ea8:  [&lt;60030a74&gt;] userspace+0x405/0x531
62031f08:  [&lt;600d32cc&gt;] sys_dup+0x0/0x5e
62031f28:  [&lt;601b11d6&gt;] strcpy+0x0/0x18
62031f38:  [&lt;600be46c&gt;] do_execve+0x10/0x12
62031f48:  [&lt;600184c7&gt;] run_init_process+0x43/0x45
62031fd8:  [&lt;60019a91&gt;] new_thread_handler+0xba/0xbc

Signed-off-by: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tpm: Propagate error from tpm_transmit to fix a timeout hang</title>
<updated>2012-10-21T16:28:01Z</updated>
<author>
<name>Peter Huewe</name>
<email>peter.huewe@infineon.com</email>
</author>
<published>2012-09-27T14:09:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8abffa895c8a6c6079e93db68f5eb5e4a2332a82'/>
<id>urn:sha1:8abffa895c8a6c6079e93db68f5eb5e4a2332a82</id>
<content type='text'>
commit abce9ac292e13da367bbd22c1f7669f988d931ac upstream.

tpm_write calls tpm_transmit without checking the return value and
assigns the return value unconditionally to chip-&gt;pending_data, even if
it's an error value.
This causes three bugs.

So if we write to /dev/tpm0 with a tpm_param_size bigger than
TPM_BUFSIZE=0x1000 (e.g. 0x100a)
and a bufsize also bigger than TPM_BUFSIZE (e.g. 0x100a)
tpm_transmit returns -E2BIG which is assigned to chip-&gt;pending_data as
-7, but tpm_write returns that TPM_BUFSIZE bytes have been successfully
been written to the TPM, altough this is not true (bug #1).

As we did write more than than TPM_BUFSIZE bytes but tpm_write reports
that only TPM_BUFSIZE bytes have been written the vfs tries to write
the remaining bytes (in this case 10 bytes) to the tpm device driver via
tpm_write which then blocks at

 /* cannot perform a write until the read has cleared
 either via tpm_read or a user_read_timer timeout */
 while (atomic_read(&amp;chip-&gt;data_pending) != 0)
	 msleep(TPM_TIMEOUT);

for 60 seconds, since data_pending is -7 and nobody is able to
read it (since tpm_read luckily checks if data_pending is greater than
0) (#bug 2).

After that the remaining bytes are written to the TPM which are
interpreted by the tpm as a normal command. (bug #3)
So if the last bytes of the command stream happen to be a e.g.
tpm_force_clear this gets accidentally sent to the TPM.

This patch fixes all three bugs, by propagating the error code of
tpm_write and returning -E2BIG if the input buffer is too big,
since the response from the tpm for a truncated value is bogus anyway.
Moreover it returns -EBUSY to userspace if there is a response ready to be
read.

Signed-off-by: Peter Huewe &lt;peter.huewe@infineon.com&gt;
Signed-off-by: Kent Yoder &lt;key@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>TTY: ttyprintk, don't touch behind tty-&gt;write_buf</title>
<updated>2012-10-07T15:32:24Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2012-08-07T19:47:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=804f6a4a4745ce54f3afa76b3d2270b385f565f8'/>
<id>urn:sha1:804f6a4a4745ce54f3afa76b3d2270b385f565f8</id>
<content type='text'>
commit ee8b593affdf893012e57f4c54a21984d1b0d92e upstream.

If a user provides a buffer larger than a tty-&gt;write_buf chunk and
passes '\r' at the end of the buffer, we touch an out-of-bound memory.

Add a check there to prevent this.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Samo Pogacnik &lt;samo_pogacnik@t-2.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>random: mix in architectural randomness in extract_buf()</title>
<updated>2012-08-15T15:10:30Z</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@linux.intel.com</email>
</author>
<published>2012-07-28T02:26:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7d696f0636c31f81d5cb613d45114d43896cfdb0'/>
<id>urn:sha1:7d696f0636c31f81d5cb613d45114d43896cfdb0</id>
<content type='text'>
commit d2e7c96af1e54b507ae2a6a7dd2baf588417a7e5 upstream.

Mix in any architectural randomness in extract_buf() instead of
xfer_secondary_buf().  This allows us to mix in more architectural
randomness, and it also makes xfer_secondary_buf() faster, moving a
tiny bit of additional CPU overhead to process which is extracting the
randomness.

[ Commit description modified by tytso to remove an extended
  advertisement for the RDRAND instruction. ]

Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
Acked-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: DJ Johnston &lt;dj.johnston@intel.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>random: Add comment to random_initialize()</title>
<updated>2012-08-15T15:10:29Z</updated>
<author>
<name>Tony Luck</name>
<email>tony.luck@intel.com</email>
</author>
<published>2012-07-23T16:47:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=73e62ae900d632d1bee9ab96c22508f8947da91a'/>
<id>urn:sha1:73e62ae900d632d1bee9ab96c22508f8947da91a</id>
<content type='text'>
commit cbc96b7594b5691d61eba2db8b2ea723645be9ca upstream.

Many platforms have per-machine instance data (serial numbers,
asset tags, etc.) squirreled away in areas that are accessed
during early system bringup. Mixing this data into the random
pools has a very high value in providing better random data,
so we should allow (and even encourage) architecture code to
call add_device_randomness() from the setup_arch() paths.

However, this limits our options for internal structure of
the random driver since random_initialize() is not called
until long after setup_arch().

Add a big fat comment to rand_initialize() spelling out
this requirement.

Suggested-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>random: remove rand_initialize_irq()</title>
<updated>2012-08-15T15:10:29Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-07-15T00:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=26665db4f7fa71c56eeb9205e79927cfc21e70c4'/>
<id>urn:sha1:26665db4f7fa71c56eeb9205e79927cfc21e70c4</id>
<content type='text'>
commit c5857ccf293968348e5eb4ebedc68074de3dcda6 upstream.

With the new interrupt sampling system, we are no longer using the
timer_rand_state structure in the irq descriptor, so we can stop
initializing it now.

[ Merged in fixes from Sedat to find some last missing references to
  rand_initialize_irq() ]

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Sedat Dilek &lt;sedat.dilek@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>random: add tracepoints for easier debugging and verification</title>
<updated>2012-08-15T15:10:28Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-07-04T20:19:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=38e16fc638792ddc12da853c4836602a8708e166'/>
<id>urn:sha1:38e16fc638792ddc12da853c4836602a8708e166</id>
<content type='text'>
commit 00ce1db1a634746040ace24c09a4e3a7949a3145 upstream.

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>random: add new get_random_bytes_arch() function</title>
<updated>2012-08-15T15:10:28Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-07-05T14:35:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=29aef9dee78ac45c5bd7f91434b05144ec220abd'/>
<id>urn:sha1:29aef9dee78ac45c5bd7f91434b05144ec220abd</id>
<content type='text'>
commit c2557a303ab6712bb6e09447df828c557c710ac9 upstream.

Create a new function, get_random_bytes_arch() which will use the
architecture-specific hardware random number generator if it is
present.  Change get_random_bytes() to not use the HW RNG, even if it
is avaiable.

The reason for this is that the hw random number generator is fast (if
it is present), but it requires that we trust the hardware
manufacturer to have not put in a back door.  (For example, an
increasing counter encrypted by an AES key known to the NSA.)

It's unlikely that Intel (for example) was paid off by the US
Government to do this, but it's impossible for them to prove otherwise
  --- especially since Bull Mountain is documented to use AES as a
whitener.  Hence, the output of an evil, trojan-horse version of
RDRAND is statistically indistinguishable from an RDRAND implemented
to the specifications claimed by Intel.  Short of using a tunnelling
electronic microscope to reverse engineer an Ivy Bridge chip and
disassembling and analyzing the CPU microcode, there's no way for us
to tell for sure.

Since users of get_random_bytes() in the Linux kernel need to be able
to support hardware systems where the HW RNG is not present, most
time-sensitive users of this interface have already created their own
cryptographic RNG interface which uses get_random_bytes() as a seed.
So it's much better to use the HW RNG to improve the existing random
number generator, by mixing in any entropy returned by the HW RNG into
/dev/random's entropy pool, but to always _use_ /dev/random's entropy
pool.

This way we get almost of the benefits of the HW RNG without any
potential liabilities.  The only benefits we forgo is the
speed/performance enhancements --- and generic kernel code can't
depend on depend on get_random_bytes() having the speed of a HW RNG
anyway.

For those places that really want access to the arch-specific HW RNG,
if it is available, we provide get_random_bytes_arch().

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;


</content>
</entry>
</feed>
