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: <20200526194648.GA2206@willie-the-truck>
Date:   Tue, 26 May 2020 20:46:48 +0100
From:   Will Deacon <will@...nel.org>
To:     Catalin Marinas <catalin.marinas@....com>
Cc:     Anshuman Khandual <anshuman.khandual@....com>,
        linux-arm-kernel@...ts.infradead.org, mark.rutland@....com,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2] arm64/cpufeature: Add get_arm64_ftr_reg_nowarn()

On Tue, May 26, 2020 at 04:01:35PM +0100, Catalin Marinas wrote:
> On Tue, May 26, 2020 at 07:09:13PM +0530, Anshuman Khandual wrote:
> > @@ -632,8 +654,6 @@ static void __init init_cpu_ftr_reg(u32 sys_reg, u64 new)
> >  	const struct arm64_ftr_bits *ftrp;
> >  	struct arm64_ftr_reg *reg = get_arm64_ftr_reg(sys_reg);
> >  
> > -	BUG_ON(!reg);
> > -
> >  	for (ftrp = reg->ftr_bits; ftrp->width; ftrp++) {
> >  		u64 ftr_mask = arm64_ftr_mask(ftrp);
> >  		s64 ftr_new = arm64_ftr_value(ftrp, new);
> > @@ -762,7 +782,6 @@ static int check_update_ftr_reg(u32 sys_id, int cpu, u64 val, u64 boot)
> >  {
> >  	struct arm64_ftr_reg *regp = get_arm64_ftr_reg(sys_id);
> >  
> > -	BUG_ON(!regp);
> >  	update_cpu_ftr_reg(regp, val);
> >  	if ((boot & regp->strict_mask) == (val & regp->strict_mask))
> >  		return 0;
> > @@ -776,9 +795,6 @@ static void relax_cpu_ftr_reg(u32 sys_id, int field)
> >  	const struct arm64_ftr_bits *ftrp;
> >  	struct arm64_ftr_reg *regp = get_arm64_ftr_reg(sys_id);
> >  
> > -	if (WARN_ON(!regp))
> > -		return;
> 
> I think Will wanted an early return in all these functions not just
> removing the BUG_ON(). I'll let him clarify.

Yes, the callers need to check the pointer and return early.

Will

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ