From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3010FC2BA2B for ; Thu, 9 Apr 2020 12:04:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F257E20753 for ; Thu, 9 Apr 2020 12:04:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbgDIMEd (ORCPT ); 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85D51C2BA2B for ; Thu, 9 Apr 2020 12:04:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5475020753 for ; Thu, 9 Apr 2020 12:04:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="icAKio8E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5475020753 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZFe5PVcEzZNv0wXEyFsp9dJD8z2OqnaJC2QzvC/9wCM=; b=icAKio8EV1Cg4m iI9pXyFFZ0QZfVyeXXkyJdmsYbtP4/x5lGLJPMSg4Ycz892KONVkra8jn7CP4k6+C36Fyx16xL2aI X22C0NP/x3hs6ZHueBBKH2Ae7tB3/MJE4nTEFiXH8WOkTiq0GcSU52cOeoegQCExwg0AYnm3bcS3M zsCu9vMrDBmNKvITlcwcNvhTAwnBgFv1DO/5m/OD5gGfD9d/ZggBJcb712dO+WzSpD+LG1GUu5DNT KzJEkottTACcnrJRo3Txr5I+LDnAhjDDFqxcFTcszKM/LmdcnEupjJKoY/pGAXqmFn1gv28anjQVj oXlWrVEhUmum0cRHpWyA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jMVvB-00073m-6M; Thu, 09 Apr 2020 12:04:37 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jMVv7-00073G-Tn for linux-arm-kernel@lists.infradead.org; Thu, 09 Apr 2020 12:04:35 +0000 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 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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200409_050434_003446_8381377A X-CRM114-Status: GOOD ( 18.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dmitry Safonov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel