Received: by 10.213.65.68 with SMTP id h4csp287124imn; Wed, 21 Mar 2018 19:00:53 -0700 (PDT) X-Google-Smtp-Source: AG47ELuO/RmggzBEWxhi2JVVKZu7+EAYOBIAVPZPkLM7/0328dAzJqjfaXeOwI5tmQxzSHULFHWq X-Received: by 10.98.87.151 with SMTP id i23mr913632pfj.175.1521684053702; Wed, 21 Mar 2018 19:00:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521684053; cv=none; d=google.com; s=arc-20160816; b=vO24xlEijvn3Vqj/wN4qWf/1qEmONq/S4ycrHqPbI44pPxDmP6IgR6ePe6WqVhQAy5 bV4i16iuxu1twsEOKixqx5V3T7roVr6EfvsAQs8FQ7mh0eys3DS21xTZP3ITPt3NPST/ gmIWVSwfA0v3kgttsTi4p0WZBLa1TmsmnFb6AeSi1zDwXkbEHajJg9jfXB8IQna2ZcxY IJFIzblGIECA0yRnj3RSF6Fhb/dBhR2aB3m1ngywB6zsMUGn1aKKyxdX0n0+3Y/tds1c nj+tS0I0/T0G2FyrdZ25EOEpoQBehDQpsqhCyBh9v2rP/pH/79mHVyXx9p8mB+4bZgyZ H//A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature:arc-authentication-results; bh=/KSCGP9rJ8MJE5g8H/f16VOD1dKvGjAGtmuVHJ6N+dA=; b=MCiWPHaTO07ZMK/cunDMP2hQ3QLORlpbBDxSGvrqgVriqzJuJTQy9HcllZjejzZbaq 9qxagOM++FVAKlUSYs+yg932z4bZ6Ms+4wknxI3JvsSvcG/DFTMd27jH73EursdXXezU BQlc/po9LBYhstEDvmV4mhWFJyyBc5dTZNncieB9LWRoIkrec/hGdLGN1id9WnmVY076 vx+14vX5NdRlUjQ3/dQs4shsalAsow9A19bIw3sWNZdX/6Qv9bR+YHD+3X36p9pvsp+o ZPiSZc6g0+2uEZgWIG3t7MsMwTgPLtehIjvLBI8XNZbN82AjQgQeHE5knBPwB28T81U0 kSZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=reAKlFNG; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=CpCNcYzi; 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 o16si3587249pgc.832.2018.03.21.19.00.38; Wed, 21 Mar 2018 19:00:53 -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=reAKlFNG; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=CpCNcYzi; 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 S1754471AbeCVB7i (ORCPT + 99 others); Wed, 21 Mar 2018 21:59:38 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:56152 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753789AbeCVB7g (ORCPT ); Wed, 21 Mar 2018 21:59:36 -0400 Received: from pps.filterd (m0044008.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2M1wcst028971; Wed, 21 Mar 2018 18:59:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=facebook; bh=/KSCGP9rJ8MJE5g8H/f16VOD1dKvGjAGtmuVHJ6N+dA=; b=reAKlFNGF0VjxLPcWS1BK7/9RE48fihiCQX1Xf6tCLZ/1yf/u/a73FjTB67n5rhIOMhk vBCNv9W7NujbHIep95mL8v4YbaP3cEEtD+cnoeFfVEjnDfA1xnpSYzIJ/ZGsMCRjKlDT TL7PpqxEBEILYkgsRhzWLEgHptNd1waElPA= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2gv36fr0jw-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 21 Mar 2018 18:59:31 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.18) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 21 Mar 2018 18:59:30 -0700 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=/KSCGP9rJ8MJE5g8H/f16VOD1dKvGjAGtmuVHJ6N+dA=; b=CpCNcYziO8Rhap7QOvGV3xvpTcKIRUMq6s2dO+KfXA8OXPkdFtmkFh9EqygaAyYF0gbO2PoVXdN9LyADJ5lEWK1Bg1lYgPAbcesz/phG/98HE9decLfXQ0Z85/Kpnmx6EmrFxtNFnzoNpSiZNv5bs9s799uGWCxecPiN3Ne9rYA= Received: from hmclauchlan-ubu470s.thefacebook.com (2620:10d:c090:200::6:1eb7) by CY1PR15MB0534.namprd15.prod.outlook.com (2a01:111:e400:59d8::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Thu, 22 Mar 2018 01:59:25 +0000 From: Howard McLauchlan To: Dominik Brodowski CC: , Andy Lutomirski , Ingo Molnar , , Howard McLauchlan Subject: [PATCH v2] bpf: whitelist all syscalls for error injection Date: Wed, 21 Mar 2018 18:59:08 -0700 Message-ID: <20180322015908.30433-1-hmclauchlan@fb.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::6:1eb7] X-ClientProxiedBy: SN4PR0201CA0050.namprd02.prod.outlook.com (2603:10b6:803:20::12) To CY1PR15MB0534.namprd15.prod.outlook.com (2a01:111:e400:59d8::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8105768b-734f-4ef7-0000-08d58f988a95 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:CY1PR15MB0534; X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0534;3:9tFUFmXV0zzEr+fF9cTYNViX6CWOCAFfVGstsUDMY81YInjVRvNa15sJbC7cUOXRJantTiAQOQGNcXKfvPd6xxlD/qWDYduHfXOlZN+x4TAIyFBn1Mj3RAHmVFu98zD4X7tnDIjQycyRQnCNVuBKC5qRkcAdhAShArtWUvj2+ReYhLwUKvCQBbwRLkDjCfVb+zajrmHezTYTTvEgsIAVnubVfTbXjvtcAH9RNxTiqb86gneAthcRP6zphBLNcPFR;25:uF/yomSIovQ4RlVCRJGA3YOHyrQ2J/1CGr2449ORCAQggLYVvQRFkqea5DO+X3fCFibk35C61oWFxFuh4DgESqjg7Fegn+6Ck1h86qy/GHxFC30qmPBN+9nRAjMxwb3Z+pLLLqSQ4RHbpaNEMQxjTYajyk6bDx436A24dR5eYny2tcvE5PhnNWHYlgj5oImxrKPTeHXknHvE2rHRO5YYStBhKYuPAapT7rgJ06KBchAwkBAs3Sj8Wzpqi5OC1S7SIR/jf5S4WKu/h26LQLIzMPjKHPn2aSNHQp9HJkK0o2WWBPpDft+1eMhZ42dS8E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IXqfLoXKTeAHbE9sJ4xT5EVkEqfTZOVHmIzfAyPd6SKY6PtAlriWjYE+a7km1H+CKjBX1iVaE5dKU 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)(5005006)(8121501046)(93006095)(93001095)(3231221)(11241501184)(944501327)(52105095)(3002001)(10201501046)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011);SRVR:CY1PR15MB0534;BCL:0;PCL:0;RULEID:;SRVR:CY1PR15MB0534; X-Forefront-PRVS: 0619D53754 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(39380400002)(376002)(39860400002)(366004)(346002)(189003)(199004)(1076002)(6666003)(7736002)(8936002)(50226002)(81166006)(6916009)(50466002)(48376002)(6486002)(6512007)(25786009)(305945005)(4326008)(81156014)(105586002)(16586007)(47776003)(386003)(106356001)(69596002)(54906003)(53416004)(5660300001)(8676002)(53936002)(6506007)(478600001)(52396003)(36756003)(68736007)(86362001)(2906002)(316002)(51416003)(16526019)(97736004)(6116002)(46003)(52116002)(186003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR15MB0534;H:hmclauchlan-ubu470s.thefacebook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR15MB0534;23:QBxhX48FpK48CBmMmDs2Z1SRrPUGIQEOtSg0kgoHa?= =?us-ascii?Q?gTobucGe8jSWVm8cWostmHLeCDgRKMXIWVTPCsMrTnHd8rn6T20iiuqIUPev?= =?us-ascii?Q?VUkr9RVyKfGpZkH1Mz4awm8AN4LzPNiX+fL2krwUhAuDjtbZWrybfWMNjPVU?= =?us-ascii?Q?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mIZ8lG82DpER3o9NEuy6hcNoqpWExGuCuMxPfMGUkv+1JwA34UqVZil8a/+LwJh+R5UY2hlg3vuvvUNAv+c91lp4+fJKfSjzJXcOeQnjGeqZn5LJsUUzJdprK26twuQnMZLyLh/MckzV/G/0X84ucDU0SRvXOMNszXaFjoEV8j0B94kBkFBKhvaL6G71F0wwFw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0534;20:HMaCDKswnVc4eh5Ezt9KoZk7YhQamK9PRB4D/7QlKAdwQ/qNU6xPBl+6hMCDfH62i7EOk4DrblWBwlwcNJERxQiBXaJcmLikHevmCTYtVZ+JgTQsvNwhp6cscLXNARgWeDcIAuwiBFBz9xwdXvHrfxVS903ZR732/C1N3nI+5G8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2018 01:59:25.8114 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8105768b-734f-4ef7-0000-08d58f988a95 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR15MB0534 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-22_01:,, 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 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, -ENOMEM); return 0; } """ % pid b = BPF(text=prog) while 1: b.perf_buffer_poll() This patch whitelists all syscalls defined with SYSCALL_DEFINE and COMPAT_SYSCALL_DEFINE for error injection. These changes are not intended to be considered stable, and would normally be configured off. Signed-off-by: Howard McLauchlan --- Dominik, I've updated the patch to support compat syscalls. Please let me know if there are additional changes to be made. Cheers, V1->V2: added similar mechanism in compat.h, clarify commit Based on 4.16-rc6 include/linux/compat.h | 3 +++ include/linux/syscalls.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/include/linux/compat.h b/include/linux/compat.h index 16c3027074a2..857ddb1cfedf 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -33,6 +33,8 @@ #endif #define COMPAT_SYSCALL_DEFINE0(name) \ + asmlinkage long compat_sys_##name(void); \ + ALLOW_ERROR_INJECTION(compat_sys_##name, ERRNO); \ asmlinkage long compat_sys_##name(void) #define COMPAT_SYSCALL_DEFINE1(name, ...) \ @@ -51,6 +53,7 @@ #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\ __attribute__((alias(__stringify(compat_SyS##name)))); \ + ALLOW_ERROR_INJECTION(compat_sys##name, ERRNO); \ static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__));\ asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\ 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) #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