lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 20 May 2021 03:12:02 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Vadym Kochan <vadym.kochan@...ision.eu>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
        Taras Chornyi <tchornyi@...vell.com>,
        linux-kernel@...r.kernel.org,
        Mickey Rachamim <mickeyr@...vell.com>,
        Vadym Kochan <vkochan@...vell.com>
Subject: Re: [RFC net-next 1/4] net: marvell: prestera: try to load previous
 fw version

> +static int prestera_fw_get(struct prestera_fw *fw)
> +{
> +	int ver_maj = PRESTERA_SUPP_FW_MAJ_VER;
> +	int ver_min = PRESTERA_SUPP_FW_MIN_VER;
> +	char fw_path[128];
> +	int err;
> +
> +pick_fw_ver:
> +	snprintf(fw_path, sizeof(fw_path), PRESTERA_FW_PATH_FMT,
> +		 ver_maj, ver_min);
> +
> +	err = request_firmware_direct(&fw->bin, fw_path, fw->dev.dev);
> +	if (err) {
> +		if (ver_maj == PRESTERA_SUPP_FW_MAJ_VER) {
> +			ver_maj--;
> +			goto pick_fw_ver;
> +		} else {
> +			dev_err(fw->dev.dev, "failed to request firmware file\n");
> +			return err;
> +		}
> +	}

So lets say for the sake of the argument, you have version 3.0 and
2.42. It looks like this code will first try to load version 3.0. If
that fails, ver_maj is decremented, so it tries 2.0, which also fails
because it should be looking for 2.42. I don't think this decrement is
a good idea.

Also:

> +			dev_err(fw->dev.dev, "failed to request firmware file\n");

It would be useful to say what version you are actually looking for,
so the user can go find the correct firmware.

   Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ