From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750999AbcBMJA6 (ORCPT ); Sat, 13 Feb 2016 04:00:58 -0500 Received: from mail-ig0-f169.google.com ([209.85.213.169]:35498 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750702AbcBMJA4 (ORCPT ); Sat, 13 Feb 2016 04:00:56 -0500 MIME-Version: 1.0 In-Reply-To: <20160213003147.GA12074@davidb.org> References: <1455141142-6838-1-git-send-email-david.brown@linaro.org> <20160213003147.GA12074@davidb.org> Date: Sat, 13 Feb 2016 10:00:56 +0100 Message-ID: Subject: Re: [kernel-hardening] [PATCH] arm64: vdso: Mark vDSO code as read-only From: Ard Biesheuvel To: David Brown Cc: kernel-hardening@lists.openwall.com, Catalin Marinas , Will Deacon , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Kees Cook Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13 February 2016 at 01:31, David Brown wrote: > On Thu, Feb 11, 2016 at 03:19:20PM +0100, Ard Biesheuvel wrote: > >>> diff --git a/arch/arm64/kernel/vdso/vdso.S >>> b/arch/arm64/kernel/vdso/vdso.S >>> index 60c1db5..db7c0f2 100644 >>> --- a/arch/arm64/kernel/vdso/vdso.S >>> +++ b/arch/arm64/kernel/vdso/vdso.S >>> @@ -24,6 +24,7 @@ >>> __PAGE_ALIGNED_DATA >> >> >> ^^ You can get rid of this now as well > > > Can we? The page is getting mapped to userspace, and if we didn't > page align it, we could leak kernel read-only data to every userspace > process. > That's what the .balign is for. __PAGE_ALIGNED_DATA only sets the section, and you're overriding that right after.