Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1434651imm; Fri, 15 Jun 2018 17:57:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJYD3RJpPcRY7qZGCYdERxP3BI+BXPHBtfTiktIR8RucKSYLdoN2Po7k0/KffJgRrpYH63p X-Received: by 2002:a65:4348:: with SMTP id k8-v6mr3588640pgq.341.1529110672065; Fri, 15 Jun 2018 17:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529110672; cv=none; d=google.com; s=arc-20160816; b=TmdV7u7hA3c6j6SThL/jKD4um/vYlowPG4E0b82hGpRhgngG+uukLg3NaXVoTjCa2Y NNw7sdEjr8S31fDk/vLu5Kt0SZDI/Ct4jn0iE84hKtDl5qpho6+1DIW+BoGcCelkoDs1 jLfl01pkTAchBo1YGP8fMFcG9K8KYvUL9pmjCsw2b2WHAvhuslxVw5jxVLJOQiVLDtDK z78WYyy3LpCf4Qn++TsWy4mxjBtMyEmRerLrml9qSMx1F4bkTspOZw8tfrRyeKSInTdC TfRIjSczZ8pwajjIE+pF56vutcVkxzBy+nIGeLiY86p7AhM+T8PM10WXQsWL+pqfI2D2 S1Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=NKhvtpJ6iO/c8QqDFdx+TkrAWfegvUX5ktQ84DfjVJI=; b=QpOO47baR3sdFHTQ9o+DNMQ/OBXpbEde4z5XCxJ/sgIsIrftN6ztvDbiBodOwbFyuH L1J18Tlif47ce5R8sMSj2Qe9FmiYs04iGlHrHXHrdTQHWR5aRpeCme2DM1B++l51Hw6O g8Bowe/b2qILJUlRXPVb2Hsrv/8lHZm9UzuYVjEHOeEKrSZyOcEscTcqjQ5dc4j2IBoY IIc5UL2C3VmWEs0h/47I23NUtBQubaNnsVQG7rAEmwySZYQvqplu1Fm2rh79zeSk8No+ 0q30yrtfepaJ8ntjyPSlhopn8RDiQgX4WgzbsspF/77gRGMmED9drBTPK7CPXPdI/eIT LvdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kylehuey.com header.s=google header.b=NJKwfQgK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9-v6si9722553pfk.46.2018.06.15.17.57.37; Fri, 15 Jun 2018 17:57:52 -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=@kylehuey.com header.s=google header.b=NJKwfQgK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936530AbeFPA4u (ORCPT + 99 others); Fri, 15 Jun 2018 20:56:50 -0400 Received: from mail-vk0-f68.google.com ([209.85.213.68]:39802 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936470AbeFPA4t (ORCPT ); Fri, 15 Jun 2018 20:56:49 -0400 Received: by mail-vk0-f68.google.com with SMTP id r83-v6so6665825vkf.6 for ; Fri, 15 Jun 2018 17:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kylehuey.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NKhvtpJ6iO/c8QqDFdx+TkrAWfegvUX5ktQ84DfjVJI=; b=NJKwfQgKeMXA069zDat3nY2CBLN6QePjJ8vML4C5N0kX4AwPExazUDNTrL8nDeqv5r io2V8Xy6qBNs9/vNmuSdDz4kCOPlxL+wHMd4JBsGQamZM/yt0x9asS7K2jlvLEUTJcnM uhw3cm7XSe55Jq/rhfNEupATX+glYoGtyZktoEhhkEJsK8SZimpHV9wCDpYO9Zp+dGMb s4OXnvsYqw/DnRlO8uTsN4AH++/al3TRCW2HfHjf4dzoMep21rdfak0o492gbVKQbwEi mIurnTnpcjt6rZGqPiqITsoE5EWLv5Ki3r85bRtna9P7FSffdOvYlHlh0bAG3QmC8SbX udQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NKhvtpJ6iO/c8QqDFdx+TkrAWfegvUX5ktQ84DfjVJI=; b=g07XdJSPPczGHSF68zCUcWYsXL/qqqXd3cJvIwMvxyy1eIuDgU8PX4WsxYaZ86jaf+ Gy2yLYgNrm/LbYIRzCXBGIY7DDLg0icCxZlbCpdQrgh05RCf/bkZd5Mj41yC6SCND3is NobnNFEKkKQLaZe/z996BwzyCagW3N3Z36zb2h00cp6M5ugEAwvZ6HZ3MEoCFM7pd8+7 fbfUd7LTf/7neIoBqWQLtwiBAGLxw77s94Ocox2eOGx0i3XRxAFWEuEC3h0ueBya5+++ UohGE600BQGZJrNdtA9MJJQjR7gmzlKMapTPvvkKxwNRIlH3YuXqqDfKfVAL7IWd493i K0ZA== X-Gm-Message-State: APt69E1HCie29q4gvpIulmYzWtodvHg3KgKInMQcPzzXZgYf5hgVWy3y cJ2SFcbZXivLMTm8mWjPX1xcCtywIvuR5Pa3ZctuDg== X-Received: by 2002:a1f:58c:: with SMTP id 134-v6mr2288784vkf.55.1529110608875; Fri, 15 Jun 2018 17:56:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:11c9:0:0:0:0:0 with HTTP; Fri, 15 Jun 2018 17:56:48 -0700 (PDT) In-Reply-To: <9b3259e8-1d07-adb1-a57c-8b276c133aa6@linux.intel.com> References: <1529057003-2212-1-git-send-email-yao.jin@linux.intel.com> <1a442b37-7a97-86f0-11e3-58d940ecfbc9@linux.intel.com> <9b3259e8-1d07-adb1-a57c-8b276c133aa6@linux.intel.com> From: Kyle Huey Date: Fri, 15 Jun 2018 17:56:48 -0700 Message-ID: Subject: Re: [PATCH v1 0/2] perf: Drop leaked kernel samples To: "Jin, Yao" Cc: "Robert O'Callahan" , acme@kernel.org, jolsa@kernel.org, "Peter Zijlstra (Intel)" , Ingo Molnar , Alexander Shishkin , open list , Vince Weaver , Will Deacon , Stephane Eranian , Namhyung Kim , ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 15, 2018 at 5:50 PM, Jin, Yao wrote: > Hi All, > > This patch raised many questions, I was prepared. :) > > I'd like to try another proposal that it adds a special flag in the returned > perf_sample_data to indicate the perf binary that this sample is a leaked > sample. > > For example, create a new PERF_SAMPLE_RETURN_LEAKAGE in > perf_event_sample_format. > > In perf_prepare_sample(), > > if (event->attr.exclude_kernel && !user_mode(regs)) > data->type |= PERF_SAMPLE_RETURN_LEAKAGE; > > Now all the samples are kept and the leaked kernel samples are tagged with > PERF_SAMPLE_RETURN_LEAKAGE. > > In perf binary, it filters out the samples with PERF_SAMPLE_RETURN_LEAKAGE. > It needs perf binary modification but rr doesn't need to be changed. > > I don't 0-stuffing some fields because: > > 1. Keeping the skid info should allow us to look at that if we have > interesting later. > > 2. Not sure if 0-stuffing some fields has potential conflicts with some > applications. > > Is this proposal reasonable? > > Thanks > Jin Yao > > > On 6/16/2018 1:34 AM, Robert O'Callahan wrote: >> >> On Fri, Jun 15, 2018 at 10:16 AM, Kyle Huey wrote: >>> >>> >>> If you want a sysctl for your own reasons that's fine. But we don't >>> want a sysctl. We want to work without any further configuration. >> >> >> Also toggling a sysctl would require root privileges, but rr does not >> currently need to run as root. Thus rr users would have to either >> permanently change their system configuration (and every extra >> configuration step is a pain), or run rr as root so rr can toggle the >> sysctl itself. Running rr as root is highly undesirable. >> >> Rob >> > If the problem you're trying to fix is an inappropriate disclosure of kernel-space information to user-space, how does filtering the samples in user space solve anything? - Kyle