Received: by 10.223.164.202 with SMTP id h10csp402799wrb; Thu, 30 Nov 2017 12:16:36 -0800 (PST) X-Google-Smtp-Source: AGs4zMY1iCW//DMnuNZM03B855x15wQsKgnHMe2qCc7t7ezF/sdKTkWeH7uegAuxX9xZTWaMrDce X-Received: by 10.159.231.2 with SMTP id w2mr3735470plq.286.1512072996236; Thu, 30 Nov 2017 12:16:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512072996; cv=none; d=google.com; s=arc-20160816; b=kRiTOJeic4lBwosM80tTgQS4FPbQSGaUHkJiO3uHfYwlJGf/5eL3TfGlhorNTZ155Q OH0iQrzTS+AQshMQrHMpS2UW6gQhSs/bPdktV0Bpi0yaXANoxh1Yzm65lzVrHkNQBre6 ojYMe38vf421VDRrSEhSRrdr3lG0q9wdATIpqiUY/flyJxSe3fKIEDQ2SjK2a1VMyjuO 5ASG1tP/rnmrE9vBrqG2H/tQKnhIe8X57Tp/+6Hy/LnvOOF22ZZULN2BlUogGolmRV72 Msl1paylElu6Sm51XrQaKv/5Y/UCya9PXtwx+M+8zxGuIRyjxPdz5H6bI0i8/1F5hQIx wEjw== 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=Mg+kJkfJBbeZQXUW0kybUZnrLA9pgKOpsd2F0Ot7CVY=; b=TZN69OGbTQ0h3t30rhF0WqKNckahRP+vlFKe375uvGES7yzJ78rhqgJMxA9ei6k98u UixX/Qe2W6TcxxHtWmZp3pGhLuQjYKxkihKBN+Qxsr1rJR7jsnpNGo8ML3GnaicRcL0a OPmshW9YSMvHIPUSIBYpi6evNF0KXYVOPDPkIzlyYYoTwrcwUjFusAEqLjMUZkD8GO/s +cSzhd1o3q9CF6zuSLyr/KfxoYNbQwoDiaHjLCBBANwJuZLcq2Y7/Md+EKD7xduIdVuD /gdE/qqqNP4Z+jI6VP/isTS4f/mLDvldatQDulVIoPdeAdqKgP+YSFoyolpD3oaz9iVr 0j7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=yJaJmawe; 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 a8si3682370ple.222.2017.11.30.12.16.22; Thu, 30 Nov 2017 12:16:36 -0800 (PST) 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=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=yJaJmawe; 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 S1751920AbdK3UPo (ORCPT + 99 others); Thu, 30 Nov 2017 15:15:44 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:35827 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486AbdK3UPj (ORCPT ); Thu, 30 Nov 2017 15:15:39 -0500 Received: by mail-qt0-f195.google.com with SMTP id u10so10384610qtg.2 for ; Thu, 30 Nov 2017 12:15:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Mg+kJkfJBbeZQXUW0kybUZnrLA9pgKOpsd2F0Ot7CVY=; b=yJaJmawexQtFhN2F9vKrtNXZoxhsNt2N9Cc/g9WQAlyj3MtcKe3PD2dyGCvMxwSnIg 4VG+VswgVzQQbR125bhpw3FJ4K7t8oUZ4Q2Cbyo95gKr1UOogjl4TSXS5hkBbD8rGTZj APgnXjQoLnl8R/7YbD9h0tOJYdPxMwgmUGayvYgY1nukvyygVrW0id+iFmZoJW1zQ2ZQ vT4BI64yAXKZBS/LmBxFumMKQwPctf2wtPCY60+YRi/Ydx9ywp4rOFssiow31LSLuxu2 piEGV/I83NSofRKfkA1zA0XyliQQJ8kdKxW88DOOjyxFUHFMMR2HDNU7YOq37PLF7h05 KyYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Mg+kJkfJBbeZQXUW0kybUZnrLA9pgKOpsd2F0Ot7CVY=; b=muRBZyp2gz8bbUuOk93lJpF7+s81XZhv23LO4Ul8sjnGWdiKREHHE8R5rJaWjtzbZO l0jxUf90G8lDA5/vFAZ2wym+ViNNStwmhYvvckcz36c5/QSIPYyvz/lFrk8L87ooSqId 05pL7KYoo5xw9XiTJoYHrZdD3kjZmd4CmNWk2lQl4AT1AVaNppb9jlzmX2BHGQ9JaAWU bOgbqweIAEuJ+hlq1EBSF4/gTsIEjEYUuOar4rY93KVtsTuGSg91Bq6mSCt0pa4SddfY QIkyApNPShdkaJBS7GSHkYbwUJ/SqEQxJ+IqNxuvdYbf/fVwijUGtRQzz/5u9zt/dzUu Obrg== X-Gm-Message-State: AKGB3mL30xzdh2aKvt4r9FnMvhdc0C9NYr95RHLNGImwqNT8ZDoyeQiB 6Umi1tUMhn0n5GY3ilG71A/WRg== X-Received: by 10.237.37.227 with SMTP id y32mr5084232qtc.251.1512072939054; Thu, 30 Nov 2017 12:15:39 -0800 (PST) Received: from localhost (cpe-2606-A000-4381-1201-225-22FF-FEB3-E51A.dyn6.twc.com. [2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id y58sm3548959qtb.9.2017.11.30.12.15.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Nov 2017 12:15:38 -0800 (PST) Date: Thu, 30 Nov 2017 15:15:37 -0500 From: Josef Bacik To: Daniel Borkmann Cc: Josef Bacik , Jonathan Corbet , rostedt@goodmis.org, mingo@redhat.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ast@kernel.org, kernel-team@fb.com, linux-btrfs@vger.kernel.org, Josef Bacik Subject: Re: [PATCH v7 1/5] add infrastructure for tagging functions as error injectable Message-ID: <20171130201535.7eeawg77yixnqjks@destiny> References: <1511385814-20863-1-git-send-email-josef@toxicpanda.com> <1511385814-20863-2-git-send-email-josef@toxicpanda.com> <20171128115841.4958113d@lwn.net> <20171128200241.tr5d6a2obvxl6inb@destiny> <83414bdd-2e83-bc77-da90-33ee43b89a97@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83414bdd-2e83-bc77-da90-33ee43b89a97@iogearbox.net> User-Agent: NeoMutt/20170714 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 29, 2017 at 05:59:39PM +0100, Daniel Borkmann wrote: > On 11/28/2017 09:02 PM, Josef Bacik wrote: > > On Tue, Nov 28, 2017 at 11:58:41AM -0700, Jonathan Corbet wrote: > >> On Wed, 22 Nov 2017 16:23:30 -0500 > >> Josef Bacik wrote: > >>> From: Josef Bacik > >>> > >>> Using BPF we can override kprob'ed functions and return arbitrary > >>> values. Obviously this can be a bit unsafe, so make this feature opt-in > >>> for functions. Simply tag a function with KPROBE_ERROR_INJECT_SYMBOL in > >>> order to give BPF access to that function for error injection purposes. > >>> > >>> Signed-off-by: Josef Bacik > >>> Acked-by: Ingo Molnar > >>> --- > >>> arch/x86/include/asm/asm.h | 6 ++ > >>> include/asm-generic/vmlinux.lds.h | 10 +++ > >>> include/linux/bpf.h | 11 +++ > >>> include/linux/kprobes.h | 1 + > >>> include/linux/module.h | 5 ++ > >>> kernel/kprobes.c | 163 ++++++++++++++++++++++++++++++++++++++ > >>> kernel/module.c | 6 +- > >>> 7 files changed, 201 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h > >>> index b0dc91f4bedc..340f4cc43255 100644 > >>> --- a/arch/x86/include/asm/asm.h > >>> +++ b/arch/x86/include/asm/asm.h > >>> @@ -85,6 +85,12 @@ > >>> _ASM_PTR (entry); \ > >>> .popsection > >>> > >>> +# define _ASM_KPROBE_ERROR_INJECT(entry) \ > >>> + .pushsection "_kprobe_error_inject_list","aw" ; \ > >>> + _ASM_ALIGN ; \ > >>> + _ASM_PTR (entry); \ > >>> + .popseciton > >> > >> So this stuff is not my area of greatest expertise, but I do have to wonder > >> how ".popseciton" can work ... ? > > > > Well fuck, do you want me to send a increment Daniel/Alexei or resend this patch > > fixed? Thanks, > > Sorry for late reply, please rebase + respin the whole series with > this fixed. There were also few typos in the cover letter / commit > messages that would be good to get fixed along the way. > > Also, could you debug why this wasn't caught at compile/runtime during > testing? > Sat down to figure out what was wrong here, and realized I'm just an idiot. I was copying the no kprobe stuff, and my grepping did not uncover what _ASM_NOKPROBE() was used for, so I assumed it was some auto generated magic and just copied what it did to cover my bases. Sat down to figure it out and it is actually called in some assembly files (which is why cscope didn't find it). So we don't need _ASM_KPROBE_ERROR_INJECT at all. I'll drop it and respin and send it along. Thanks, Josef From 1585420541331341284@xxx Wed Nov 29 17:00:50 +0000 2017 X-GM-THRID: 1584803075397522780 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread