Thread (10 messages) 10 messages, 3 authors, 2025-09-15

Re: [PATCH net-next v6 3/5] dpll: zl3073x: Add firmware loading functionality

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-09-14 21:45:51
Also in: linux-doc, lkml

On Tue,  9 Sep 2025 11:15:30 +0200 Ivan Vecera wrote:
+	/* Fetch image name and size from input */
+	strscpy(buf, *psrc, min(sizeof(buf), *psize));
+	rc = sscanf(buf, "%15s %u %n", name, &count, &pos);
+	if (!rc) {
+		/* No more data */
+		return 0;
+	} else if (rc == 1 || count > U32_MAX / sizeof(u32)) {
+		ZL3073X_FW_ERR_MSG(extack, "invalid component size");
+		return -EINVAL;
+	}
+	*psrc += pos;
+	*psize -= pos;
Still worried about pos not being bounds checked.
Admin can crash the kernel with invalid FW file.

	if (pos > *psize)
		/* error */

Also what if sscanf() return 2? pos is uninitialized?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help