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=-6.8 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 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 C3335C433DF for ; Fri, 19 Jun 2020 15:38:25 +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 7D3EC20B80 for ; Fri, 19 Jun 2020 15:38:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tkgP6aWj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D3EC20B80 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ubuntu.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:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=StLo5rz2OYOGBraIk2fYCPFL+OGsIeSfiX8HVuPCPHw=; b=tkgP6aWjh46srJ pwFWZhAZyONE4+DSsnGAqXauMsJhQjXJGDiPSnYceUY9UZSm0UOZJ5Zm5qUqAUhZcj9DU8yP7RbRo oiT9XIuD4SeWxLlH6TRcvDqJGlTE5Lkztm3IlAcxrXz9UmwoE7fLZHSIOVIrqB5ilxYIBvsJNPJ3K bBJ8qv5qO6DuGZbqoVbZuvVJip6Leo/t4Q1NRsjPha5Ke4wrDwf3vpqhmcQvWpHezVpE0ur9uMYky QjmNUxAtoSPiZblEsEg2tPqYGEYZDXP4QyN475E1osXL+3vRczNMUsh7xq4juSd3YHrcpQzlPNN7e 0boWLSgOEsDjgHEa8qtQ==; 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 1jmJ5v-0004G4-Mx; Fri, 19 Jun 2020 15:38:19 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jmJ5t-0004FG-2S for linux-arm-kernel@lists.infradead.org; Fri, 19 Jun 2020 15:38:18 +0000 Received: from ip-109-41-0-196.web.vodafone.de ([109.41.0.196] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jmJ5r-0000km-CT; Fri, 19 Jun 2020 15:38:15 +0000 Date: Fri, 19 Jun 2020 17:38:12 +0200 From: Christian Brauner To: Andrei Vagin Subject: Re: [PATCH 2/6] arm64/vdso: Zap vvar pages when switching to a time namespace Message-ID: <20200619153812.2d6anaynb4p37qv2@wittgenstein> References: <20200616075545.312684-1-avagin@gmail.com> <20200616075545.312684-3-avagin@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200616075545.312684-3-avagin@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200619_083817_243289_C8787BF1 X-CRM114-Status: GOOD ( 16.82 ) 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: Mark Rutland , Dmitry Safonov , Catalin Marinas , linux-kernel@vger.kernel.org, Thomas Gleixner , Vincenzo Frascino , Will Deacon , linux-arm-kernel@lists.infradead.org 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 Tue, Jun 16, 2020 at 12:55:41AM -0700, Andrei Vagin wrote: > The VVAR page layout depends on whether a task belongs to the root or > non-root time namespace. Whenever a task changes its namespace, the VVAR > page tables are cleared and then they will be re-faulted with a > corresponding layout. > > Reviewed-by: Vincenzo Frascino > Reviewed-by: Dmitry Safonov > Signed-off-by: Andrei Vagin > --- > arch/arm64/kernel/vdso.c | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c > index b0aec4e8c9b4..df4bb736d28a 100644 > --- a/arch/arm64/kernel/vdso.c > +++ b/arch/arm64/kernel/vdso.c > @@ -125,6 +125,38 @@ static int __vdso_init(enum vdso_abi abi) > return 0; > } > > +#ifdef CONFIG_TIME_NS > +/* > + * The vvar page layout depends on whether a task belongs to the root or > + * non-root time namespace. Whenever a task changes its namespace, the VVAR > + * page tables are cleared and then they will re-faulted with a > + * corresponding layout. > + * See also the comment near timens_setup_vdso_data() for details. > + */ > +int vdso_join_timens(struct task_struct *task, struct time_namespace *ns) > +{ > + struct mm_struct *mm = task->mm; > + struct vm_area_struct *vma; > + > + if (mmap_write_lock_killable(mm)) > + return -EINTR; Hey, Just a heads-up I'm about to plumb CLONE_NEWTIME support into setns() which would mean that vdso_join_timens() ould not be allowed to fail anymore to make it easy to switch to multiple namespaces atomically. So this would probably need to be changed to mmap_write_lock() which I've already brought up upstream: https://lore.kernel.org/lkml/20200611110221.pgd3r5qkjrjmfqa2@wittgenstein/ (Assuming that people agree. I just sent the series and most people here are Cced.) Thanks! Christian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel