<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/scsi, branch v2.6.35.14</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/scsi?h=v2.6.35.14</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/scsi?h=v2.6.35.14'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-08-01T20:55:00Z</updated>
<entry>
<title>fix crash in scsi_dispatch_cmd()</title>
<updated>2011-08-01T20:55:00Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2011-07-07T20:45:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=300896911157016b30ea6f2de8705b675441e76a'/>
<id>urn:sha1:300896911157016b30ea6f2de8705b675441e76a</id>
<content type='text'>
[ upstream commit bfe159a51203c15d23cb3158fffdc25ec4b4dda1 ]

USB surprise removal of sr is triggering an oops in
scsi_dispatch_command().  What seems to be happening is that USB is
hanging on to a queue reference until the last close of the upper
device, so the crash is caused by surprise remove of a mounted CD
followed by attempted unmount.

The problem is that USB doesn't issue its final commands as part of
the SCSI teardown path, but on last close when the block queue is long
gone.  The long term fix is probably to make sr do the teardown in the
same way as sd (so remove all the lower bits on ejection, but keep the
upper disk alive until last close of user space).  However, the
current oops can be simply fixed by not allowing any commands to be
sent to a dead queue.

Cc: stable@kernel.org
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;

</content>
</entry>
<entry>
<title>Fix oops caused by queue refcounting failure</title>
<updated>2011-08-01T20:54:54Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2011-05-25T20:52:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d4df7c4751eefc0130f4f8bdf396a4ea16876dd4'/>
<id>urn:sha1:d4df7c4751eefc0130f4f8bdf396a4ea16876dd4</id>
<content type='text'>
commit e73e079bf128d68284efedeba1fbbc18d78610f9 upstream.

In certain circumstances, we can get an oops from a torn down device.
Most notably this is from CD roms trying to call scsi_ioctl.  The root
cause of the problem is the fact that after scsi_remove_device() has
been called, the queue is fully torn down.  This is actually wrong
since the queue can be used until the sdev release function is called.
Therefore, we add an extra reference to the queue which is released in
sdev-&gt;release, so the queue always exists.

Reported-by: Parag Warudkar &lt;parag.lkml@gmail.com&gt;
Signed-off-by: James Bottomley &lt;jbottomley@parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;

</content>
</entry>
<entry>
<title>Fix Ultrastor asm snippet</title>
<updated>2011-08-01T20:54:51Z</updated>
<author>
<name>Samuel Thibault</name>
<email>samuel.thibault@ens-lyon.org</email>
</author>
<published>2011-05-18T15:06:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7d5fdc4f5641f5e3046a4f4c614157b08e6ce53c'/>
<id>urn:sha1:7d5fdc4f5641f5e3046a4f4c614157b08e6ce53c</id>
<content type='text'>
commit fad4dab5e44e10acf6b0235e469cb8e773b58e31 upstream.

Commit 1292500b replaced

"=m" (*field) : "1" (*field)

with

"=m" (*field) :

with comment "The following patch fixes it by using the '+' operator on
the (*field) operand, marking it as read-write to gcc."
'+' was actually forgotten.  This really puts it.

Signed-off-by: Samuel Thibault &lt;samuel.thibault@ens-lyon.org&gt;
Signed-off-by: James Bottomley &lt;jbottomley@parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;

</content>
</entry>
<entry>
<title>megaraid_sas: Sanity check user supplied length before passing it to dma_alloc_coherent()</title>
<updated>2011-08-01T20:54:49Z</updated>
<author>
<name>Bjørn Mork</name>
<email>bjorn@mork.no</email>
</author>
<published>2011-01-19T09:01:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6451865d838216814412405879b6906271b50199'/>
<id>urn:sha1:6451865d838216814412405879b6906271b50199</id>
<content type='text'>
commit 98cb7e4413d189cd2b54daf993a4667d9788c0bb upstream.

The ioc-&gt;sgl[i].iov_len value is supplied by the ioctl caller, and can be
zero in some cases.  Assume that's valid and continue without error.

Fixes (multiple individual reports of the same problem for quite a while):

http://marc.info/?l=linux-ide&amp;m=128941801715301
http://bugs.debian.org/604627
http://www.mail-archive.com/linux-poweredge@dell.com/msg02575.html

megasas: Failed to alloc kernel SGL buffer for IOCTL

and

[   69.162538] ------------[ cut here ]------------
[   69.162806] kernel BUG at /build/buildd/linux-2.6.32/lib/swiotlb.c:368!
[   69.163134] invalid opcode: 0000 [#1] SMP
[   69.163570] last sysfs file: /sys/devices/system/cpu/cpu3/cache/index2/shared_cpu_map
[   69.163975] CPU 0
[   69.164227] Modules linked in: fbcon tileblit font bitblit softcursor vga16fb vgastate ioatdma radeon ttm drm_kms_helper shpchp drm i2c_algo_bit lp parport floppy pata_jmicron megaraid_sas igb dca
[   69.167419] Pid: 1206, comm: smartctl Tainted: G        W  2.6.32-25-server #45-Ubuntu X8DTN
[   69.167843] RIP: 0010:[&lt;ffffffff812c4dc5&gt;]  [&lt;ffffffff812c4dc5&gt;] map_single+0x255/0x260
[   69.168370] RSP: 0018:ffff88081c0ebc58  EFLAGS: 00010246
[   69.168655] RAX: 000000000003bffc RBX: 00000000ffffffff RCX: 0000000000000002
[   69.169000] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88001dffe000
[   69.169346] RBP: ffff88081c0ebcb8 R08: 0000000000000000 R09: ffff880000030840
[   69.169691] R10: 0000000000100000 R11: 0000000000000000 R12: 0000000000000000
[   69.170036] R13: 00000000ffffffff R14: 0000000000000001 R15: 0000000000200000
[   69.170382] FS:  00007fb8de189720(0000) GS:ffff88001de00000(0000) knlGS:0000000000000000
[   69.170794] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   69.171094] CR2: 00007fb8dd59237c CR3: 000000081a790000 CR4: 00000000000006f0
[   69.171439] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   69.171784] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[   69.172130] Process smartctl (pid: 1206, threadinfo ffff88081c0ea000, task ffff88081a760000)
[   69.194513] Stack:
[   69.205788]  0000000000000034 00000002817e3390 0000000000000000 ffff88081c0ebe00
[   69.217739] &lt;0&gt; 0000000000000000 000000000003bffc 0000000000000000 0000000000000000
[   69.241250] &lt;0&gt; 0000000000000000 00000000ffffffff ffff88081c5b4080 ffff88081c0ebe00
[   69.277310] Call Trace:
[   69.289278]  [&lt;ffffffff812c52ac&gt;] swiotlb_alloc_coherent+0xec/0x130
[   69.301118]  [&lt;ffffffff81038b31&gt;] x86_swiotlb_alloc_coherent+0x61/0x70
[   69.313045]  [&lt;ffffffffa002d0ce&gt;] megasas_mgmt_fw_ioctl+0x1ae/0x690 [megaraid_sas]
[   69.336399]  [&lt;ffffffffa002d748&gt;] megasas_mgmt_ioctl_fw+0x198/0x240 [megaraid_sas]
[   69.359346]  [&lt;ffffffffa002f695&gt;] megasas_mgmt_ioctl+0x35/0x50 [megaraid_sas]
[   69.370902]  [&lt;ffffffff81153b12&gt;] vfs_ioctl+0x22/0xa0
[   69.382322]  [&lt;ffffffff8115da2a&gt;] ? alloc_fd+0x10a/0x150
[   69.393622]  [&lt;ffffffff81153cb1&gt;] do_vfs_ioctl+0x81/0x410
[   69.404696]  [&lt;ffffffff8155cc13&gt;] ? do_page_fault+0x153/0x3b0
[   69.415761]  [&lt;ffffffff811540c1&gt;] sys_ioctl+0x81/0xa0
[   69.426640]  [&lt;ffffffff810121b2&gt;] system_call_fastpath+0x16/0x1b
[   69.437491] Code: fe ff ff 48 8b 3d 74 38 76 00 41 bf 00 00 20 00 e8 51 f5 d7 ff 83 e0 ff 48 05 ff 07 00 00 48 c1 e8 0b 48 89 45 c8 e9 13 fe ff ff &lt;0f&gt; 0b eb fe 0f 1f 80 00 00 00 00 55 48 89 e5 48 83 ec 20 4c 89
[   69.478216] RIP  [&lt;ffffffff812c4dc5&gt;] map_single+0x255/0x260
[   69.489668]  RSP &lt;ffff88081c0ebc58&gt;
[   69.500975] ---[ end trace 6a2181b634e2abc7 ]---

Reported-by: Bokhan Artem &lt;aptem@ngs.ru&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Reported by: Marc-Christian Petersen &lt;m.c.p@gmx.de&gt;
Signed-off-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Cc: Michael Benz &lt;Michael.Benz@lsi.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>fix oops in scsi_run_queue()</title>
<updated>2011-08-01T20:54:47Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@suse.de</email>
</author>
<published>2011-05-01T14:42:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9f6340c7bfc445ec0c8c620d79a4cea4a8fe654d'/>
<id>urn:sha1:9f6340c7bfc445ec0c8c620d79a4cea4a8fe654d</id>
<content type='text'>
commit c055f5b2614b4f758ae6cc86733f31fa4c2c5844 upstream.

The recent commit closing the race window in device teardown:

commit 86cbfb5607d4b81b1a993ff689bbd2addd5d3a9b
Author: James Bottomley &lt;James.Bottomley@suse.de&gt;
Date:   Fri Apr 22 10:39:59 2011 -0500

    [SCSI] put stricter guards on queue dead checks

is causing a potential NULL deref in scsi_run_queue() because the
q-&gt;queuedata may already be NULL by the time this function is called.
Since we shouldn't be running a queue that is being torn down, simply
add a NULL check in scsi_run_queue() to forestall this.

Tested-by: Jim Schutt &lt;jaschut@sandia.gov&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;

</content>
</entry>
<entry>
<title>put stricter guards on queue dead checks</title>
<updated>2011-08-01T20:54:43Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@suse.de</email>
</author>
<published>2011-04-22T15:39:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4f1ca069a7660ba29ca9bcc126539982a804b38f'/>
<id>urn:sha1:4f1ca069a7660ba29ca9bcc126539982a804b38f</id>
<content type='text'>
commit 86cbfb5607d4b81b1a993ff689bbd2addd5d3a9b upstream.

SCSI uses request_queue-&gt;queuedata == NULL as a signal that the queue
is dying.  We set this state in the sdev release function.  However,
this allows a small window where we release the last reference but
haven't quite got to this stage yet and so something will try to take
a reference in scsi_request_fn and oops.  It's very rare, but we had a
report here, so we're pushing this as a bug fix

The actual fix is to set request_queue-&gt;queuedata to NULL in
scsi_remove_device() before we drop the reference.  This causes
correct automatic rejects from scsi_request_fn as people who hold
additional references try to submit work and prevents anything from
getting a new reference to the sdev that way.

Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;

</content>
</entry>
<entry>
<title>pmcraid: reject negative request size</title>
<updated>2011-08-01T20:54:43Z</updated>
<author>
<name>Dan Rosenberg</name>
<email>drosenberg@vsecurity.com</email>
</author>
<published>2011-04-05T17:27:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7d9cdcaaa0cc1e45614863d097b727519c723d81'/>
<id>urn:sha1:7d9cdcaaa0cc1e45614863d097b727519c723d81</id>
<content type='text'>
commit 5f6279da3760ce48f478f2856aacebe0c59a39f3 upstream.

There's a code path in pmcraid that can be reached via device ioctl that
causes all sorts of ugliness, including heap corruption or triggering
the OOM killer due to consecutive allocation of large numbers of pages.
Not especially relevant from a security perspective, since users must
have CAP_SYS_ADMIN to open the character device.

First, the user can call pmcraid_chr_ioctl() with a type
PMCRAID_PASSTHROUGH_IOCTL.  A pmcraid_passthrough_ioctl_buffer
is copied in, and the request_size variable is set to
buffer-&gt;ioarcb.data_transfer_length, which is an arbitrary 32-bit signed
value provided by the user.

If a negative value is provided here, bad things can happen.  For
example, pmcraid_build_passthrough_ioadls() is called with this
request_size, which immediately calls pmcraid_alloc_sglist() with a
negative size.  The resulting math on allocating a scatter list can
result in an overflow in the kzalloc() call (if num_elem is 0, the
sglist will be smaller than expected), or if num_elem is unexpectedly
large the subsequent loop will call alloc_pages() repeatedly, a high
number of pages will be allocated and the OOM killer might be invoked.

Prevent this value from being negative in pmcraid_ioctl_passthrough().

Signed-off-by: Dan Rosenberg &lt;drosenberg@vsecurity.com&gt;
Cc: Anil Ravindranath &lt;anil_ravindranath@pmc-sierra.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;

</content>
</entry>
<entry>
<title>mpt2sas: prevent heap overflows and unchecked reads</title>
<updated>2011-08-01T20:54:42Z</updated>
<author>
<name>Dan Rosenberg</name>
<email>drosenberg@vsecurity.com</email>
</author>
<published>2011-04-05T16:45:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3f14204734d5cb567edbc6e90885a5d6cae21ad0'/>
<id>urn:sha1:3f14204734d5cb567edbc6e90885a5d6cae21ad0</id>
<content type='text'>
[ upstream commit a1f74ae82d133ebb2aabb19d181944b4e83e9960 ]

At two points in handling device ioctls via /dev/mpt2ctl, user-supplied
length values are used to copy data from userspace into heap buffers
without bounds checking, allowing controllable heap corruption and
subsequently privilege escalation.

Additionally, user-supplied values are used to determine the size of a
copy_to_user() as well as the offset into the buffer to be read, with no
bounds checking, allowing users to read arbitrary kernel memory.

Signed-off-by: Dan Rosenberg &lt;drosenberg@vsecurity.com&gt;
Cc: stable@kernel.org
Acked-by: Eric Moore &lt;eric.moore@lsi.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;

</content>
</entry>
<entry>
<title>qla2xxx: Make the FC port capability mutual exclusive.</title>
<updated>2011-04-28T15:20:49Z</updated>
<author>
<name>Andrew Vasquez</name>
<email>andrew.vasquez@qlogic.com</email>
</author>
<published>2010-05-28T22:08:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e0026eb67a332b6ab0f2e61838aeba1b15604696'/>
<id>urn:sha1:e0026eb67a332b6ab0f2e61838aeba1b15604696</id>
<content type='text'>
[ upstream commit b0cd579cde8ee0c7ed52239531ba09bcbc5b54c2 ]

In case of both target and initiator capabilities reported by fc port,
the fc port port capability is made mutualy exclusive with priority given
for target capabilities.

Signed-off-by: Giridhar Malavali &lt;giridhar.malavali@qlogic.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
Acked-by: Madhuranath Iyengar &lt;Madhu.Iyengar@qlogic.com&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;

</content>
</entry>
<entry>
<title>ses: show devices for enclosures with no page 7</title>
<updated>2011-03-31T18:58:50Z</updated>
<author>
<name>John Hughes</name>
<email>john@Calva.COM</email>
</author>
<published>2009-11-04T18:01:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4fec50c333c8b4ed55ba05320b781e63ed829e8d'/>
<id>urn:sha1:4fec50c333c8b4ed55ba05320b781e63ed829e8d</id>
<content type='text'>
commit 877a55979c189c590e819a61cbbe2b7947875f17 upstream.

enclosure page 7 gives us the "pretty" names of the enclosure slots.
Without a page 7, we can still use the enclosure code as long as we
make up numeric names for the slots. Unfortunately, the current code
fails to add any devices because the check for page 10 is in the wrong
place if we have no page 7.  Fix it so that devices show up even if
the enclosure has no page 7.

Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;

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