<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/scsi, branch linux-2.6.20.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>[PATCH] 3w-9xxx: Fix dma mask setting</title>
<updated>2007-10-17T19:30:31+00:00</updated>
<author>
<name>Adam Radford</name>
<email>linuxraid@amcc.com</email>
</author>
<published>2007-08-29T16:19:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=38501230b09293bffac60325841203877a2a7f5f'/>
<id>38501230b09293bffac60325841203877a2a7f5f</id>
<content type='text'>
[SCSI] 3w-9xxx: Fix dma mask setting

Extracted from commit 0e78d158b67fba3977f577f293c323359d80dd0e

The attached patch updates the 3ware 9000 driver:

- Fix dma mask setting to fallback to 32-bit if 64-bit fails.

Signed-off-by: Adam Radford &lt;linuxraid@amcc.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
Signed-off-by: Chuck Ebbert &lt;cebbert@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[SCSI] 3w-9xxx: Fix dma mask setting

Extracted from commit 0e78d158b67fba3977f577f293c323359d80dd0e

The attached patch updates the 3ware 9000 driver:

- Fix dma mask setting to fallback to 32-bit if 64-bit fails.

Signed-off-by: Adam Radford &lt;linuxraid@amcc.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
Signed-off-by: Chuck Ebbert &lt;cebbert@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] aacraid: fix security hole</title>
<updated>2007-08-25T15:24:03+00:00</updated>
<author>
<name>Alan Cox</name>
<email>alan@lxorguk.ukuu.org.uk</email>
</author>
<published>2007-07-23T13:51:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f87acefea8a786d3fe490f0f0b2c635973f619ec'/>
<id>f87acefea8a786d3fe490f0f0b2c635973f619ec</id>
<content type='text'>
On the SCSI layer ioctl path there is no implicit permissions check for
ioctls (and indeed other drivers implement unprivileged ioctls). aacraid
however allows all sorts of very admin only things to be done so should
check.

Signed-off-by: Alan Cox &lt;alan@redhat.com&gt;
Acked-by: Mark Salyzyn &lt;mark_salyzyn@adaptec.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On the SCSI layer ioctl path there is no implicit permissions check for
ioctls (and indeed other drivers implement unprivileged ioctls). aacraid
however allows all sorts of very admin only things to be done so should
check.

Signed-off-by: Alan Cox &lt;alan@redhat.com&gt;
Acked-by: Mark Salyzyn &lt;mark_salyzyn@adaptec.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>3w-xxxx: fix oops caused by incorrect REQUEST_SENSE handling</title>
<updated>2007-05-02T00:06:00+00:00</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@steeleye.com</email>
</author>
<published>2007-04-06T16:14:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=86f757f0125d688bdd3d211df3859e013d8544b2'/>
<id>86f757f0125d688bdd3d211df3859e013d8544b2</id>
<content type='text'>
3w-xxxx emulates a REQUEST_SENSE response by simply returning nothing.
Unfortunately, it's assuming that the REQUEST_SENSE command is
implemented with use_sg == 0, which is no longer the case.  The oops
occurs because it's clearing the scatterlist in request_buffer instead
of the memory region.

This is fixed by using tw_transfer_internal() to transfer correctly to
the scatterlist.

Acked-by: adam radford &lt;aradford@gmail.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
3w-xxxx emulates a REQUEST_SENSE response by simply returning nothing.
Unfortunately, it's assuming that the REQUEST_SENSE command is
implemented with use_sg == 0, which is no longer the case.  The oops
occurs because it's clearing the scatterlist in request_buffer instead
of the memory region.

This is fixed by using tw_transfer_internal() to transfer correctly to
the scatterlist.

Acked-by: adam radford &lt;aradford@gmail.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Fix qlogicpti DMA unmapping</title>
<updated>2007-05-02T00:05:57+00:00</updated>
<author>
<name>David Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2007-04-17T21:35:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d3bf6f8a58459b7aefc10591807846b0b5697244'/>
<id>d3bf6f8a58459b7aefc10591807846b0b5697244</id>
<content type='text'>
[SCSI] QLOGICPTI: Do not unmap DMA unless we actually mapped something.

We only map DMA when cmd-&gt;request_bufflen is non-zero for non-sg
buffers, we thus should make the same check when unmapping.

Based upon a report from Pasi Pirhonen.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[SCSI] QLOGICPTI: Do not unmap DMA unless we actually mapped something.

We only map DMA when cmd-&gt;request_bufflen is non-zero for non-sg
buffers, we thus should make the same check when unmapping.

Based upon a report from Pasi Pirhonen.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Fix scsi sense handling</title>
<updated>2007-04-13T20:47:04+00:00</updated>
<author>
<name>David Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2007-04-10T20:35:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0b3a1a3864038660bb03c39d4b0c8708390f238d'/>
<id>0b3a1a3864038660bb03c39d4b0c8708390f238d</id>
<content type='text'>
[SCSI]: Fix scsi_send_eh_cmnd scatterlist handling

This fixes a regression caused by commit:

2dc611de5a3fd955cd0298c50691d4c05046db97

The sense buffer code in scsi_send_eh_cmnd was changed to use
alloc_page() and a scatter list, but the sense data copy was not
updated to match so what we actually get in the sense buffer is total
grabage starting with the kernel address of the struct page we got.
Basically the stack frame of scsi_send_eh_cmd() is what ends up
in the sense buffer.

Depending upon how pointers look on a given platform, you can
end up getting sr_ioctl.c errors when you mount a cdrom.  If
the CDROM gives a check condition for GPCMD_GET_CONFIGURATION issued
by drivers/cdrom/cdrom.c:cdrom_mmc_profile(), sr_ioctl will
spit out this error message in sr_do_ioctl() with the way pointers
are on sparc64:

		default:
			printk(KERN_ERR "%s: CDROM (ioctl) error, command: ", cd-&gt;cdi.name);
			__scsi_print_command(cgc-&gt;cmd);
			scsi_print_sense_hdr("sr", &amp;sshdr);
			err = -EIO;

This is the error Tom Callaway reported in:

http://marc.info/?l=linux-sparc&amp;m=117407453208101&amp;w=2

Anyways, fix this by using page_address(sgl.page) which is OK
because we know this is low-mem due to GFP_ATOMIC.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[SCSI]: Fix scsi_send_eh_cmnd scatterlist handling

This fixes a regression caused by commit:

2dc611de5a3fd955cd0298c50691d4c05046db97

The sense buffer code in scsi_send_eh_cmnd was changed to use
alloc_page() and a scatter list, but the sense data copy was not
updated to match so what we actually get in the sense buffer is total
grabage starting with the kernel address of the struct page we got.
Basically the stack frame of scsi_send_eh_cmd() is what ends up
in the sense buffer.

Depending upon how pointers look on a given platform, you can
end up getting sr_ioctl.c errors when you mount a cdrom.  If
the CDROM gives a check condition for GPCMD_GET_CONFIGURATION issued
by drivers/cdrom/cdrom.c:cdrom_mmc_profile(), sr_ioctl will
spit out this error message in sr_do_ioctl() with the way pointers
are on sparc64:

		default:
			printk(KERN_ERR "%s: CDROM (ioctl) error, command: ", cd-&gt;cdi.name);
			__scsi_print_command(cgc-&gt;cmd);
			scsi_print_sense_hdr("sr", &amp;sshdr);
			err = -EIO;

This is the error Tom Callaway reported in:

http://marc.info/?l=linux-sparc&amp;m=117407453208101&amp;w=2

Anyways, fix this by using page_address(sgl.page) which is OK
because we know this is low-mem due to GFP_ATOMIC.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>st: fix Tape dies if wrong block size used, bug 7919</title>
<updated>2007-03-23T19:49:27+00:00</updated>
<author>
<name>Kai Makisara</name>
<email>Kai.Makisara@kolumbus.fi</email>
</author>
<published>2007-03-19T23:58:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ad23c76c32efdf8f633cb41c3df0ef6780f5b275'/>
<id>ad23c76c32efdf8f633cb41c3df0ef6780f5b275</id>
<content type='text'>
[SCSI] st: fix Tape dies if wrong block size used, bug 7919

On Thu, 1 Feb 2007, Andrew Morton wrote:
&gt; On Thu, 1 Feb 2007 15:34:29 -0800
&gt; bugme-daemon@bugzilla.kernel.org wrote:
&gt;
&gt; &gt; http://bugzilla.kernel.org/show_bug.cgi?id=7919
&gt; &gt;
&gt; &gt;            Summary: Tape dies if wrong block size used
&gt; &gt;     Kernel Version: 2.6.20-rc5
&gt; &gt;             Status: NEW
&gt; &gt;           Severity: normal
&gt; &gt;              Owner: scsi_drivers-other@kernel-bugs.osdl.org
&gt; &gt;          Submitter: dmartin@sccd.ctc.edu
&gt; &gt;
&gt; &gt;
&gt; &gt; Most recent kernel where this bug did *NOT* occur: 2.6.17.14
&gt; &gt;
&gt; &gt; Other Kernels Tested and Results:
&gt; &gt;
&gt; &gt;     OK 2.6.15.7
&gt; &gt;     OK 2.6.16.37
&gt; &gt;     OK 2.6.17.14
&gt; &gt;     BAD 2.6.18.6
&gt; &gt;     BAD 2.6.18-1.2869.fc6
&gt; &gt;     BAD 2.6.19.2 +
&gt; &gt;     BAD 2.6.20-rc5
&gt; &gt;
&gt; &gt; NOTE: 2.6.18-1.2869.fc6 is a Fedora modified kernel, all others are from kernel.org
&gt; &gt;
...
&gt; &gt; Steps to reproduce:
&gt; &gt; Get a Adaptec AHA-2940U/UW/D / AIC-7881U card and a tape drive,
&gt; &gt; install a recent kernel
&gt; &gt; set the tape block size - mt setblk 4096
&gt; &gt; read from or write to tape using wrong block size - tar -b 7 -cvf /dev/tape foo
&gt; &gt;
Write does not trigger this bug because the driver refuses in fixed block
mode writes that are not a multiple of the block size. Read does trigger
it in my system.

The bug is not associated with any specific HBA. st tries to do direct i/o
in fixed block mode with reads that are not a multiple of tape block size.

The patch in this message fixes the st problem by switching to using the
driver buffer up to the next close of the device file in fixed block mode
if the user asks for a read like this.

I don't know why the bug has surfaced only after 2.6.17 although the st
problem is old. There may be another bug in the block subsystem and this
patch works around it. However, the patch fixes a problem in st and in
this way it is a valid fix.

This patch may also fix the bug 7900.

The patch compiles and is lightly tested.

Signed-off-by: Kai Makisara &lt;kai.makisara@kolumbus.fi&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[SCSI] st: fix Tape dies if wrong block size used, bug 7919

On Thu, 1 Feb 2007, Andrew Morton wrote:
&gt; On Thu, 1 Feb 2007 15:34:29 -0800
&gt; bugme-daemon@bugzilla.kernel.org wrote:
&gt;
&gt; &gt; http://bugzilla.kernel.org/show_bug.cgi?id=7919
&gt; &gt;
&gt; &gt;            Summary: Tape dies if wrong block size used
&gt; &gt;     Kernel Version: 2.6.20-rc5
&gt; &gt;             Status: NEW
&gt; &gt;           Severity: normal
&gt; &gt;              Owner: scsi_drivers-other@kernel-bugs.osdl.org
&gt; &gt;          Submitter: dmartin@sccd.ctc.edu
&gt; &gt;
&gt; &gt;
&gt; &gt; Most recent kernel where this bug did *NOT* occur: 2.6.17.14
&gt; &gt;
&gt; &gt; Other Kernels Tested and Results:
&gt; &gt;
&gt; &gt;     OK 2.6.15.7
&gt; &gt;     OK 2.6.16.37
&gt; &gt;     OK 2.6.17.14
&gt; &gt;     BAD 2.6.18.6
&gt; &gt;     BAD 2.6.18-1.2869.fc6
&gt; &gt;     BAD 2.6.19.2 +
&gt; &gt;     BAD 2.6.20-rc5
&gt; &gt;
&gt; &gt; NOTE: 2.6.18-1.2869.fc6 is a Fedora modified kernel, all others are from kernel.org
&gt; &gt;
...
&gt; &gt; Steps to reproduce:
&gt; &gt; Get a Adaptec AHA-2940U/UW/D / AIC-7881U card and a tape drive,
&gt; &gt; install a recent kernel
&gt; &gt; set the tape block size - mt setblk 4096
&gt; &gt; read from or write to tape using wrong block size - tar -b 7 -cvf /dev/tape foo
&gt; &gt;
Write does not trigger this bug because the driver refuses in fixed block
mode writes that are not a multiple of the block size. Read does trigger
it in my system.

The bug is not associated with any specific HBA. st tries to do direct i/o
in fixed block mode with reads that are not a multiple of tape block size.

The patch in this message fixes the st problem by switching to using the
driver buffer up to the next close of the device file in fixed block mode
if the user asks for a read like this.

I don't know why the bug has surfaced only after 2.6.17 although the st
problem is old. There may be another bug in the block subsystem and this
patch works around it. However, the patch fixes a problem in st and in
this way it is a valid fix.

This patch may also fix the bug 7900.

The patch compiles and is lightly tested.

Signed-off-by: Kai Makisara &lt;kai.makisara@kolumbus.fi&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>gdth: fix oops in gdth_copy_cmd()</title>
<updated>2007-03-23T19:49:21+00:00</updated>
<author>
<name>Joerg Dorchain</name>
<email>joerg@dorchain.net</email>
</author>
<published>2007-03-06T10:46:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b09bfe3601682228d9b4612a0266359df9710791'/>
<id>b09bfe3601682228d9b4612a0266359df9710791</id>
<content type='text'>
Recent alterations to the gdth_fill_raw_cmd() path no longer set the
sg_ranz field for zero transfer commands. However, this field is used
lower down in the function to initialise ha-&gt;cmd_len to the size of
the firmware packet.  If this uninitialised field contains a bogus
value, ha-&gt;cmd_len can become much larger than the actual firmware
packet and end up oopsing in gdth_copy_cmd() as it tries to copy this
huge packet to the device (usually because it runs into an unallocated
page).

The fix is to initialise the sg_ranz field to zero at the start of
gdth_fill_raw_cmd().

Signed-off-by: Joerg Dorchain &lt;joerg@dorchain.net&gt;
Acked-by: "Achim Leubner" &lt;Achim_Leubner@adaptec.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Recent alterations to the gdth_fill_raw_cmd() path no longer set the
sg_ranz field for zero transfer commands. However, this field is used
lower down in the function to initialise ha-&gt;cmd_len to the size of
the firmware packet.  If this uninitialised field contains a bogus
value, ha-&gt;cmd_len can become much larger than the actual firmware
packet and end up oopsing in gdth_copy_cmd() as it tries to copy this
huge packet to the device (usually because it runs into an unallocated
page).

The fix is to initialise the sg_ranz field to zero at the start of
gdth_fill_raw_cmd().

Signed-off-by: Joerg Dorchain &lt;joerg@dorchain.net&gt;
Acked-by: "Achim Leubner" &lt;Achim_Leubner@adaptec.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Fix bug 7994 sleeping function called from invalid context</title>
<updated>2007-03-13T18:26:46+00:00</updated>
<author>
<name>Douglas Gilbert</name>
<email>dougg@torque.net</email>
</author>
<published>2007-03-07T19:33:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ba5617decc4ccfefd2d4e638316d388e64233fcb'/>
<id>ba5617decc4ccfefd2d4e638316d388e64233fcb</id>
<content type='text'>
  - addresses the reported bug (with GFP_KERNEL -&gt; GFP_ATOMIC)
  - improves error checking, and
  - is a subset of the changes to scsi_debug in lk 2.6.21-rc*

Compiled and lightly tested (in lk 2.6.21-rc2 environment).

Signed-off-by: Douglas Gilbert &lt;dougg@torque.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  - addresses the reported bug (with GFP_KERNEL -&gt; GFP_ATOMIC)
  - improves error checking, and
  - is a subset of the changes to scsi_debug in lk 2.6.21-rc*

Compiled and lightly tested (in lk 2.6.21-rc2 environment).

Signed-off-by: Douglas Gilbert &lt;dougg@torque.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6</title>
<updated>2007-02-03T19:26:39+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@woody.linux-foundation.org</email>
</author>
<published>2007-02-03T19:26:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ce35a81a71f405031ed6fd0d454d3aaa55dc8ed2'/>
<id>ce35a81a71f405031ed6fd0d454d3aaa55dc8ed2</id>
<content type='text'>
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] sd: udev accessing an uninitialized scsi_disk field results in a crash
  [SCSI] st: A MTIOCTOP/MTWEOF within the early warning will cause the file number to be incorrect
  [SCSI] qla4xxx: bug fixes
  [SCSI] Fix scsi_add_device() for async scanning
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] sd: udev accessing an uninitialized scsi_disk field results in a crash
  [SCSI] st: A MTIOCTOP/MTWEOF within the early warning will cause the file number to be incorrect
  [SCSI] qla4xxx: bug fixes
  [SCSI] Fix scsi_add_device() for async scanning
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] sd: udev accessing an uninitialized scsi_disk field results in a crash</title>
<updated>2007-02-03T01:45:41+00:00</updated>
<author>
<name>Nagendra Singh Tomar</name>
<email>nagendra_tomar@adaptec.com</email>
</author>
<published>2007-02-02T12:04:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=017f2e37ae19ccd28e5edd965741fc374194c5dd'/>
<id>017f2e37ae19ccd28e5edd965741fc374194c5dd</id>
<content type='text'>
	sd_probe() calls class_device_add() even before initializing the
sdkp-&gt;device variable. class_device_add() eventually results in the user mode
udev program to be called. udev program can read the the allow_restart
attribute of the newly created scsi device. This is resulting in a crash as
the show function for allow_restart (i.e sd_show_allow_restart) returns the
attribute value by reading the sdkp-&gt;device-&gt;allow_restart variable. As the
sdkp-&gt;device is not initialized before calling the user mode hotplug helper,
this results in a crash.
	The patch below solves it by calling class_device_add() only after the
necessary fields in the scsi_disk structure are initialized properly.

Signed-off-by: Nagendra Singh Tomar &lt;nagendra_tomar@adaptec.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	sd_probe() calls class_device_add() even before initializing the
sdkp-&gt;device variable. class_device_add() eventually results in the user mode
udev program to be called. udev program can read the the allow_restart
attribute of the newly created scsi device. This is resulting in a crash as
the show function for allow_restart (i.e sd_show_allow_restart) returns the
attribute value by reading the sdkp-&gt;device-&gt;allow_restart variable. As the
sdkp-&gt;device is not initialized before calling the user mode hotplug helper,
this results in a crash.
	The patch below solves it by calling class_device_add() only after the
necessary fields in the scsi_disk structure are initialized properly.

Signed-off-by: Nagendra Singh Tomar &lt;nagendra_tomar@adaptec.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
