Received: by 10.223.164.221 with SMTP id h29csp1094012wrb; Wed, 1 Nov 2017 10:19:18 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TVe6YQtB+q9WSFI79D9Qn5xr0mJxvkt2h1QGyvJ5mVw1V7R2EGgSY/3fu9O6rdfz77IklF X-Received: by 10.99.96.74 with SMTP id u71mr551330pgb.181.1509556758527; Wed, 01 Nov 2017 10:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509556758; cv=none; d=google.com; s=arc-20160816; b=z/kY3b6kxJt12gTaWRRFl6h2AIx2YnxsXsW68VSpYzf6dCLTMlGjeMYHaFvRd9tb4D W/47YQQv4wZB8Vc5pQLhQmg+IQH/itDOjldSPZxxlmbrFcaRcr0S4Kxf9Eh+c0K6FH7i 6FFlUorb3BZtxKTlhyL9cblEx/2yeqwpr02Ho5obMujM7rPLx/+shNwd3C02A7iRQyKG xYXNj96cppAeZvbvr3Uu55GXNcyEQZr/oFmDuevMh3QU/zrjfrrWp50wZTCS6fTQniaH YPc2l4XcNHupyXP2gCvtfCUt4hib//h6sncyryAbCaBHBH5GxWeAusVNwlubrst8jSZC pP0w== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:dkim-signature:arc-authentication-results; bh=XcOZEhfbF3AW97+pFpHYJ6Sngb5pYEAkfmm8MxnFVfo=; b=sw6H/8ZAUryT7ERUSEz5BDXgMMyCnAGuhWCzijY1TGELqo/hSidmsCgimNcg4EEIqc S3DqIQZw4XrWnF07XhAL+th1y+EcGmZQAaVcdvlm3BSL5yw0suSWL4B9kjINi1W0acxy ocEiDwtxldpwgu6dhXbJmr4lLx5LjTGSRYT+iHM5l+Ffgrn5cWAPmgI7Bal3hiTwcFLU +YiKMpvsj0FWOYYGpVY5OeGRQdwrvfx31TiXIvaS7JcNtY2LuBmXcHSYJ4dMIjziepSn MD2frRqBRup1vAvy0UN7ZbAp8UTCXo81Uh5PSO58a+3Ft8tgSgfC6b6X8cwOxbWdW5kG ahHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=jPrPOWby; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=ChzVGBdO; 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 1si155260pll.613.2017.11.01.10.19.05; Wed, 01 Nov 2017 10:19:18 -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=jPrPOWby; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=ChzVGBdO; 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 S1754687AbdKARSa (ORCPT + 99 others); Wed, 1 Nov 2017 13:18:30 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:46848 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347AbdKARS1 (ORCPT ); Wed, 1 Nov 2017 13:18:27 -0400 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA1HIFY9002613; Wed, 1 Nov 2017 10:18:15 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=subject : to : references : cc : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=XcOZEhfbF3AW97+pFpHYJ6Sngb5pYEAkfmm8MxnFVfo=; b=jPrPOWbyRYDsWPhJx+00jr7zgXBRuztzqWn7u+Fjltyp61LGrmyx0GFzzuiaz5bzhDik Ux47Hetw5LgTim7HLfHuZLMpAPe5UOhyMJ3/5n+xCU1r51bhwUIwAQYsASbIEDkeRRLa yDg9OacuPiRSwlChEKmJdRH3Y5u6PDXxQbg= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2dyfqa8wm6-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 01 Nov 2017 10:18:14 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.21) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 1 Nov 2017 13:18:08 -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=XcOZEhfbF3AW97+pFpHYJ6Sngb5pYEAkfmm8MxnFVfo=; b=ChzVGBdOFRmlLZYAGmngo+aoFaq41GYLdsvacXjeGf67rsWHBf9nUGJd4xtR82WF3RxrczBMGUXAymkkBDrplE5bsExsLfs9j7geoN7ZoSdL4nWTebixu4Ml5O7Am0tk9OiCbTAjmYtkooXbGv7hJv0h8Er5ZYew8Zewa5Bc0xs= Received: from [IPv6:2620:10d:c081:1131::112d] (2620:10d:c090:180::1:39bd) by SN2PR15MB0974.namprd15.prod.outlook.com (2603:10b6:804:20::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Wed, 1 Nov 2017 17:18:06 +0000 Subject: Re: [PATCH 1/2] bpf: add a bpf_override_function helper To: Josef Bacik , , , , , , , References: <1509555643-2899-1-git-send-email-josef@toxicpanda.com> <1509555643-2899-2-git-send-email-josef@toxicpanda.com> CC: Josef Bacik From: Alexei Starovoitov Message-ID: <1b1ea1f7-14ff-9725-c481-6ca6059d6051@fb.com> Date: Wed, 1 Nov 2017 10:18:02 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1509555643-2899-2-git-send-email-josef@toxicpanda.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:180::1:39bd] X-ClientProxiedBy: MWHPR22CA0038.namprd22.prod.outlook.com (2603:10b6:300:69::24) To SN2PR15MB0974.namprd15.prod.outlook.com (2603:10b6:804:20::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45b52615-91ad-4f1f-496d-08d5214c84ed X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(2017052603199);SRVR:SN2PR15MB0974; X-Microsoft-Exchange-Diagnostics: 1;SN2PR15MB0974;3:rDfnK7DsbwJXlWFbE8yv3JvqVicUukxkXayEnHu688DsuLZ9AXA+NbgTeawy3egraEw/VvoOArKGTmzGOky/uI5o1y5rjB2DQ2iC7Np8jEr6lTKSyA7BiajjHuujxhbvRq6NZXBe6CddOF3ZXFJlSpBGWO9weDX/ZuWUKb8IdDuU+aavMJElXSmGLTrqsVcI0NU17hxNnY9ep7YontM3zsTSK9dEwPVz4XDb0t5JD6DroLZYvCk527e5DdaKv+Ij;25:I5t6VJOxTpxjIZm3YDGuNkqXi+nVCSOqx7pFsPEH/wdsGf2fKZv9XGPs/yrL5K4i4aVreLuqr9dTincRpmJMwkFlBgSAc0YroxZpJaHTgTPLBgwO+0GMJa88cwFeBCnODJn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9VDKuGFNyPmz4Ssw9Kp+h5dIIOiN0Veh7MlmCLP5PXmvy2GVs5S+SSWMquyu2jGlbf3KWsF2xSTH+dWj97oKMy1JXSduMQ+THVs2sqhTtLn+ivO1GE+MwBr+shJBJ42596vTi/E4X2Qlb7Q6kqq5o5qvpBKAK6cfB3YROUXB4bROs0ocQdOqKMidS1vVVodDfsnAC11/NFl9FBhxBTpbDj8M+Yf22IwOuEFDybWHk70k8n2CEtQQxqZ73x/n8fTrU3RX2VhJnGKxTwmf97rWzCbl X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(11241501159)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(3231020)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN2PR15MB0974;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN2PR15MB0974; X-Forefront-PRVS: 0478C23FE0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(376002)(346002)(24454002)(199003)(189002)(4326008)(65956001)(7736002)(47776003)(36756003)(65806001)(81166006)(6116002)(53936002)(31686004)(8936002)(6246003)(230700001)(81156014)(8676002)(1706002)(478600001)(5660300001)(31696002)(86362001)(97736004)(67846002)(65826007)(6636002)(6666003)(2950100002)(33646002)(54356999)(53546010)(106356001)(58126008)(105586002)(2906002)(76176999)(50986999)(316002)(83506002)(23746002)(305945005)(229853002)(101416001)(64126003)(25786009)(68736007)(6486002)(50466002)(189998001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN2PR15MB0974;H:[IPv6:2620:10d:c081:1131::112d];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: =?Windows-1252?Q?1;SN2PR15MB0974;23:bQ56Un8t1y7xOZH+LzZIHdwZzh2jzWUtRctkd?= =?Windows-1252?Q?dayB3Oj44EmH8Q/bxjLXeMuJHoJ2lhjLib6AMzCSj+STTGFTwbKWASNR?= =?Windows-1252?Q?sNUHdXSoYDHbYzrWIg8QeO/YBw5jRUpJDrh5Ms9ZFLviNQREwqVkdHqe?= =?Windows-1252?Q?/0jWxsjS+VFgf2KwkcLgPszSPB1BkZMzX6BluZG4H2Y89zfANeUdmbmu?= =?Windows-1252?Q?VaLdkbcvbx13R43kIVQZyvoR9Wu++q5fACuXPz+lYcRU3tjIjXL972r9?= =?Windows-1252?Q?hrPL8XaPu3yGbfY50Mej3T6aFEaB6UGpq3eyUjO08uV8McIR3SFGEy9w?= =?Windows-1252?Q?bxZ/PfVt1UxmWIdoYUmForD7sJKKM7iNZl/1yrljPqKD5agYmxeJ076u?= =?Windows-1252?Q?74Rfn+lH0tQHArDvW3kT6Vn+M3Ij+xuO72tqEW+zp2hn+yYoDfrx38xc?= =?Windows-1252?Q?ArZnQekmM5gth6OM/z7IpZLi2vrqNnurKS8XN+t3qeeibu0DQ4k/xFFR?= =?Windows-1252?Q?gRG8GtdOBEe43q0+3Z+av9bl/L9/EjMiC3TNhiJVt/xDTqY5jHpQK87v?= =?Windows-1252?Q?IGurzU3VlwoK9f6QthPAl01IO7TiBBwjvYQEG4pt/D2VjSSKW/TgyWDZ?= =?Windows-1252?Q?cFW0ENiloETsEiloXm0zUnwnLu8m1j4nGAyBrcay+sgYkGoivvtyCYUR?= =?Windows-1252?Q?9uTFiHHROUfu4DUcpQ0JMO8w28nn/+5ePwJWmNuDp7licdIVw+OfzblF?= =?Windows-1252?Q?Lp67KKfzMUI0K6s67YVOypkO1ypK5SwavgOwjuFgmPRBJw0p01pdfRos?= =?Windows-1252?Q?eIh9+KMYjdvUQ1Kq8hzYzM9WSpLPebTCmGibpUtY0TBOaWlJd9DmtYO8?= =?Windows-1252?Q?GPkr4f0/hrZsyeuV8ZGO3WwOPTxy4JCrWzuachxn4Up9aP3sGv2DHyBG?= =?Windows-1252?Q?6pr8t4GjxTVLns7yBrvR4NnMT3VI7qS1yBUKpedbmiDYuHRhDd53Mv0f?= =?Windows-1252?Q?tCV3Qv0uZ46YkM3hOPlFdZpj9K5b1e4FM0YWGOz1zl3QgXsxMSCP5WAI?= =?Windows-1252?Q?vo5YDQawA+hmLBIEXsbCEsoL6NR6+FCds0kwE0yHAsag8f+nMb2XrNr+?= =?Windows-1252?Q?RHzkSBQtF8cYlHvQ/DZ8Ct/mJi2si3CRyoXdNJzsp051LoSh33XTz7FC?= =?Windows-1252?Q?C+QWPTuJH4toy4TLL/WMUgOlExvZcL+x8N1rs3RvHwxTAffHrhsjVRA2?= =?Windows-1252?Q?aWrTpePBWDSfdVU5rW9CYvWw/XO6cOZajycDzVlLA19zP6EmBPVUDFNV?= =?Windows-1252?Q?BpzLBOl29ad3w6xZ/HhvFi2ElcxsSlvqa+lmbrJC38SwKg=3D?= X-Microsoft-Exchange-Diagnostics: 1;SN2PR15MB0974;6:pJaRigBbfvFC+k77D3k5KyKlPpbnuRJyN4ZIBK7vJzVk4hS42AImJJww5/2hacg4hsK+ySji7zbETHqSrSBxvPG2Gx9xyhvI6qB7smgT6osQx1IrjCRCm+/5GmLPtuL0AdEnTr7RLslUmgip43+WgWAJa1ABmTUXAm+xviDoIXz/5paVuCAYIG6Bn4UtSO9uJMCL+mKchoPwZEiRX60S8VhjAUMjhfSPh3VHzFjP8Cqy7Th5kJmO6R1q62HdCKF87GfRbICAbkXDXPtJgO21OBGfP/0RL51rAoSSo1amaLNSarJkkt4GdO22LIjvBN0s6XjJKOc0ek4sETQqzJbOK3dUcTzJbpk4wRAudBrhQSY=;5:gJ44j16yGGH7KRd2fl/FcHGNf/luZeAbrWr26FibCkLYgVRdEgxkMvT5JGheMhblfgJ8PRiGCK9Toe6OgVx+hMRQW+Be/ocJB/sQ3hI1/qfVNEIviJtZ7Lv8qOXyzcMdLq9L8kywVNUBg1xjpLN884ts+o7EM2btBLx0vLIWkzQ=;24:ST8BxeOnZ05XfQYe4KHhWQ/xOSWTrGd3turzTIdqrRNbt5Ktgt40/BSp9/XiG1YX4iYM9aZPtt2LDyRzoNKv52rKd4fXFhBSSLfE9yfHW6U=;7:p+d+0IAAvZ0VPG1b2FJd5J2kvsbzKGj01nsNHV9spFHFOoJrT91jY6JGgm2pTzqUnmpAXtHWNIl8SQ3WkokQmVgYPwWMM21OJQL50UFRMfg1Zr/AIey7kzQPiLX7LQ9BJ6gOdN63/ZHH01tzZdyO24+6iqCtPgFUEYfMpSEdckIdXij/UqvGlga6TfC3qFb1T/6C7fojVtr66raLdV1FczaX98VTSBhqUIRN7MSsBEOejWVTT8ELKwsc9SpGoq86 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN2PR15MB0974;20:warqMmTuPSUtvy0KQ6CZe63t7K1udcVDJOun3wLkDTXqnoUGUb7JmbT3h3zP4iQKwpg+dVWt8JjnVf6DW2RK5S7Tl2wroAh+cURCY5m4RnZZO4kBrGMugGRl9HU0++pA0vHnZJuUF/mxDe8nnA6kSn8Qd1d0X1V/ZFWqQ+52NZI= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2017 17:18:06.3697 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45b52615-91ad-4f1f-496d-08d5214c84ed X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR15MB0974 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-01_04:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/1/17 10:00 AM, Josef Bacik wrote: > From: Josef Bacik > > Error injection is sloppy and very ad-hoc. BPF could fill this niche > perfectly with it's kprobe functionality. We could make sure errors are > only triggered in specific call chains that we care about with very > specific situations. Accomplish this with the bpf_override_funciton > helper. This will modify the probe'd callers return value to the > specified value and set the PC to an override function that simply > returns, bypassing the originally probed function. This gives us a nice > clean way to implement systematic error injection for all of our code > paths. > > Signed-off-by: Josef Bacik Both bpf and tracing bits look great to me. Acked-by: Alexei Starovoitov From 1582884059549901177@xxx Wed Nov 01 17:04:33 +0000 2017 X-GM-THRID: 1582884059549901177 X-Gmail-Labels: Inbox,Category Forums