Received: by 10.213.65.68 with SMTP id h4csp662481imn; Tue, 13 Mar 2018 17:08:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELscbsWUxUs9zv8IEfOJLWt55aqVTJdXJ2iZqaf7a/AHScTnxdLp1W+dLfNJP5ZbdPIYOqDw X-Received: by 10.98.182.26 with SMTP id j26mr2285619pff.223.1520986099452; Tue, 13 Mar 2018 17:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520986099; cv=none; d=google.com; s=arc-20160816; b=z+4jsiXlGcCHs+HFeQBQDOS9Cix9NbU9qIoMQIYN5Z1vsv8Ra2Pb9S/dSLAlu9sIWl c4WelEjm1C8dAtYChgyt1LhPCnQ6BY+X/JwBog6w9RitAHgb6iGjf1kYcv9xyW/ch/hE CzgV5+JqN+7K25P1p4M0f/lPblhrNGcnXyfkAqFOwKgtDu2128wF2NGG3v5KGXFjz/dH DSxQbNASGSudQz5ph7Y4ACQgSiJN79pWhREjRuoZGrJ3+qjZMm70PHvK0Eng9+WPAaST jsjZ4d4/PwLD6sG9YFwIDklNjogBjlz9JM72QKUHnQQ2ylGgeVXi0WWqJR/IpFvCdVzN MjFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature :arc-authentication-results; bh=z6NXw9QyHxoMLUcXebPt2BSnVa5av3f0GMm2eKIapNs=; b=tD7WjmtJKnVtjP5J2ZgGYtZ/eJZcoG1oNgvP5FidCLnP+fi/N1hDqP+KRvPs0MsoNE DenIL3hm66GgKqQ8zF46NFnb1QVQgcPtQz6nn1yIzMRjGmxBg+n/whu0AyEiMIBEj2S8 gkZlVqfFyi+fqbTsAbz1Pt7vm5/fAqdR/6P6owXCiPsJBFb0vStbNn4U4NYPDF3NvcVH yYKKcfWLSDWcUbDj4M7R0bEyZbQeM7VXoC+JczCXYy5nOHH2624B3sIyuvXeGvbgoYAj gxbTpbZKNkiyIBlugNjvjwRrYDvlRUphbmMf7YKlPQXQhFVCB1B8gpw1es1Gc/fFiXTP H2HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=nhC9n1ov; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=KOcRYQof; 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=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4si895329pgt.83.2018.03.13.17.07.32; Tue, 13 Mar 2018 17:08:19 -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=@fb.com header.s=facebook header.b=nhC9n1ov; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=KOcRYQof; 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=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932937AbeCNABC (ORCPT + 99 others); Tue, 13 Mar 2018 20:01:02 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:32982 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932511AbeCNABA (ORCPT ); Tue, 13 Mar 2018 20:01:00 -0400 Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.22/8.16.0.22) with SMTP id w2DNxkZO003372; Tue, 13 Mar 2018 17:00:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=z6NXw9QyHxoMLUcXebPt2BSnVa5av3f0GMm2eKIapNs=; b=nhC9n1ovuWHv+6d8PyhQsYq8U0cgr6A1Hmj6gVx1xlZIfzstCYjSmI7jDoX1E0Zpg+vY 3Ue+yIRrkuPcD8btfxOAVrCdSL1mVA0QFLY8HxSihjy/IeZoqM2ZS7TfmK51Fkejz18n 4nqr4oaIyUpiZZhQYAwB6KSJDHBurl6982E= Received: from maileast.thefacebook.com ([199.201.65.23]) by m0089730.ppops.net with ESMTP id 2gpqn0g4v3-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Mar 2018 17:00:45 -0700 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.23) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 13 Mar 2018 20:00:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=z6NXw9QyHxoMLUcXebPt2BSnVa5av3f0GMm2eKIapNs=; b=KOcRYQofUfGSnz+mznqBBnSdqmh2rhw777xTqlCTexNjsX0cH3lMewmC64pxjQtStwSsTGNQ2SatgcC+pq7VQwoOulkGNfHWRwT29h0+tysiYlTQ7yWPjGzWZ0rzJRoenj2ci5nbJ6abRPwBClMv0jGxriSTNqqYovN5qtYwqzQ= Received: from [IPv6:2620:10d:c083:1309:ff83:7b3f:34e4:e069] (2620:10d:c090:200::5:747) by BN4PR15MB0529.namprd15.prod.outlook.com (10.164.61.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.12; Wed, 14 Mar 2018 00:00:40 +0000 Subject: Re: [PATCH] bpf: whitelist syscalls for error injection To: Yonghong Song , Omar Sandoval CC: , , Al Viro , Thomas Gleixner , "David S . Miller" , Thomas Garnier , , Steven Rostedt , Ingo Molnar , Josef Bacik , Alexei Starovoitov , References: <20180313231627.1247-1-hmclauchlan@fb.com> <20180313234509.GA4981@vader> <67172932-df1d-5585-601d-a7ce70a2c86b@fb.com> From: Howard McLauchlan Message-ID: Date: Tue, 13 Mar 2018 17:00:36 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <67172932-df1d-5585-601d-a7ce70a2c86b@fb.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [2620:10d:c090:200::5:747] X-ClientProxiedBy: MWHPR22CA0047.namprd22.prod.outlook.com (10.168.250.161) To BN4PR15MB0529.namprd15.prod.outlook.com (10.164.61.151) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45c21893-35e4-4fab-2976-08d5893ea0ba X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:BN4PR15MB0529; X-Microsoft-Exchange-Diagnostics: 1;BN4PR15MB0529;3:maJZcQ559yG2zr7fSiAbCyLqFDfFIoG1IaJdkaTqN8XcyJKcRVaBgVW2aVxMzL1waKXtlVDRxDh/zVq07drc7diprXI9iheToCNaPA6tZUcFKe9cLSCuNyacgEQwuNabt/Rfj4ydRdcebbvgS1BilROw76lor2hSiKiOvODG54CWJCLt4UfawKLyEkfsk3JMbCVfTIfVj4b+PweghdQ1b4IjpWS6lRWqa57jOsVCeduLChNxJQmBrzh6sdRgtfxP;25:9ZrfHUPYA131xCCNCnjF5pCMAxJXB4iesUTiNnXDzx4UbIdomq3rwQBjQmEUG1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AHryxXHrj8gq82OdxH1QI3Mr2N3t64P4bVNmMyePl8X+Z;4:hcuYsmRrwLZpE5FKQXc1cC2lXOmGdMo0+Q50RLgha6+ElBLWAUSesI1WXdKnQHveuCyhb4ur4ScY+Dk+1irfpRhGNMjGu+K6jjy6D+X0RiVk7OmVxG73LnvRDfMUdj/a8GFnLNDWJg7nNST0JBGeaRjlka8m6Dq68U90G595iYZKIgfKrGFHxpsDghcOdjgXSoByrxdMBeRzMreJ0VjnGQnxY6nG916pVfMCkF7TP+ZC5H8+/GkS6rCTItHffzrDOfW7YnRN+oClQjQJRz5CtugAbpzaz099CgFf9UiKcEjw/dpdHcQy2P9BEE9UGKf5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231221)(11241501184)(944501244)(52105095)(6041310)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011);SRVR:BN4PR15MB0529;BCL:0;PCL:0;RULEID:;SRVR:BN4PR15MB0529; X-Forefront-PRVS: 0611A21987 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(376002)(346002)(366004)(39380400002)(39860400002)(396003)(199004)(189003)(76176011)(36756003)(50466002)(47776003)(46003)(106356001)(229853002)(2906002)(4326008)(68736007)(7416002)(5660300001)(86362001)(7736002)(478600001)(6246003)(2870700001)(25786009)(305945005)(53546011)(6486002)(386003)(53936002)(54906003)(8936002)(97736004)(6666003)(65806001)(316002)(64126003)(2950100002)(58126008)(186003)(23676004)(52146003)(52396003)(8676002)(16526019)(2486003)(52116002)(105586002)(1706002)(81156014)(65956001)(6116002)(81166006)(65826007)(110136005)(31696002)(31686004);DIR:OUT;SFP:1102;SCL:1;SRVR:BN4PR15MB0529;H:[IPv6:2620:10d:c083:1309:ff83:7b3f:34e4:e069];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjRQUjE1TUIwNTI5OzIzOitDa2RxS0hFSVBtZlk4azV0cU9HTVlBZ3lI?= =?utf-8?B?bGw5RU54VVppL1VydjZpMkFMRG1heG5BRnlJVFR4T3A3QkNpZzM3WlhQZXI1?= =?utf-8?B?VkZUZTFRU1hHOCtub3g0VjBlYWtrV2tUV0NlY2RFL1F6NDZCSnowcSt3Y2dL?= =?utf-8?B?SGk1SHdnUEQrdFU4Vjl1cnFuejQrTC9yTTltd2dkS20zcmc4VGI0QS9nWmFv?= =?utf-8?B?N2gwVGxFUERERmdFZ3prS0g4OVZqWDdxTnJSRmgwRklIMThQZ1NYN3ZHczVR?= =?utf-8?B?Yk5ycFhCcG9OejFldTE0SW53bmlIaTh2ckZRdy9NU0dyRmRFRktPUmE5MDdC?= =?utf-8?B?TUdNUW1OTkc3amIvM2QzTWtKNTVieVBURmJZTzUxU2dpcTYrcHh2MWlDckFF?= =?utf-8?B?WXlnVnVURllHeHpJdGYzQXl3MEx0clNheFptQXVkM2oyRFVHS1E1VlNUS2VB?= =?utf-8?B?TGxDaU5zUENDa3BUUjhtTUJlWWI1YXpSU1haY0RrSVQyemZ2dkZVVUhxSjFN?= =?utf-8?B?d1dWVzFJVnYrUysxSFBBZFVhNWlKVE9hdC9oTUhWOUlaR2E4b0N6a29PT0J2?= =?utf-8?B?WXhlemhaR3pMVFlOc2hNSU5Cd2Z2N2ZBWFYvYjRKZUpPRmcwRGgwcU84ekMx?= =?utf-8?B?VnN2b29YZ2lrbTlLV3NjblprTmtNazRhZXAzVFNzVWMyN1JrWXVwbUtuZXE3?= =?utf-8?B?RUd2NlU1MWI0aUM4UlI4Mzc2d1VqQ1FWTDVwaTdHd25sNWRzWC8ydk51ZnNm?= =?utf-8?B?SC9kO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BhAnUOD/hO5u9ipKUinUqDRHnK0E9juqVB3Fu28U2SPz2kxWGXJcvMv/lDfExxSN5lcX3PHOaFACNvpOizJHJdCzPJyKVEqE949TDUlNwBIzVOzmbjvZb03JKwYIx4ujtRL31gt3RNgYZZ8/6xpKs7wpJ+e4GbBuIohnppTxN8TmzSx9yMpsMsUqATqa9Pi4OuK3FEDAf4qJ1PrBizgu4Ij6ySv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN4PR15MB0529;20:A6HA2Pnhkzvyp7kocEr9HCJ9sqvk6dyBHnH9aQGvNt2hge13W0bzCIWqo0mK/z7MoA0lXMcSloJow3d49J7zYTfvQpXjQ5uMcOyhBMBpeMq2Y5IOF42+n/2ph+t5VWuFO0JccQsMbED0c4by9lNlkfFw1Q4WaY7dISyeCCXPAiM= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2018 00:00:40.3602 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45c21893-35e4-4fab-2976-08d5893ea0ba X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR15MB0529 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-13_10:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/13/2018 04:49 PM, Yonghong Song wrote: > > > On 3/13/18 4:45 PM, Omar Sandoval wrote: >> On Tue, Mar 13, 2018 at 04:16:27PM -0700, Howard McLauchlan wrote: >>> Error injection is a useful mechanism to fail arbitrary kernel >>> functions. However, it is often hard to guarantee an error propagates >>> appropriately to user space programs. By injecting into syscalls, we can >>> return arbitrary values to user space directly; this increases >>> flexibility and robustness in testing, allowing us to test user space >>> error paths effectively. >>> >>> The following script, for example, fails calls to sys_open() from a >>> given pid: >>> >>> from bcc import BPF >>> from sys import argv >>> >>> pid = argv[1] >>> >>> prog = r""" >>> >>> int kprobe__SyS_open(struct pt_regs *ctx, const char *pathname, int flags) >>> { >>>      u32 pid = bpf_get_current_pid_tgid(); >>>      if (pid == %s) >>>          bpf_override_return(ctx, -ENOENT); >>>      return 0; >>> } >>> """ % pid >>> >>> b = BPF(text = prog) >>> while 1: >>>      b.perf_buffer_poll() >>> >>> This patch whitelists all syscalls defined with SYSCALL_DEFINE for error >>> injection. >>> >>> Signed-off-by: Howard McLauchlan >>> --- >>> based on 4.16-rc5 >>>   include/linux/syscalls.h | 3 +++ >>>   1 file changed, 3 insertions(+) >>> >>> diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h >>> index a78186d826d7..e8c6d63ace78 100644 >>> --- a/include/linux/syscalls.h >>> +++ b/include/linux/syscalls.h >>> @@ -191,6 +191,8 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) >>>     #define SYSCALL_DEFINE0(sname)                    \ >>>       SYSCALL_METADATA(_##sname, 0);                \ >>> +    asmlinkage long sys_##sname(void);            \ >>> +    ALLOW_ERROR_INJECTION(sys_##sname, ERRNO);        \ >>>       asmlinkage long sys_##sname(void) > > duplication of asmlinkage in the above? > The pre-declaration is necessary to ensure ALLOW_ERROR_INJECTION works appropriately. There can be syscalls that are not pre-declared elsewhere which will fail compilation if not declared in this block. >>>     #define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__) >>> @@ -210,6 +212,7 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) >>>   #define __SYSCALL_DEFINEx(x, name, ...)                    \ >>>       asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))    \ >>>           __attribute__((alias(__stringify(SyS##name))));        \ >>> +    ALLOW_ERROR_INJECTION(sys##name, ERRNO);            \ >>>       static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));    \ >>>       asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__));    \ >>>       asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))    \ >>> --  >>> 2.14.1 >>> >> >> Adding a few more people to Cc >>