Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4919796imm; Tue, 26 Jun 2018 02:53:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJWGC0+cxE6BdxFYVXRx25/9lCbRtMKsSTA59SK9rf/Ql+4H+bKutYTL2HfT/M4Vd3v/KFG X-Received: by 2002:a63:af49:: with SMTP id s9-v6mr751028pgo.49.1530006806869; Tue, 26 Jun 2018 02:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530006806; cv=none; d=google.com; s=arc-20160816; b=Tavb/yIiAkrhS1XSDnpolVuEJ7hs3alY0K8ObdAciG5HDlcrIoZ7Iqrqx+qi1f2Pnw +FYc6ipfjZsWDNb5OLY3BLSaL4H0x888SsGgwWic5zNd20dAjosYgeq8HTXzwvZRAYLQ SyHtB/v/MhVF8bcH+2ufwOsO4r4k8liBzpagNNt17eNuquKSOC3beAW10kIBuN/3ShQw 0J2Go3D3QJhvy1N842Xkha7JxB0z+yyIw+ifd11Z1ZOEBlxiOCDfJZo33BPDua+9sre9 LN75VxBmsycOKC5Roy8lj2wklsF6ErTBNJAlaDy70jWKewcEMosxdwCd2XgV6m/glUHz w6Ww== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=bviy7F3aaYnr1YddVa1clWbaHl+QGUhscjd0s1MdZjY=; b=MBobaffCI8zk9hueDcDT557oEnJxWN3+W4mmEmpw/wvg7cHWYHVbVZeZ6Nj63rNBqv C4Y/590ULCvIbnCnbRptaYaZCXNoKCP9S7D1POZn2q1A8fcKUt7ZAyt662H4ByWl619/ mIf+4+EF5qq6WMQg9g6kxDTzcznwXCqPQPepoE1cNPn7bWVpXCgHgjDfi1qMYxqhnz4J pj5LwnjLrqBaJelj839u7hYdfsbRCR5jCG7mmdc4FUndnXN2tflZyxXjYs2kRNpFKYQY BZ7KC0W3YlzpA0SF6weZopNizQNqG2BqtDlVo9NHa5U/C9Qe2IWBYw3X42AAsi/WDRWv UYUg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2-v6si1056215pge.53.2018.06.26.02.52.42; Tue, 26 Jun 2018 02:53:26 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752730AbeFZJsf (ORCPT + 99 others); Tue, 26 Jun 2018 05:48:35 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39400 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932206AbeFZJse (ORCPT ); Tue, 26 Jun 2018 05:48:34 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7FDAD40201A2; Tue, 26 Jun 2018 09:48:33 +0000 (UTC) Received: from ovpn-117-67.ams2.redhat.com (ovpn-117-67.ams2.redhat.com [10.36.117.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C7022026D6A; Tue, 26 Jun 2018 09:48:32 +0000 (UTC) Message-ID: Subject: Re: [PATCH] add param that allows bootline control of hardened usercopy From: Paolo Abeni To: crecklin@redhat.com, Kees Cook Cc: LKML , linux-mm@vger.kernel.org Date: Tue, 26 Jun 2018 11:48:31 +0200 In-Reply-To: <64bf81fa-0363-4b46-d8da-94285b592caa@redhat.com> References: <64bf81fa-0363-4b46-d8da-94285b592caa@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 26 Jun 2018 09:48:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 26 Jun 2018 09:48:33 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pabeni@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, 25 Jun 2018 11:21:38 -0700 Kees Cook wrote: > On Mon, Jun 25, 2018 at 8:08 AM, Chris von Recklinghausen > wrote: > > Enabling HARDENED_USER_COPY causes measurable regressions in the > > networking performances, up to 8% under UDP flood. > > Which function is "hot"? i.e. which copy*user() is taking up the time? > Do you have a workload that at can be used to reproduce the problem? I'm running an a small packet UDP flood using pktgen vs. an host b2b connected. On the receiver side the UDP packets are processed by a simple user space process that just read and drop them: https://github.com/netoptimizer/network-testing/blob/master/src/udp_sink.c Not very useful from a functional PoV, it helps mostly pin-pointing bottle-neck in the networking stack. When running a kernel with CONFIG_HARDENED_USERCOPY=y, I see a 5-8% regression in the receive tput, compared to the same kernel without such option. With CONFIG_HARDENED_USERCOPY=y, perf shows ~6% of CPU time spent cumulatively in __check_object_size (~4%) and __virt_addr_valid (~2%). Cheers, Paolo