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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux