<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/scsi/fnic, branch linux-5.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-07-25T02:09:56Z</updated>
<entry>
<title>scsi: fnic: Use eth_broadcast_addr() to assign broadcast address</title>
<updated>2020-07-25T02:09:56Z</updated>
<author>
<name>Miaohe Lin</name>
</author>
<published>2020-07-20T08:24:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=51d263cbdd769eea65da2f13e393b542085af10d'/>
<id>urn:sha1:51d263cbdd769eea65da2f13e393b542085af10d</id>
<content type='text'>
Use eth_broadcast_addr() to assign broadcast address insetad of memset().

Link: https://lore.kernel.org/r/1595233498-13628-1-git-send-email-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin &lt;linmiaohe@huawei.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: fnic: Use true, false for fnic-&gt;internal_reset_inprogress</title>
<updated>2020-05-08T02:03:07Z</updated>
<author>
<name>Jason Yan</name>
</author>
<published>2020-04-30T12:17:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b91857a5ca13cc7e6e7fe904d7f4ad64d44aee04'/>
<id>urn:sha1:b91857a5ca13cc7e6e7fe904d7f4ad64d44aee04</id>
<content type='text'>
Fix the following coccicheck warning:

drivers/scsi/fnic/fnic_scsi.c:2627:5-36: WARNING: Comparison of 0/1 to
bool variable

Link: https://lore.kernel.org/r/20200430121718.14970-1-yanaijie@huawei.com
Signed-off-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: fnic: make vnic_wq_get_ctrl and vnic_wq_alloc_ring static</title>
<updated>2020-04-17T17:48:05Z</updated>
<author>
<name>Jason Yan</name>
</author>
<published>2020-04-15T09:38:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9ae583804a331594fc91c87719d404e0dc73034a'/>
<id>urn:sha1:9ae583804a331594fc91c87719d404e0dc73034a</id>
<content type='text'>
Fix the following sparse warning:

drivers/scsi/fnic/vnic_wq.c:28:5: warning: symbol 'vnic_wq_get_ctrl' was
not declared. Should it be static?
drivers/scsi/fnic/vnic_wq.c:40:5: warning: symbol 'vnic_wq_alloc_ring'
was not declared. Should it be static?

Link: https://lore.kernel.org/r/20200415093809.9365-3-yanaijie@huawei.com
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: fnic: make fnic_list and fnic_list_lock static</title>
<updated>2020-04-17T17:48:04Z</updated>
<author>
<name>Jason Yan</name>
</author>
<published>2020-04-15T09:38:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1d8baf9ed09d169ccaa8c703bd1c36a0ac69543f'/>
<id>urn:sha1:1d8baf9ed09d169ccaa8c703bd1c36a0ac69543f</id>
<content type='text'>
Fix the following sparse warning:

drivers/scsi/fnic/fnic_main.c:52:1: warning: symbol 'fnic_list' was not
declared. Should it be static?
drivers/scsi/fnic/fnic_main.c:53:1: warning: symbol 'fnic_list_lock' was
not declared. Should it be static?

Link: https://lore.kernel.org/r/20200415093809.9365-2-yanaijie@huawei.com
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: fnic: make some symbols static</title>
<updated>2020-04-17T17:48:03Z</updated>
<author>
<name>Jason Yan</name>
</author>
<published>2020-04-15T09:38:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=363f4d937501ba464d8a8248983dcfffabe69ea7'/>
<id>urn:sha1:363f4d937501ba464d8a8248983dcfffabe69ea7</id>
<content type='text'>
Fix the following sparse warning:

drivers/scsi/fnic/vnic_dev.c:257:5: warning: symbol 'vnic_dev_cmd1' was
not declared. Should it be static?
drivers/scsi/fnic/vnic_dev.c:319:5: warning: symbol 'vnic_dev_cmd2' was
not declared. Should it be static?
drivers/scsi/fnic/vnic_dev.c:414:5: warning: symbol
'vnic_dev_init_devcmd1' was not declared. Should it be static?
drivers/scsi/fnic/vnic_dev.c:425:5: warning: symbol
'vnic_dev_init_devcmd2' was not declared. Should it be static?
drivers/scsi/fnic/vnic_dev.c:495:6: warning: symbol
'vnic_dev_deinit_devcmd2' was not declared. Should it be static?
drivers/scsi/fnic/vnic_dev.c:506:5: warning: symbol
'vnic_dev_cmd_no_proxy' was not declared. Should it be static?

Link: https://lore.kernel.org/r/20200415093809.9365-1-yanaijie@huawei.com
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: fnic: Use scnprintf() for avoiding potential buffer overflow</title>
<updated>2020-03-17T17:36:10Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2020-03-15T09:42:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2605fbd89b6529371c2b6139176dcb7b35d9a029'/>
<id>urn:sha1:2605fbd89b6529371c2b6139176dcb7b35d9a029</id>
<content type='text'>
Since snprintf() returns the would-be-output size instead of the actual
output size, the succeeding calls may go beyond the given buffer limit.
Fix it by replacing with scnprintf().

Link: https://lore.kernel.org/r/20200315094241.9086-4-tiwai@suse.de
Cc: "James E . J . Bottomley" &lt;jejb@linux.ibm.com&gt;
Cc: "Martin K . Petersen" &lt;martin.petersen@oracle.com&gt;
Cc: Satish Kharat &lt;satishkh@cisco.com&gt;
Cc: Sesidhar Baddela &lt;sebaddel@cisco.com&gt;
Cc: Karan Tilak Kumar &lt;kartilak@cisco.com&gt;
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: Replace zero-length array with flexible-array member</title>
<updated>2020-03-12T03:07:56Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2020-02-24T16:14:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5febf6d6ae4d488a5dc388c46d96c17f9556238f'/>
<id>urn:sha1:5febf6d6ae4d488a5dc388c46d96c17f9556238f</id>
<content type='text'>
The current codebase makes use of the zero-length array language extension
to the C90 standard, but the preferred mechanism to declare variable-length
types such as these ones is a flexible array member[1][2], introduced in
C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning in
case the flexible array does not occur last in the structure, which will
help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by this
change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Link: https://lore.kernel.org/r/20200224161406.GA21454@embeddedor
Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Reviewed-by: Satish Kharat &lt;satishkh@cisco.com&gt;
Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: fnic: do not queue commands during fwreset</title>
<updated>2020-01-21T04:58:14Z</updated>
<author>
<name>Hannes Reinecke</name>
</author>
<published>2020-01-16T10:20:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e2209629fec427ba75a6351486153a9feddd36b'/>
<id>urn:sha1:0e2209629fec427ba75a6351486153a9feddd36b</id>
<content type='text'>
When a link is going down the driver will be calling fnic_cleanup_io(),
which will traverse all commands and calling 'done' for each found command.
While the traversal is handled under the host_lock, calling 'done' happens
after the host_lock is being dropped.

As fnic_queuecommand_lck() is being called with the host_lock held, it
might well be that it will pick the command being selected for abortion
from the above routine and enqueue it for sending, but then 'done' is being
called on that very command from the above routine.

Which of course confuses the hell out of the scsi midlayer.

So fix this by not queueing commands when fnic_cleanup_io is active.

Link: https://lore.kernel.org/r/20200116102053.62755-1-hare@suse.de
Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: fnic: fix invalid stack access</title>
<updated>2020-01-16T03:59:59Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2020-01-07T20:15:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=42ec15ceaea74b5f7a621fc6686cbf69ca66c4cf'/>
<id>urn:sha1:42ec15ceaea74b5f7a621fc6686cbf69ca66c4cf</id>
<content type='text'>
gcc -O3 warns that some local variables are not properly initialized:

drivers/scsi/fnic/vnic_dev.c: In function 'fnic_dev_hang_notify':
drivers/scsi/fnic/vnic_dev.c:511:16: error: 'a0' is used uninitialized in this function [-Werror=uninitialized]
  vdev-&gt;args[0] = *a0;
  ~~~~~~~~~~~~~~^~~~~
drivers/scsi/fnic/vnic_dev.c:691:6: note: 'a0' was declared here
  u64 a0, a1;
      ^~
drivers/scsi/fnic/vnic_dev.c:512:16: error: 'a1' is used uninitialized in this function [-Werror=uninitialized]
  vdev-&gt;args[1] = *a1;
  ~~~~~~~~~~~~~~^~~~~
drivers/scsi/fnic/vnic_dev.c:691:10: note: 'a1' was declared here
  u64 a0, a1;
          ^~
drivers/scsi/fnic/vnic_dev.c: In function 'fnic_dev_mac_addr':
drivers/scsi/fnic/vnic_dev.c:512:16: error: 'a1' is used uninitialized in this function [-Werror=uninitialized]
  vdev-&gt;args[1] = *a1;
  ~~~~~~~~~~~~~~^~~~~
drivers/scsi/fnic/vnic_dev.c:698:10: note: 'a1' was declared here
  u64 a0, a1;
          ^~

Apparently the code relies on the local variables occupying adjacent memory
locations in the same order, but this is of course not guaranteed.

Use an array of two u64 variables where needed to make it work correctly.

I suspect there is also an endianness bug here, but have not digged in deep
enough to be sure.

Fixes: 5df6d737dd4b ("[SCSI] fnic: Add new Cisco PCI-Express FCoE HBA")
Fixes: mmtom ("init/Kconfig: enable -O3 for all arches")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200107201602.4096790-1-arnd@arndb.de
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: fnic: fix use after free</title>
<updated>2019-11-06T05:04:02Z</updated>
<author>
<name>Pan Bian</name>
</author>
<published>2019-11-04T15:26:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec990306f77fd4c58c3b27cc3b3c53032d6e6670'/>
<id>urn:sha1:ec990306f77fd4c58c3b27cc3b3c53032d6e6670</id>
<content type='text'>
The memory chunk io_req is released by mempool_free. Accessing
io_req-&gt;start_time will result in a use after free bug. The variable
start_time is a backup of the timestamp. So, use start_time here to
avoid use after free.

Link: https://lore.kernel.org/r/1572881182-37664-1-git-send-email-bianpan2016@163.com
Signed-off-by: Pan Bian &lt;bianpan2016@163.com&gt;
Reviewed-by: Satish Kharat &lt;satishkh@cisco.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
