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]
Message-ID: <de14ce03-2d42-74d1-3801-2dd2b09a448e@redhat.com>
Date:   Fri, 28 Aug 2020 06:50:54 -0700
From:   Tom Rix <trix@...hat.com>
To:     Lee Jones <lee.jones@...aro.org>, Xu Yilun <yilun.xu@...el.com>
Cc:     broonie@...nel.org, linux-kernel@...r.kernel.org,
        matthew.gerlach@...ux.intel.com, russell.h.weight@...el.com,
        lgoncalv@...hat.com, hao.wu@...el.com
Subject: Re: [PATCH v4 2/2] mfd: intel-m10-bmc: add Max10 BMC chip support for
 Intel FPGA PAC


>> +
>> +static int check_m10bmc_version(struct intel_m10bmc *m10bmc)
>> +{
>> +	unsigned int v;
>> +
>> +	if (m10bmc_raw_read(m10bmc, M10BMC_LEGACY_SYS_BASE + M10BMC_BUILD_VER,
>> +			    &v))
>> +		return -ENODEV;
> Please break functions out of if statements.
>
> Does m10bmc_raw_read() return 0 on success?
>
> Seems odd for a read function.
>
>> +	if (v != 0xffffffff) {
>> +		dev_err(m10bmc->dev, "bad version M10BMC detected\n");
>> +		return -ENODEV;
>> +	}
> The only acceptable version is -1?

I ran into this in testing.  This is a check if the board is using a very old legacy bmc version. The M10BMC_LEGACY_SYS_BASE is the offset to this old block of mmio regs.  On the old boards, v would have not been f's, on the current boards it is f's. The check is necessary because future calls use the M10BMC_SYS_BASE offset which was not valid on the old boards.

Tom

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ