Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2603991ybp; Thu, 10 Oct 2019 09:45:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvRDtuFxnOqO7Oz5Fwcn1BBY/yM6G1t7SI6IbKY4M60CpKOU1YAee/om7suxy0VJYfHGY9 X-Received: by 2002:a17:906:1cd8:: with SMTP id i24mr8902486ejh.149.1570725903617; Thu, 10 Oct 2019 09:45:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570725903; cv=none; d=google.com; s=arc-20160816; b=QDrBckmWoecEymR4OoHovbLl2yeWeMEjkSnSiwN/u4ACX4SP6uy/qZB+sp0gwafKb5 /n4nr1w70enguvTIWcBE8BpeILvOfV6XAuRMDbl/g0DoCcNtJynoKhaqFgYF3eQ3MLsC Y0HFVs6J4ZMhQpV7MV2qXoq6usGSV4SJJUuCAQoeIc+2IvPo99P1fE1esYlUvPx6wyol LfrFZj2UKsFy06eDhdbC3nyn++Zkka37TUuQUbY/KFgcKxEoXMGHaaY15vYW5LSRDF56 0Mvtr2EOGFvFCYF1hgnUiaWf4X/+EqmAfav6r8u+97ESZ/7ER8qpnbXq2AGEcr8e54MO dABw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=WcFO8qPZ/AFTCPgcIosbPBf6WzJZhu5LC0txwMdDqq0=; b=phtO4+aMuIoYbE3ozPERyxFW38snEM8EzcY2IKoECDo0Q6pwFO7BVjg/TxmTl3ck2Z Fd8kJzdcTwMQQaLaI75fFG8+DSTKYpKYbp02dpo+NXTjaXB3dC4qybDH8W6mDqpEseOX o9WoY6imt8/U44sC+C4ZdnO1h4YFtt9A1p3Q5aOL2UG3o7KTEb9q7Oa3CyO/wnaYUTCn nKEBrxmQOQxE+uYadxjj69EEDWMpuOXsPwk9c2KRga765IzJCDiCLmjrQfZbE97V79k2 QjqteXV+SyaxNkqwSgtjoyittUkqI8Jbnii6HKPaKvQZ0S8A9pZDRnR13dAOy8GJcBZo OpvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mHXoFaiW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14si3535401eju.69.2019.10.10.09.44.38; Thu, 10 Oct 2019 09:45:03 -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; dkim=pass header.i=@chromium.org header.s=google header.b=mHXoFaiW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726373AbfJJQn3 (ORCPT + 99 others); Thu, 10 Oct 2019 12:43:29 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40218 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726290AbfJJQn3 (ORCPT ); Thu, 10 Oct 2019 12:43:29 -0400 Received: by mail-pf1-f194.google.com with SMTP id x127so4256857pfb.7 for ; Thu, 10 Oct 2019 09:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=WcFO8qPZ/AFTCPgcIosbPBf6WzJZhu5LC0txwMdDqq0=; b=mHXoFaiWr2KtDyo6AUfULISKrSL60dcxTqzjwiK6Uaub6ukWcxzvR35aRbJ/vlu4UK btOqmAHm7PlUoeM5gAlSvg067gi9jVrpkKoXlKtP6V0vU2ST37HIbIHFg92Bf8qEYVHH +sfpnRnP7n2dw4DiSrshnBTPiQgOvR4ZRzhEw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WcFO8qPZ/AFTCPgcIosbPBf6WzJZhu5LC0txwMdDqq0=; b=CKP9q1YEGDkxm3tQgkDMWyMAiL4bTM0qGorHa+GZm5FQpO74G6zlZdR+UwNR44Inja dVfnzvWG/BmIWEoz06fSFVOWw5+xndbnuIXu9kuRfQPbroF91JlDADa3vq49HhhYXojm K3Jin8fDGOsndKSUEJ84Rw94o1AumlC3BpjQKcQ+Gv+AgRZoUcyTzJ8ORd1I+ACWoagg wq4DohyzXjfr1ff/Q/9JKSVmrn+YVXXxzY373G+B326nkgjaNeWLyBKz7ZchhVfVF6Qx OJN/2av7lku3GyftDfP9+SRcWnYqQd0d4CgVzWQie0HxSpKSeQ7FrpjU2iNySfdyUee6 WsXA== X-Gm-Message-State: APjAAAUH9Qa7Y74zFw9FdDOhhICIcNyW7WcsqHMQ/PPBVTpV0Pndbjyj xWL0Pl/j6w4mDnE3ZAzbhEvRfA== X-Received: by 2002:a62:ed01:: with SMTP id u1mr11730140pfh.122.1570725808519; Thu, 10 Oct 2019 09:43:28 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l62sm8332515pfl.167.2019.10.10.09.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 09:43:27 -0700 (PDT) Date: Thu, 10 Oct 2019 09:43:26 -0700 From: Kees Cook To: Aleksa Sarai Cc: Michael Ellerman , Ingo Molnar , Peter Zijlstra , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Christian Brauner , Rasmus Villemoes , Al Viro , Linus Torvalds , libc-alpha@sourceware.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/4] lib: introduce copy_struct_from_user() helper Message-ID: <201910100943.4C6AB66@keescook> References: <20191001011055.19283-1-cyphar@cyphar.com> <20191001011055.19283-2-cyphar@cyphar.com> <87eezkx2y7.fsf@mpe.ellerman.id.au> <20191010114007.o3bygjf4jlfk242e@yavin.dot.cyphar.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191010114007.o3bygjf4jlfk242e@yavin.dot.cyphar.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 10, 2019 at 10:40:07PM +1100, Aleksa Sarai wrote: > Yeah, it takes about 5-10s on my laptop. We could switch it to just > everything within a 4K block, but the main reason for testing with > 2*PAGE_SIZE is to make sure that check_nonzero_user() works across page > boundaries. Though we could only do check_nonzero_user() in the region > of the page boundary (maybe i E (PAGE_SIZE-512,PAGE_SIZE+512]?) Yeah, I like this idea: just poke at the specific edge-case. -- Kees Cook