From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B44BDC10F02 for ; Sat, 16 Feb 2019 02:21:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8233E222DD for ; Sat, 16 Feb 2019 02:21:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389832AbfBPCVg (ORCPT ); Fri, 15 Feb 2019 21:21:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:44274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727348AbfBPCVf (ORCPT ); Fri, 15 Feb 2019 21:21:35 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 690B0222D0; Sat, 16 Feb 2019 02:21:34 +0000 (UTC) Date: Fri, 15 Feb 2019 21:21:33 -0500 From: Steven Rostedt To: Andy Lutomirski Cc: Linus Torvalds , Linux List Kernel Mailing , Ingo Molnar , Andrew Morton , stable , Changbin Du , Jann Horn , Kees Cook , Andy Lutomirski Subject: Re: [PATCH 1/2 v2] kprobe: Do not use uaccess functions to access kernel memory that can fault Message-ID: <20190215212133.7d33444f@gandalf.local.home> In-Reply-To: <1B52384E-5C02-4279-9111-34881BA3204E@amacapital.net> References: <20190215174712.372898450@goodmis.org> <20190215174945.557218316@goodmis.org> <20190215171539.4682f0b4@gandalf.local.home> <300C4516-A093-43AE-8707-1C42486807A4@amacapital.net> <20190215191949.04604191@gandalf.local.home> <20190215210801.7f8c94cf@gandalf.local.home> <1B52384E-5C02-4279-9111-34881BA3204E@amacapital.net> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 Feb 2019 18:14:21 -0800 Andy Lutomirski wrote: > > In the uprobes case, we have: > > > > static nokprobe_inline int > > probe_mem_read(void *dest, void *src, size_t size) > > { > > void __user *vaddr = (void __force __user *)src; > > > > return copy_from_user(dest, vaddr, size) ? -EFAULT : 0; > > } > > > > Because that is adding probes on userspace code. > > > > > > Can the kprobe case call probe_kernel_read? Maybe it does already? Yes, the probe_mem_read() is only used in the trace_probe_tmpl.h which for uprobes is the above "copy_from_user()" and for the kprobes case it is probe_kernel_read(). -- Steve