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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150727155922.GB350@e104818-lin.cambridge.arm.com>
Date:	Mon, 27 Jul 2015 16:59:23 +0100
From:	Catalin Marinas <catalin.marinas@....com>
To:	Andrey Ryabinin <a.ryabinin@...sung.com>
Cc:	Will Deacon <will.deacon@....com>,
	linux-arm-kernel@...ts.infradead.org,
	Alexey Klimov <klimov.linux@...il.com>,
	Arnd Bergmann <arnd@...db.de>, linux-mm@...ck.org,
	Linus Walleij <linus.walleij@...aro.org>,
	linux-kernel@...r.kernel.org,
	David Keitel <dkeitel@...eaurora.org>,
	Alexander Potapenko <glider@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Dmitry Vyukov <dvyukov@...gle.com>
Subject: Re: [PATCH v4 5/7] arm64: add KASAN support

On Fri, Jul 24, 2015 at 07:41:57PM +0300, Andrey Ryabinin wrote:
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 4d2a925..2cacf55 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -40,6 +40,12 @@ else
>  TEXT_OFFSET := 0x00080000
>  endif
>  
> +# KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS - 3)) - (1 << 61)
> +KASAN_SHADOW_OFFSET := $(shell printf "0x%x\n" $$(( \
> +			(-1 << $(CONFIG_ARM64_VA_BITS)) \
> +			+ (1 << ($(CONFIG_ARM64_VA_BITS) - 3)) \
> +			- (1 << (64 - 3)) )) )

Does this work with any POSIX shell? Do we always have a 64-bit type?
As I wasn't sure about this, I suggested awk (or perl).

> +static void __init clear_pgds(unsigned long start,
> +			unsigned long end)
> +{
> +	/*
> +	 * Remove references to kasan page tables from
> +	 * swapper_pg_dir. pgd_clear() can't be used
> +	 * here because it's nop on 2,3-level pagetable setups
> +	 */
> +	for (; start && start < end; start += PGDIR_SIZE)
> +		set_pgd(pgd_offset_k(start), __pgd(0));
> +}

I don't think we need the "start" check, just "start < end". Do you
expect a start == 0 (or overflow)?

-- 
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ