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: <20200528132908.GG611145@tassilo.jf.intel.com>
Date:   Thu, 28 May 2020 06:29:08 -0700
From:   Andi Kleen <ak@...ux.intel.com>
To:     kan.liang@...ux.intel.com
Cc:     peterz@...radead.org, mingo@...hat.com,
        linux-kernel@...r.kernel.org, David.Laight@...lab.com
Subject: Re: [PATCH V2 2/3] perf/x86/intel/uncore: Record the size of mapped
 area

On Thu, May 28, 2020 at 06:15:26AM -0700, kan.liang@...ux.intel.com wrote:
> -	box->io_addr = ioremap(addr, SNB_UNCORE_PCI_IMC_MAP_SIZE);
> +	if (!type->mmio_map_size) {
> +		pr_warn("perf uncore: Cannot ioremap for %s. Size of map area is 0.\n",
> +			type->name);
> +		return;
> +	}

Is that likely that the size is 0?

In any case you have to test the return value of ioremap. So I would rather
test the address for 0 than the size.

Similar in other code below.

I thought you were going to add a range check based on the size to the
actual access. Did I miss it in the patch?

-Andi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ