Received: by 10.192.165.156 with SMTP id m28csp1659149imm; Thu, 12 Apr 2018 00:56:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx49TrmSFP1ziCbAnMQSZd+vbL9f3/RMkhuOuE5dsOKeSugrJxVaVSGfdf6/Jv18V33LqbGTy X-Received: by 2002:a17:902:be18:: with SMTP id r24-v6mr8606487pls.275.1523519791096; Thu, 12 Apr 2018 00:56:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523519791; cv=none; d=google.com; s=arc-20160816; b=XSmgcRn85okU9yfUc/6dafP+4O6PDASaODDO3ZHghXJap6agPmJJrvTvYjBFYUM7ab 2PpKC5ncp5bFzVH1rxWnGKVu4lsFv6ki2WWc6EUIiy20TuhRs8zhjs1ZCgu8KOEqp27M HwKP/jTx8CznHmS48AE8YfTl8QBdJjW3f/d8dPaP6vXCCEEg6k31O5Az9oxheDFcK3dE bvVtR36I+0HyLfOaC7S1KbPuGutVl0cWF4LzhiVw7HJCbHOGHtPRjubp1MChbaKYauS4 UpROxW4sngytww8C1spjMVXBLUePGDCXywIwc1GhgbSC2KG3zHqsfT68h5rf1TAddU0l zsTQ== 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:from:date:dkim-signature:arc-authentication-results; bh=froBbf5x58vpYCtOZH7lcRN0TUTGuNcIhoPfBkYXbgc=; b=wMnApbnkfCNejo7ryCWtxTtklu/2BXSHKKG3DzEyEnD5Hm0Zc7s4YFAXAXvmTnyCft c63u03oFEsWJE+isnDU6/FEPvBufEIsNUKZW34eYA0WDBcwZ8jL/CVXvau/SLGNbYEPn YeHwrjVSVKy+4SeVNEjuroXChbimrBwwJHDzEXpjNchwqf9hKMLVLiocM7MXR6RpSu9f wQVg7gAcWL+aS5vVm8jsmHy0f/xv0BrxR3XYa5hwkQy7kmbhTdfXAANmGCNknKG4xi3z QtCNpunUFcI7qxywxt9vO76prVs1HYGZSOTp5/FBy9SRmUyhWJYfNQpbXEu5yexzkkl1 6zzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=t7eady5L; 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 v12si2078668pff.119.2018.04.12.00.55.54; Thu, 12 Apr 2018 00:56:31 -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=fail header.i=@gmail.com header.s=20161025 header.b=t7eady5L; 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 S1752598AbeDLHwZ (ORCPT + 99 others); Thu, 12 Apr 2018 03:52:25 -0400 Received: from mail-wr0-f174.google.com ([209.85.128.174]:37360 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751759AbeDLHwY (ORCPT ); Thu, 12 Apr 2018 03:52:24 -0400 Received: by mail-wr0-f174.google.com with SMTP id l49so4107688wrl.4 for ; Thu, 12 Apr 2018 00:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=froBbf5x58vpYCtOZH7lcRN0TUTGuNcIhoPfBkYXbgc=; b=t7eady5LWjxQaDpaXAj1GDomDFBidEgF30btNMNs9uVmNl51klpCc6ekr1DCdKlvld dwEQ2NQIc68OKjljVkiF93SgfZmsjcL3Qd1mkXB00N2W7m0ODdZarTuknHRorU/VkzFF vQkVkLfwWlOc8AthKlWcp75sH/LRvq60qDGyoAIuzK6Zh70uWoUYq9RtW07iSRIOn2Kf perx4YHLivSDEZ0y8WvE9H39iRlc8Uif31E/xWL7WpS6MB7OPwr0y0DmlAuq7p68ABp+ st4o1vekeuWc0QuZicjy1OLRU0DJC6u0Esl1ajBKFiZmxC+yGTf51mUJgtRggh33Fsxl wamQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=froBbf5x58vpYCtOZH7lcRN0TUTGuNcIhoPfBkYXbgc=; b=Y9JA5IpaUHw4XDglsIYUuwNyO/rCObPiW5bP6lqhI9b6gZ0G/d8eLJW9aitsxf9UpU 8iW+yAsRPmjE+mwONe8UYHbrQZL/sh9j2iaHasrHsA4ketvbnDVZsPA31h7KfOVPD/vh D7PkAKYwFBGFZ0XRZLhoqbpRirvl+rEYZJDzFKs15luDNh63/JsMaK/YP0tKRn+012UN uiQFzjCW3GSO1qx0HuA70qxKcfiJpjLU+x+at0y9OARYUvn0lQFoggRZgfHVJFhVeEfy a6oY7UI98R74eSf/nmnGY8uc0iw4W2wxhk891aFfYhXcr9kWORDMwypcsMdSusKUThJI nBuQ== X-Gm-Message-State: ALQs6tCVWUB+k+SaUEwVWDLWFG//3T4NcpbZKxAZVt1srwF+8P+qWYYK 5TGdDS7eV1xV3FtI22qwhxFc4Q== X-Received: by 10.223.157.140 with SMTP id p12mr5371287wre.198.1523519543135; Thu, 12 Apr 2018 00:52:23 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id o20sm2586089wro.7.2018.04.12.00.52.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Apr 2018 00:52:22 -0700 (PDT) Date: Thu, 12 Apr 2018 09:52:20 +0200 From: Ingo Molnar To: Song Liu Cc: Vince Weaver , "linux-kernel@vger.kernel.org" , Peter Zijlstra Subject: Re: perf: fuzzer leads to trace_kprobe: Could not insert message flood Message-ID: <20180412075220.l7lqhk3qn4sobfz7@gmail.com> References: <20180411120447.2gzrwijrtayjv3eg@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Song Liu wrote: > > spamming the kernel log ... > > Yeah, the new API allows non-root user to trigger this message. We should only > allow root to create kprobe with perf_event_open(). > > On the other hand, do we need to fix this for root? In fact, a simple bash loop > can create something similar through the text interface (with root): > > root@virt-test:~# for x in {0..5} ; do echo p:xx xx+$x >> /sys/kernel/debug/tracing/kprobe_events ; done > -bash: echo: write error: No such file or directory > -bash: echo: write error: No such file or directory > -bash: echo: write error: No such file or directory > -bash: echo: write error: No such file or directory > -bash: echo: write error: No such file or directory > -bash: echo: write error: No such file or directory > root@virt-test:~# dmesg | tail -n 5 > [ 664.208374] trace_kprobe: Could not insert probe at xx+1: -2 > [ 664.237882] trace_kprobe: Could not insert probe at xx+2: -2 > [ 664.268067] trace_kprobe: Could not insert probe at xx+3: -2 > [ 664.297395] trace_kprobe: Could not insert probe at xx+4: -2 > [ 664.327614] trace_kprobe: Could not insert probe at xx+5: -2 > > This happens before the new API is introduced. > > The following patch does capable(CAP_SYS_ADMIN) for perf_kprobe and > perf_uprobe at an earlier stage, so non-root user cannot trigger > this error message. Please let me know whether we need to fix this > for root. That's two bugs then, and yes, I think we should fix the log spamming: what's the point? We already get an error code from the write. I'll apply your CAP_SYS_ADMIN fix. Thanks, Ingo