Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4848462rwb; Tue, 6 Sep 2022 13:49:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR60Gwkf312TsatTRYyn1C8mOI/T/9Mfb7fI2s7HKbekpYfkU9gsyVsnJ3+Xy+C4O5DeZhTE X-Received: by 2002:a17:902:e843:b0:175:2f2:4d7e with SMTP id t3-20020a170902e84300b0017502f24d7emr440278plg.83.1662497340384; Tue, 06 Sep 2022 13:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662497340; cv=none; d=google.com; s=arc-20160816; b=dI70ntTUP4efq/mmSDyIeZY4o/Pr1ai8qqVHhj2VX1svP1M+rsFxWDAHJlglG94Djh 7ARYiW8S9e9XieIKBApg1KGp1PQZUSBo1hiof7HkllkmqK+nt7IT9A5ZBHroewlaFFG6 9qGsPlpC84aRlOYSaJJwwWotKUUaPHeV3LIQpLmGOk8HaUxprWzhOYT/Y4hL/UqfuPfS LkxYJkEHIKQAXAwjEi/e1sRrL2mHAkBRuBzMjdex6UFLlKl15uCoxUXeBodOuYB0COPX 2gpNttaRs0wuAB4qWyyrhB3wv0zUp2/Px3P3tk38FWQAf0PqOhv1RiBYIMI/KA3hZtcj YWgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DmGvl3uZQB8/M8fW3mjXEVral7dNpov0geEOt0uqNnA=; b=I9+i72jSIi73jLFUHz9JKyjTPR9ACwEHeURdBhPch1gUbXnuhIYfqfc7AYhsnYRspl pK/nAI0Lg6etIL941e+QTwIq/AYIPKkJgV6BjNfyTlEcyhHGAId49uH8lQGXD2ierwbd MgULToHMGLqJuKwre8Vs5h4e4nlxUaW8gcNwrVI2bVWmYwk4rYxhV/oKME/E/NXs27qR hNaku73s89eP6imCU2gM3nDyat4C6T+E76BEdOUWfoo8Wt6SVSbIM9yvMVYO2r7Uo4id rtb8zstHXiNa94ZLT4hEb7f5BmcfObIoiI0C3hE+NsljzKG4pN6pkT/Nq8YNTB8rvcyU 4Dgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jPxkDIeu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020a170902c40200b0016781796321si15496738plk.49.2022.09.06.13.48.48; Tue, 06 Sep 2022 13:49:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jPxkDIeu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230358AbiIFUiR (ORCPT + 99 others); Tue, 6 Sep 2022 16:38:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230166AbiIFUiP (ORCPT ); Tue, 6 Sep 2022 16:38:15 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CC2B876AC; Tue, 6 Sep 2022 13:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=DmGvl3uZQB8/M8fW3mjXEVral7dNpov0geEOt0uqNnA=; b=jPxkDIeusjNzbIYNQI1gH+MPWw iptDBqorWRN298K3hEbKBLsGbuVfGBAqKQKk3tFj5nryUmK4f7y0dqQiltgRjfg+WktHaUJxYmCnK hvV9E/qPf8FSGDDqFvNL+KuVkMfTIQ8wzFfe5QyTqRVX8UneXmDCDfDM7zdEioHiFaktmV01RqHfy MmEM64l1Zmi8jBUIA0CvNApfss0x/JkLDlit3Zmu6C8fZ/g/5B/QxPfptpL/aTrK6e99G8/QiaQtj 4WxVTPHG06Sxcz/5tMrjfIc8UkRoPG8cczT3TXEhL/0KXSMyL/fSvavQOR404DLlbCZAGzBeY+x5q JXpPVR1A==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVfKd-00AkKB-AJ; Tue, 06 Sep 2022 20:38:03 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 61BB4300244; Tue, 6 Sep 2022 22:38:00 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3D7AB2B929A27; Tue, 6 Sep 2022 22:38:00 +0200 (CEST) Date: Tue, 6 Sep 2022 22:38:00 +0200 From: Peter Zijlstra To: Marco Elver Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, Dmitry Vyukov , Jann Horn , Thomas Gleixner Subject: Re: [PATCH] perf: Allow restricted kernel breakpoints on user addresses Message-ID: References: <20220902100057.404817-1-elver@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220902100057.404817-1-elver@google.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 02, 2022 at 12:00:57PM +0200, Marco Elver wrote: > Allow the creation of restricted breakpoint perf events that also fire > in the kernel (!exclude_kernel), if: > > 1. No sample information is requested; samples may contain IPs, > registers, or other information that may disclose kernel addresses. > > 2. The breakpoint (viz. data watchpoint) is on a user address. > > The rules constrain the allowable perf events such that no sensitive > kernel information can be disclosed. > > Despite no explicit kernel information disclosure, the following > questions may need answers: > > 1. Is obtaining information that the kernel accessed a particular > user's known memory location revealing new information? > Given the kernel's user space ABI, there should be no "surprise > accesses" to user space memory in the first place. > > 2. Does causing breakpoints on user memory accesses by the kernel > potentially impact timing in a sensitive way? > Since hardware breakpoints trigger regardless of the state of > perf_event_attr::exclude_kernel, but are filtered in the perf > subsystem, this possibility already exists independent of the > proposed change. > Changelog forgot to tell us why you want this :-) I don't see any immediate concerns, but it's late so who knows..