Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1184677ybl; Wed, 14 Aug 2019 12:10:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzE4jqE1kpl5sOaNCU7ME8zu5DRiVMbgA0RYsg3pLAIl3xSZEW0kKIFw7BRbt5cKj+OkZYs X-Received: by 2002:a63:1765:: with SMTP id 37mr541270pgx.447.1565809826782; Wed, 14 Aug 2019 12:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565809826; cv=none; d=google.com; s=arc-20160816; b=t6utY9vWK2zTuhWvMDdhyR3rsgbMKZ40jr29hlYilmMGX58hujxPTBlDCkpiVx63xi Fvek3dL2d023OIJcjV31905qOm5lOF85O/Fo6wuMQEfxyJsa6+nZsU5TefrjWQkKfmWI bZ7ip0G8zdm0A4jlauwzA4lsj6+6qSZSF1REQEOJHCHwdTtxnGp6/NkvyFnNPEh63tWK ImEkAgzTTYyfRjVOoVH1jWX9Eb5N2e+YdAmk3hsymXDglH8RKmPmGWrQEEw3/cTL89Rz fSM1h7Ui9iZHBouSjMtlZk8H+ik7o75AelmTiTzI+onAR+sJKjhejMf3JgWD6OKAlRkl U82Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=fgFFBrhVtUGKZZbJJolYXsdk6eeUI4H6Yby6s8HsxXA=; b=V0jTHa/r4hG+KTxGnto2rlyKLiJ5z4MFXJtjKnFLNZw4QnUObWrPrVt/cQp6B10B45 rWDK6gPRPWMbV9nlwCWwu49K0mhybCfBZA+BsQyipCU1SdVcWZKylZIcE6CSXZtIJr5K cXewp1FPTwVhi1q1gHKqW65un5999e/B9yf0eLnq6SzMDbZXXVuaUypYGrzqhRTro0At OMdWD3tXcOXQZ3vmScOFegjG+wLOpfqO0/sWuKnPlUKy81b/bJYYdeogYIhdROr9FtiL NFg5PD/Yg7KgqPz9j1Pbjv9L3c/5TREMc+0R3N/KYHS8v074s8UlOfKzYnjwMBygkziq 3n7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dkSN2Tr8; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si370992pjp.54.2019.08.14.12.10.10; Wed, 14 Aug 2019 12:10: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dkSN2Tr8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728394AbfHNS7x (ORCPT + 99 others); Wed, 14 Aug 2019 14:59:53 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:45031 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbfHNS7w (ORCPT ); Wed, 14 Aug 2019 14:59:52 -0400 Received: by mail-qt1-f194.google.com with SMTP id 44so80250425qtg.11 for ; Wed, 14 Aug 2019 11:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fgFFBrhVtUGKZZbJJolYXsdk6eeUI4H6Yby6s8HsxXA=; b=dkSN2Tr8QitHw/33jCiZhBgFHzbyCTcbfGRIRgnv+neWx9O0HTr2DeIxljWIqJD3Fn qGF+8ImOPJQe/JjAqEvQO7d2739TqHbimcDrXcrqOeFk+MJSem0d6oy6qjB5UJdIjJB/ DNbfYEomOItz26Ame4+Y2h/vA462XSGBZUc2t5qtzlQ/Kn3HVrABoqHV+MdsUrt673lr gQ/NcUiQhqCmElCYRZpcxgyPvqz1cSfGPWm09/2CMA8Vw4xF60XkMA7OUr9ZLcACP7b/ pnKASmC4Z2xsW5L9Hb33tGOqSmRwusJZZltflF6HC9fTM7NNmb3ZP6xvabrjn6PWoKzl WC/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fgFFBrhVtUGKZZbJJolYXsdk6eeUI4H6Yby6s8HsxXA=; b=iKe3vjtA0r/u2eC2uhrhHm673+iJPVBx3rbEC6aCF0ZwBwQjExmdx+VCAksGpUJDam NZCRYF7bsMrdbl7qJp5f+++C7Xx+zo/afavjACe8eOLw89NvtOSbZNzyT7w9bW4AygZK DCu1TR/+zxauRxkyWub7ZazKb4Br9UyomExSup1TQpEVxfj+kotoBSTT9wwFtoF1tNML 03pr56zhZFEQ7ZZY752Him36tyjYQVLgVRlfSyQvXjUwf7BayP5q78sGxutvfhQhr/IW Wa1CQUAfyx4VAHpeHhmsJ62S/Xd6VPcomtdp/9K2Z1umbqRILkKh0OV8uNO6BwkkacUB NRXg== X-Gm-Message-State: APjAAAVbRw60d11ZL2dcp+VIuuW2Il4bmIaaqXL1HwFWP+81pQvUUtjX YkLlKLtmyS+cIR61vgeseYk= X-Received: by 2002:ac8:46cc:: with SMTP id h12mr831669qto.234.1565809191487; Wed, 14 Aug 2019 11:59:51 -0700 (PDT) Received: from quaco.ghostprotocols.net ([177.195.212.110]) by smtp.gmail.com with ESMTPSA id j50sm341755qtj.30.2019.08.14.11.59.50 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 14 Aug 2019 11:59:51 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 9170840857; Wed, 14 Aug 2019 15:52:13 -0300 (-03) Date: Wed, 14 Aug 2019 15:52:13 -0300 To: Mathieu Poirier Cc: Igor Lubashev , Linux Kernel Mailing List , Jiri Olsa , Alexey Budankov , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Namhyung Kim , Suzuki K Poulose , linux-arm-kernel , James Morris Subject: Re: [PATCH v3 3/4] perf: Use CAP_SYSLOG with kptr_restrict checks Message-ID: <20190814185213.GN9280@kernel.org> References: <291d2cda6ee75b4cd4c9ce717c177db18bf03a31.1565188228.git.ilubashe@akamai.com> <20190814184814.GM9280@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190814184814.GM9280@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Aug 14, 2019 at 03:48:14PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Wed, Aug 14, 2019 at 12:04:33PM -0600, Mathieu Poirier escreveu: > > # echo 0 > /proc/sys/kernel/kptr_restrict > > # ./tools/perf/perf record -e instructions:k uname > > perf: Segmentation fault > > Obtained 10 stack frames. > > ./tools/perf/perf(sighandler_dump_stack+0x44) [0x55af9e5da5d4] > > /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7fd31efb6f20] > > ./tools/perf/perf(perf_event__synthesize_kernel_mmap+0xa7) [0x55af9e590337] > > ./tools/perf/perf(+0x1cf5be) [0x55af9e50c5be] > > ./tools/perf/perf(cmd_record+0x1022) [0x55af9e50dff2] > > ./tools/perf/perf(+0x23f98d) [0x55af9e57c98d] > > ./tools/perf/perf(+0x23fc9e) [0x55af9e57cc9e] > > ./tools/perf/perf(main+0x369) [0x55af9e4f6bc9] > > /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7fd31ef99b97] > > ./tools/perf/perf(_start+0x2a) [0x55af9e4f704a] > > Segmentation fault > > > > I can reproduce this on both x86 and ARM64. > > I don't see this with these two csets removed: > > 7ff5b5911144 perf symbols: Use CAP_SYSLOG with kptr_restrict checks > d7604b66102e perf tools: Use CAP_SYS_ADMIN with perf_event_paranoid checks > > Which were the ones I guessed were related to the problem you reported, > so they are out of my ongoing perf/core pull request to Ingo/Thomas, now > trying with these applied and your instructions... Can't repro: [root@quaco ~]# cat /proc/sys/kernel/kptr_restrict 0 [root@quaco ~]# perf record -e instructions:k uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.024 MB perf.data (1 samples) ] [root@quaco ~]# echo 1 > /proc/sys/kernel/kptr_restrict [root@quaco ~]# perf record -e instructions:k uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.024 MB perf.data (1 samples) ] [root@quaco ~]# echo 0 > /proc/sys/kernel/kptr_restrict [root@quaco ~]# perf record -e instructions:k uname Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.024 MB perf.data (1 samples) ] [root@quaco ~]# [acme@quaco perf]$ git log --oneline --author Lubashev tools/ 7ff5b5911144 (HEAD -> perf/cap, acme.korg/tmp.perf/cap, acme.korg/perf/cap) perf symbols: Use CAP_SYSLOG with kptr_restrict checks d7604b66102e perf tools: Use CAP_SYS_ADMIN with perf_event_paranoid checks c766f3df635d perf ftrace: Use CAP_SYS_ADMIN instead of euid==0 c22e150e3afa perf tools: Add helpers to use capabilities if present 74d5f3d06f70 tools build: Add capability-related feature detection perf version 5.3.rc4.g7ff5b5911144 [acme@quaco perf]$ - Arnaldo