<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/scsi/aacraid/commctrl.c, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-02-08T22:33:00Z</updated>
<entry>
<title>scsi: ata: Use unsigned int for cmd's type in ioctls in scsi_host_template</title>
<updated>2019-02-08T22:33:00Z</updated>
<author>
<name>Nathan Chancellor</name>
<email>natechancellor@gmail.com</email>
</author>
<published>2019-02-07T16:07:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6f4e626fb0cc93d50b49b79c2ee33bd769ee57f0'/>
<id>urn:sha1:6f4e626fb0cc93d50b49b79c2ee33bd769ee57f0</id>
<content type='text'>
Clang warns several times in the scsi subsystem (trimmed for brevity):

drivers/scsi/hpsa.c:6209:7: warning: overflow converting case value to
switch condition type (2147762695 to 18446744071562347015) [-Wswitch]
        case CCISS_GETBUSTYPES:
             ^
drivers/scsi/hpsa.c:6208:7: warning: overflow converting case value to
switch condition type (2147762694 to 18446744071562347014) [-Wswitch]
        case CCISS_GETHEARTBEAT:
             ^

The root cause is that the _IOC macro can generate really large numbers,
which don't fit into type 'int', which is used for the cmd parameter in
the ioctls in scsi_host_template. My research into how GCC and Clang are
handling this at a low level didn't prove fruitful. However, looking at
the rest of the kernel tree, all ioctls use an 'unsigned int' for the
cmd parameter, which will fit all of the _IOC values in the scsi/ata
subsystems.

Make that change because none of the ioctls expect a negative value for
any command, it brings the ioctls inline with the reset of the kernel,
and it removes ambiguity, which is never good when dealing with compilers.

Link: https://github.com/ClangBuiltLinux/linux/issues/85
Link: https://github.com/ClangBuiltLinux/linux/issues/154
Link: https://github.com/ClangBuiltLinux/linux/issues/157
Signed-off-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
Acked-by: Bradley Grove &lt;bgrove@attotech.com&gt;
Acked-by: Don Brace &lt;don.brace@microsemi.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Tested-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: aacraid: change event_wait to a completion</title>
<updated>2018-12-13T01:35:33Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-12-10T21:32:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bc127d93e4eca0f45caf2e68e9aeb06284b15b86'/>
<id>urn:sha1:bc127d93e4eca0f45caf2e68e9aeb06284b15b86</id>
<content type='text'>
The event_wait semaphore has completion semantics, so we can
change it over to the completion interface for clarity without
changing the behavior.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Reviewed-by: Dave Carroll &lt;david.carroll@microsemi.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: aacraid: change wait_sem to a completion</title>
<updated>2018-12-13T01:35:33Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-12-10T21:32:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=dc71eccc175eae4959b06ae697ebef019719063d'/>
<id>urn:sha1:dc71eccc175eae4959b06ae697ebef019719063d</id>
<content type='text'>
The wait_sem member is used like a completion, so we should
use the respective API. The behavior is unchanged.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Reviewed-by: Dave Carroll &lt;david.carroll@microsemi.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: aacraid: remove bogus GFP_DMA32 specifies</title>
<updated>2018-06-06T01:15:08Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2018-05-30T09:09:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a0c1c185fbe2cd6052059604380b26441e2f935f'/>
<id>urn:sha1:a0c1c185fbe2cd6052059604380b26441e2f935f</id>
<content type='text'>
For one GFP_DMA32 does not actually work with kmalloc, as we only have
GFP_DMA and GFP_KERNEL caches, but not GFP_DMA32.  Second the memory
is mapped using the proper DMA API anyway, which would include proper
bounce buffering if needed by the device.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: aacraid: Fix ioctl reset hang</title>
<updated>2018-01-04T04:26:41Z</updated>
<author>
<name>Raghava Aditya Renukunta</name>
<email>RaghavaAditya.Renukunta@microsemi.com</email>
</author>
<published>2017-12-27T04:34:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f3a2327725b4f922dabb89e46ff66713cfa461c2'/>
<id>urn:sha1:f3a2327725b4f922dabb89e46ff66713cfa461c2</id>
<content type='text'>
Driver would hang when attempting to send reset from the ioctl interface,
since it would wait to retrieve the ioctl mutex at send shutdown.

Set adapter shutdown and unlock mutex before sending down reset request.

Signed-off-by: Raghava Aditya Renukunta &lt;RaghavaAditya.Renukunta@microsemi.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: aacraid: Don't copy uninitialized stack memory to userspace</title>
<updated>2017-06-26T19:01:03Z</updated>
<author>
<name>Seth Forshee</name>
<email>seth.forshee@canonical.com</email>
</author>
<published>2017-06-23T14:04:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=342ffc26693b528648bdc9377e51e4f2450b4860'/>
<id>urn:sha1:342ffc26693b528648bdc9377e51e4f2450b4860</id>
<content type='text'>
Both aac_send_raw_srb() and aac_get_hba_info() may copy stack allocated
structs to userspace without initializing all members of these
structs. Clear out this memory to prevent information leaks.

Fixes: 423400e64d377 ("scsi: aacraid: Include HBA direct interface")
Fixes: c799d519bf088 ("scsi: aacraid: Retrieve HBA host information ioctl")
Signed-off-by: Seth Forshee &lt;seth.forshee@canonical.com&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: aacraid: fix leak of data from stack back to userspace</title>
<updated>2017-06-26T16:32:15Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2017-05-15T14:56:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5cc973f09e21b5a2f746307641879bc9f1da623b'/>
<id>urn:sha1:5cc973f09e21b5a2f746307641879bc9f1da623b</id>
<content type='text'>
The fields sense_data_size and sense_data are unitialized garbage from
the stack and are being copied back to userspace.  Fix this leak of
stack information by ensuring they are zero'd.

Detected by CoverityScan, CID#1435473 ("Uninitialized scalar variable")

Fixes: 423400e64d377 ("scsi: aacraid: Include HBA direct interface")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Acked-by: Dave Carroll &lt;david.carroll@microsemi.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: aacraid: Remove __GFP_DMA for raw srb memory</title>
<updated>2017-06-13T00:47:59Z</updated>
<author>
<name>Raghava Aditya Renukunta</name>
<email>RaghavaAditya.Renukunta@microsemi.com</email>
</author>
<published>2017-05-10T16:39:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c831a4a08636d5462a0f9eb479771e2f65ad0378'/>
<id>urn:sha1:c831a4a08636d5462a0f9eb479771e2f65ad0378</id>
<content type='text'>
The raw srb commands do not requires memory that in the ZONE_DMA memory
space. For 32bit srb commands use GFP_DMA32 to limit the memory to 32bit
memory range (4GB).

Signed-off-by: Raghava Aditya Renukunta &lt;RaghavaAditya.Renukunta@microsemi.com&gt;
Reviewed-by: Dave Carroll &lt;david.carroll@microsemi.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: aacraid: pci_alloc_consistent() failures on ARM64</title>
<updated>2017-04-26T22:28:06Z</updated>
<author>
<name>Mahesh Rajashekhara</name>
<email>mahesh.rajashekhara@microsemi.com</email>
</author>
<published>2017-04-05T10:44:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f481973d5efdb63b7c6ca6b0ecd2b8462556a461'/>
<id>urn:sha1:f481973d5efdb63b7c6ca6b0ecd2b8462556a461</id>
<content type='text'>
There were pci_alloc_consistent() failures on ARM64 platform.  Use
dma_alloc_coherent() with GFP_KERNEL flag DMA memory allocations.

Signed-off-by: Mahesh Rajashekhara &lt;mahesh.rajashekhara@microsemi.com&gt;
[hch: tweaked indentation, removed memsets]
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Dave Carroll &lt;david.carroll@microsemi.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: aacraid: Use correct channel number for raw srb</title>
<updated>2017-02-22T23:41:41Z</updated>
<author>
<name>Raghava Aditya Renukunta</name>
<email>RaghavaAditya.Renukunta@microsemi.com</email>
</author>
<published>2017-02-16T20:51:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f3ef4a74dc3712ef0ce60d652aa87b1ba70cb2a4'/>
<id>urn:sha1:f3ef4a74dc3712ef0ce60d652aa87b1ba70cb2a4</id>
<content type='text'>
The channel being used for raw srb commands is retrieved from the utility
sent fibs and is converted into physical channel id. The driver does not
need to to do this since the management utility sends the correct channel
id in the first place and in addition the driver sets inaccurate
information in the cmd sent to the firmware and gets an invalid response.

Fixed by using channel id from srb command.

Cc: stable@vger.kernel.org
Fixes: 423400e64d377c0 ("scsi: aacraid: Include HBA direct interface")
Signed-off-by: Raghava Aditya Renukunta &lt;RaghavaAditya.Renukunta@microsemi.com&gt;
Reviewed-by: David Carroll &lt;David.Carroll@microsemi.com&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
