Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1577287ybb; Thu, 9 Apr 2020 05:05:35 -0700 (PDT) X-Google-Smtp-Source: APiQypJI+D0abVhyQOGXGDxJTwi738973VuCtQBYyfg+xmyN8sn+j5oDvgg3PAKzva3ZN4PaewGm X-Received: by 2002:a9d:7e8e:: with SMTP id m14mr5993040otp.45.1586433935643; Thu, 09 Apr 2020 05:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586433935; cv=none; d=google.com; s=arc-20160816; b=bL8CCA7GmEQ4oaEBEphJS+5LOlczUCcPkjWSyWh4gQq77fSl6/c8vv8jGLT1TxMR6E mj1XuQBr/+KGTTyBKDL8acBzmRyB3w4unI2Vtv6QpWkZxlkwZPvSCVtK5D3wqC/WRQcy +mcL4cc2YUv06HNiNd66Vlcmcjp4lyEvEr97FTcbgV1ozZ7KzKEC4t8HFhI2ENRFBPEp AlKYuZ0uV6uFhL8uNEQXHAILf1nE9VH0kF0MYCLaRxx56a/3BufMB3BgszWNRIZP2MRC IttZHe/RPJaEpizF/WngiFKibnEpw5ZHG1u6iTDsg+WLpYKjN1eIq37fG3Y5FoqeXBvW KBCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=F4iwvphbASc3NV0/QAmXibP3kcARccPZPIXDSIOmuHg=; b=V+1GPOk7z3Vr6HGkNEwDFhoWmpW9ITOKlsCmH/wCsc82K1M1PiWT6z6NhECvdMKpyI PnFvHa2sXGLWeQL0Pr21dl8c2YcdC1k311DkEwKvZcMhN4anJ4Eicc9gvjdSv8LzJ7dX i1dl+lvFK53Yh0gQN+aC284VjC/LYStQhUTCEKKsJ0c63iUTS3yosTUVofdXH5yQLjDV 0bVUVcifz8hhij62kJANWL2DZmJv5qtku4FTapwc0fcabBVZvJtMO9g+90aGEDHtLZbB nj+LWSMPBWegBpXkmS7nYfS+gYu6LXfogEtxol9lq54veiyklKr6/xOyMnP2Xv8eIOnn lYhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q19si3655544otk.11.2020.04.09.05.05.21; Thu, 09 Apr 2020 05:05:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbgDIMEd (ORCPT + 99 others); Thu, 9 Apr 2020 08:04:33 -0400 Received: from foss.arm.com ([217.140.110.172]:49364 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725971AbgDIMEd (ORCPT ); Thu, 9 Apr 2020 08:04:33 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 33B1830E; Thu, 9 Apr 2020 05:04:33 -0700 (PDT) Received: from [192.168.1.172] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0F8FD3F73D; Thu, 9 Apr 2020 05:04:31 -0700 (PDT) Subject: Re: [PATCH v2 5/6] arm64/vdso: Restrict splitting VVAR VMA To: Andrei Vagin Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Dmitry Safonov References: <20200225073731.465270-1-avagin@gmail.com> <20200225073731.465270-6-avagin@gmail.com> From: Vincenzo Frascino Message-ID: <31a0e784-7d38-b9aa-d84c-8deb6436b647@arm.com> Date: Thu, 9 Apr 2020 13:05:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200225073731.465270-6-avagin@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/25/20 7:37 AM, Andrei Vagin wrote: > Forbid splitting VVAR VMA resulting in a stricter ABI and reducing the > amount of corner-cases to consider while working further on VDSO time > namespace support. > > As the offset from timens to VVAR page is computed compile-time, the pages > in VVAR should stay together and not being partically mremap()'ed. > > Signed-off-by: Andrei Vagin Reviewed-by: Vincenzo Frascino > --- > arch/arm64/kernel/vdso.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c > index fb32c6f76078..c003f7ee383a 100644 > --- a/arch/arm64/kernel/vdso.c > +++ b/arch/arm64/kernel/vdso.c > @@ -235,6 +235,17 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm, > return vmf_insert_pfn(vma, vmf->address, pfn); > } > > +static int vvar_mremap(const struct vm_special_mapping *sm, > + struct vm_area_struct *new_vma) > +{ > + unsigned long new_size = new_vma->vm_end - new_vma->vm_start; > + > + if (new_size != VVAR_NR_PAGES * PAGE_SIZE) > + return -EINVAL; > + > + return 0; > +} > + > static int __setup_additional_pages(enum arch_vdso_type arch_index, > struct mm_struct *mm, > struct linux_binprm *bprm, > @@ -315,6 +326,7 @@ static struct vm_special_mapping aarch32_vdso_spec[C_PAGES] = { > { > .name = "[vvar]", > .fault = vvar_fault, > + .mremap = vvar_mremap, > }, > { > .name = "[vdso]", > @@ -497,6 +509,7 @@ static struct vm_special_mapping vdso_spec[A_PAGES] __ro_after_init = { > { > .name = "[vvar]", > .fault = vvar_fault, > + .mremap = vvar_mremap, > }, > { > .name = "[vdso]", > -- Regards, Vincenzo