<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/scsi/lpfc/lpfc_debugfs.c, branch linux-5.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-08-28T14:21:30Z</updated>
<entry>
<title>scsi: lpfc: Remove redundant assignment to avoid memory leak</title>
<updated>2025-08-28T14:21:30Z</updated>
<author>
<name>Jiasheng Jiang</name>
</author>
<published>2025-08-01T18:52:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=896cbd432ede14b2e8119038c599c6c7ce2fd2f7'/>
<id>urn:sha1:896cbd432ede14b2e8119038c599c6c7ce2fd2f7</id>
<content type='text'>
[ Upstream commit eea6cafb5890db488fce1c69d05464214616d800 ]

Remove the redundant assignment if kzalloc() succeeds to avoid memory
leak.

Fixes: bd2cdd5e400f ("scsi: lpfc: NVME Initiator: Add debugfs support")
Signed-off-by: Jiasheng Jiang &lt;jiashengjiangcool@gmail.com&gt;
Link: https://lore.kernel.org/r/20250801185202.42631-1-jiashengjiangcool@gmail.com
Reviewed-by: Justin Tee &lt;justin.tee@broadcom.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: lpfc: Prevent lpfc_debugfs_lockstat_write() buffer overflow</title>
<updated>2023-05-30T11:44:02Z</updated>
<author>
<name>Justin Tee</name>
</author>
<published>2023-03-01T23:16:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=644a9d5e22761a41d5005a26996a643da96de962'/>
<id>urn:sha1:644a9d5e22761a41d5005a26996a643da96de962</id>
<content type='text'>
[ Upstream commit c6087b82a9146826564a55c5ca0164cac40348f5 ]

A static code analysis tool flagged the possibility of buffer overflow when
using copy_from_user() for a debugfs entry.

Currently, it is possible that copy_from_user() copies more bytes than what
would fit in the mybuf char array.  Add a min() restriction check between
sizeof(mybuf) - 1 and nbytes passed from the userspace buffer to protect
against buffer overflow.

Link: https://lore.kernel.org/r/20230301231626.9621-2-justintee8345@gmail.com
Signed-off-by: Justin Tee &lt;justin.tee@broadcom.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: lpfc: Prevent buffer overflow crashes in debugfs with malformed user input</title>
<updated>2022-08-25T09:18:33Z</updated>
<author>
<name>James Smart</name>
</author>
<published>2022-07-01T21:14:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=927907f1cbb3408cadde637fccfc17bb6b10a87d'/>
<id>urn:sha1:927907f1cbb3408cadde637fccfc17bb6b10a87d</id>
<content type='text'>
[ Upstream commit f8191d40aa612981ce897e66cda6a88db8df17bb ]

Malformed user input to debugfs results in buffer overflow crashes.  Adapt
input string lengths to fit within internal buffers, leaving space for NULL
terminators.

Link: https://lore.kernel.org/r/20220701211425.2708-3-jsmart2021@gmail.com
Co-developed-by: Justin Tee &lt;justin.tee@broadcom.com&gt;
Signed-off-by: Justin Tee &lt;justin.tee@broadcom.com&gt;
Signed-off-by: James Smart &lt;jsmart2021@gmail.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: lpfc: Terminate string in lpfc_debugfs_nvmeio_trc_write()</title>
<updated>2022-01-05T11:37:44Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2021-12-14T07:05:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc926b8f4d39aed45afecacd50302fd5534a97b2'/>
<id>urn:sha1:cc926b8f4d39aed45afecacd50302fd5534a97b2</id>
<content type='text'>
[ Upstream commit 9020be114a47bf7ff33e179b3bb0016b91a098e6 ]

The "mybuf" string comes from the user, so we need to ensure that it is NUL
terminated.

Link: https://lore.kernel.org/r/20211214070527.GA27934@kili
Fixes: bd2cdd5e400f ("scsi: lpfc: NVME Initiator: Add debugfs support")
Reviewed-by: James Smart &lt;jsmart2021@gmail.com&gt;
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: lpfc: Fix some error codes in debugfs</title>
<updated>2021-03-24T10:26:39Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2021-03-12T07:42:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb46392d329ad68581f6715fd1b119dc8941a5b6'/>
<id>urn:sha1:eb46392d329ad68581f6715fd1b119dc8941a5b6</id>
<content type='text'>
commit 19f1bc7edf0f97186810e13a88f5b62069d89097 upstream.

If copy_from_user() or kstrtoull() fail then the correct behavior is to
return a negative error code.

Link: https://lore.kernel.org/r/YEsbU/UxYypVrC7/@mwanda
Fixes: f9bb2da11db8 ("[SCSI] lpfc 8.3.27: T10 additions for SLI4")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>scsi: lpfc: Remove bg debugfs buffers</title>
<updated>2019-08-29T22:08:58Z</updated>
<author>
<name>James Smart</name>
</author>
<published>2019-08-27T21:28:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9db6c14c36fc8f7824ade95f53bcdad43df678b4'/>
<id>urn:sha1:9db6c14c36fc8f7824ade95f53bcdad43df678b4</id>
<content type='text'>
Capturing and downloading dif command data and dif data was done a dozen
years ago and no longer being used. Also creates a potential security hole.

Remove the debugfs buffer for dif debugging.

Signed-off-by: Dick Kennedy &lt;dick.kennedy@broadcom.com&gt;
Signed-off-by: James Smart &lt;jsmart2021@gmail.com&gt;
CC: KyleMahlkuch &lt;kmahlkuc@linux.vnet.ibm.com&gt;
CC: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: lpfc: Merge per-protocol WQ/CQ pairs into single per-cpu pair</title>
<updated>2019-08-20T02:41:12Z</updated>
<author>
<name>James Smart</name>
</author>
<published>2019-08-14T23:57:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c00f62e6c5468ed0673c583f1ff284274e817410'/>
<id>urn:sha1:c00f62e6c5468ed0673c583f1ff284274e817410</id>
<content type='text'>
Currently, each hardware queue, typically allocated per-cpu, consists of a
WQ/CQ pair per protocol. Meaning if both SCSI and NVMe are supported 2
WQ/CQ pairs will exist for the hardware queue. Separate queues are
unnecessary. The current implementation wastes memory backing the 2nd set
of queues, and the use of double the SLI-4 WQ/CQ's means less hardware
queues can be supported which means there may not always be enough to have
a pair per cpu. If there is only 1 pair per cpu, more cpu's may get their
own WQ/CQ.

Rework the implementation to use a single WQ/CQ pair by both protocols.

Signed-off-by: Dick Kennedy &lt;dick.kennedy@broadcom.com&gt;
Signed-off-by: James Smart &lt;jsmart2021@gmail.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: lpfc: Migrate to %px and %pf in kernel print calls</title>
<updated>2019-08-20T02:41:11Z</updated>
<author>
<name>James Smart</name>
</author>
<published>2019-08-14T23:57:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32350664497279f4ddd96164caafc8a1b573ca2a'/>
<id>urn:sha1:32350664497279f4ddd96164caafc8a1b573ca2a</id>
<content type='text'>
In order to see real addresses, convert %p with %px for kernel addresses
and replace %p with %pf for functions.

While converting, standardize on "x%px" throughout (not %px or 0x%px).

Signed-off-by: Dick Kennedy &lt;dick.kennedy@broadcom.com&gt;
Signed-off-by: James Smart &lt;jsmart2021@gmail.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: lpfc: change snprintf to scnprintf for possible overflow</title>
<updated>2019-03-26T02:14:16Z</updated>
<author>
<name>Silvio Cesare</name>
</author>
<published>2019-03-21T16:44:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e7f7b6f38a44697428f5a2e7c606de028df2b0e3'/>
<id>urn:sha1:e7f7b6f38a44697428f5a2e7c606de028df2b0e3</id>
<content type='text'>
Change snprintf to scnprintf. There are generally two cases where using
snprintf causes problems.

1) Uses of size += snprintf(buf, SIZE - size, fmt, ...)
In this case, if snprintf would have written more characters than what the
buffer size (SIZE) is, then size will end up larger than SIZE. In later
uses of snprintf, SIZE - size will result in a negative number, leading
to problems. Note that size might already be too large by using
size = snprintf before the code reaches a case of size += snprintf.

2) If size is ultimately used as a length parameter for a copy back to user
space, then it will potentially allow for a buffer overflow and information
disclosure when size is greater than SIZE. When the size is used to index
the buffer directly, we can have memory corruption. This also means when
size = snprintf... is used, it may also cause problems since size may become
large.  Copying to userspace is mitigated by the HARDENED_USERCOPY kernel
configuration.

The solution to these issues is to use scnprintf which returns the number of
characters actually written to the buffer, so the size variable will never
exceed SIZE.

Signed-off-by: Silvio Cesare &lt;silvio.cesare@gmail.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: James Smart &lt;james.smart@broadcom.com&gt;
Cc: Dick Kennedy &lt;dick.kennedy@broadcom.com&gt;
Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: be2iscsi: lpfc: fix typo</title>
<updated>2019-03-19T21:38:20Z</updated>
<author>
<name>Matteo Croce</name>
</author>
<published>2019-01-04T21:38:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=92684bfc9b163175f43624d8d781f9ef74ff0fee'/>
<id>urn:sha1:92684bfc9b163175f43624d8d781f9ef74ff0fee</id>
<content type='text'>
Fix spelling mistake: "lenght" -&gt; "length"

Signed-off-by: Matteo Croce &lt;mcroce@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
