Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5639097imm; Tue, 26 Jun 2018 15:09:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdLXpUqGvsxU6HAUN4UHyaXGSyJI03hYu5Il/8clhDbl4wG1W5tiJmmGTmF542sjEqDSuI4 X-Received: by 2002:a62:dc8d:: with SMTP id c13-v6mr3190079pfl.183.1530050947190; Tue, 26 Jun 2018 15:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530050947; cv=none; d=google.com; s=arc-20160816; b=aQQUF2z3SaoooAn9uvJ/qJc1zlMFoaUak14wZfX/dzW5x4TyoJX1/uUD9ugWlQ8ryx rmRgjPkCQwakpGJ51s8R5Obgx7gAhCpTqArqa6dTtuwqgloKits2x1/M/x7cufouk29y O/yXhuzdkE9e6E1wvRItK251AKXDsAP0adruYTTGM90ZZQrqf5mLbavyK2HQi/hOtTQy JEUdPVkXyQ+Ca8BVnhdwyFMrBOVUlqd/6wWs5Gjh4DLZd4E0Y2t+liskQiLj/hauiKDM J6T0kER/75SEqLIOWRC2/O2Dc9NREJ+Dabz8m3yE7aARWwnIGEtLCGRNkrX/95oep+6N AxVg== 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=t2oF+yPiSWLL9fXT24+pXNGW8sqCEZAa/0roVhE87MU=; b=0ywnGQoytpUHqOv05CyU0NK5V8o5vB5KCTT/axhh6pHic6HDOKlCWkvmyUl5A0F2dq FFnaImyg46hw7y/P82FR56URqwmVdC/fG/IakjeXmatCC31mZz8I+S4o9fmSds33Qs1M 8enXzjI6C2TgoPhli8r0Be/8IM+irtOSd7rOe6dyZx4LvkTYgUPbbOWXEyl6EKzRgHBe ngB4TwNFyH2+kGOavSX90Go8S7Kv/ldkke7mq1Q0UAoL87Gy+SmLa2dLBJIteevkeVhO w4Ux8rJQ0AzR8tdbBKugA/M6MOn4mkdGlx8ImlBfCTgqizaTS9nJRBwQNc17RWka0ikn a42A== 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 z18-v6si2009769pgu.692.2018.06.26.15.08.52; Tue, 26 Jun 2018 15:09:07 -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 S933282AbeFZROv (ORCPT + 99 others); Tue, 26 Jun 2018 13:14:51 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57814 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932150AbeFZROu (ORCPT ); Tue, 26 Jun 2018 13:14:50 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D300981A4EA4; Tue, 26 Jun 2018 17:14:49 +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 ABEF821565E1; Tue, 26 Jun 2018 17:14:48 +0000 (UTC) Message-ID: Subject: Re: [PATCH] add param that allows bootline control of hardened usercopy From: Paolo Abeni To: Kees Cook Cc: Chris von Recklinghausen , LKML , linux-mm@kvack.org Date: Tue, 26 Jun 2018 19:14:47 +0200 In-Reply-To: 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.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 26 Jun 2018 17:14:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 26 Jun 2018 17:14:49 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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 [hopefully fixed the 'mm' recipient] On Tue, 2018-06-26 at 09:54 -0700, Kees Cook wrote: > On Tue, Jun 26, 2018 at 2:48 AM, Paolo Abeni wrote: > > With CONFIG_HARDENED_USERCOPY=y, perf shows ~6% of CPU time spent > > cumulatively in __check_object_size (~4%) and __virt_addr_valid (~2%). > > Are you able to see which network functions are making the > __check_object_size() calls? The call-chain is: __GI___libc_recvfrom entry_SYSCALL_64_after_hwframe do_syscall_64 __x64_sys_recvfrom __sys_recvfrom inet_recvmsg udp_recvmsg __check_object_size udp_recvmsg() actually calls copy_to_iter() (inlined) and the latters calls check_copy_size() (again, inlined). Cheers, Paolo