Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753942AbdLTCO4 (ORCPT ); Tue, 19 Dec 2017 21:14:56 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:45980 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753106AbdLTCOx (ORCPT ); Tue, 19 Dec 2017 21:14:53 -0500 Subject: Re: [PATCH v10 1/5] add infrastructure for tagging functions as error injectable To: Masami Hiramatsu , Josef Bacik References: <1513365176-6744-1-git-send-email-josef@toxicpanda.com> <1513365176-6744-2-git-send-email-josef@toxicpanda.com> <20171219152925.5789309c6c4d27807d42f11c@kernel.org> CC: , , , , , , , , , , Josef Bacik From: Alexei Starovoitov Message-ID: <7b73cbfa-959f-2efe-8a7c-f9d0b0c2ccaa@fb.com> Date: Tue, 19 Dec 2017 18:14:17 -0800 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: <20171219152925.5789309c6c4d27807d42f11c@kernel.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:180::2d51] X-ClientProxiedBy: CY4PR13CA0047.namprd13.prod.outlook.com (2603:10b6:903:99::33) To DM3PR15MB0969.namprd15.prod.outlook.com (2603:10b6:0:10::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 534bc27f-f6e0-4296-bbb1-08d5474f629f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060);SRVR:DM3PR15MB0969; X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB0969;3:CpMtmnfgNsDAe1sCaiT+EnaFigoMYP1/pVIfSLeBib8oFZRCCIvyW5iAQxkgidGfeeqTwUwBfc5bBjKNh7G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7+qiUPu95sttmjX7nNPLtPMO3K+9ulZSGK/w4rIoRt5vNZDcl/PPvig1XZ2uf/2y1mkv0Uiv4XJ5Sp8lDOvIEhi83wyMpa2N0PvJ64sEhBdhtK59QIAa/23E2ntjcKxVM6tnenA2BK8nsJ9hGUJhP5VlwSvUQiKeei0WcgbYyShzWdQT7enR8GhC8Q/hLuLukXpsDaoMDE+dHijzOrmD/AOcOPSxGe2ABGbDnikdxkg1nt4aaDPEC3/OArqndtrBtFnCg9n;4:HS+kvayJqNTJX3f7U7ZfETVDyeWvcz8U5B1jLZB49aWwaMJ407O7yl/6NhxSjLAl+tDRwU35r8vhFXFzEZNV5y7GA3VZplNRRuFMkL4aPyew7pQZI1EI2qARXFWBEpG1byM0OPUA2O1ghiDxkezbhBafgrm6/IhrXpQvtMdLX0SDC4ei1eGt2w49o6joOm7e3JXGVXqoBQfxdwD5TBEJfKmVALHo8wvz8xlKGMg31vQLOia5B0ZpZwUx3wGhlpUNgihIImFZg2VgGqEyieRlEjBdBkhR/XBfnRo57abaMpVM5m3h+QhFvRgcxGsiO5n8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231023)(11241501184)(93006095)(93001095)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM3PR15MB0969;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM3PR15MB0969; X-Forefront-PRVS: 0527DFA348 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39380400002)(39860400002)(366004)(376002)(396003)(346002)(189003)(24454002)(199004)(23746002)(316002)(76176011)(31686004)(47776003)(65956001)(478600001)(52116002)(65806001)(53546011)(2906002)(7416002)(386003)(110136005)(4326008)(25786009)(31696002)(86362001)(58126008)(7736002)(53936002)(8936002)(83506002)(97736004)(6486002)(105586002)(50466002)(1706002)(229853002)(6116002)(67846002)(5660300001)(36756003)(106356001)(305945005)(6246003)(230700001)(64126003)(6666003)(81166006)(81156014)(65826007)(8676002)(68736007)(2950100002)(52396003)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR15MB0969;H:[IPv6:2620:10d:c081:1130::12bd];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DM3PR15MB0969;23:Olm524CleV/gBwG8E4rrQ/sTp1ZG9MD4kYmnc?= =?Windows-1252?Q?NsIWSImk+jD5mWFOQwHCDg0PI58pCKcolDK+OMcii5CyYNA1kGh+qFSg?= =?Windows-1252?Q?CFh/fW9XZT0gpIxptdh4f9cZtN6gTmDDuCa5SOHvUvOB/U693m4CQI7W?= =?Windows-1252?Q?tBF9JB6V9/nwbU7+eMErqUCs4uZyyWfYRf/f7a54DKJPKrNNQA3sZ9gZ?= =?Windows-1252?Q?6qZsqkC/JMgI5Cvr2Ro4vWbWX++yylVudPJ0CrCml7GOanTsEafBNk80?= =?Windows-1252?Q?SaD0I4eT533KeqCCH47jjN3lHiy5Qlhi5asdkakcdIzSFlI698puAoi+?= =?Windows-1252?Q?0euQ7yXtY8AFb86YABkt2yMdBb/aU0Nn6KqbtIfvtQ/Zqwzg3kSW7Ei2?= =?Windows-1252?Q?kWLIVxzGPRt8QDPvdrfzp2KTJmtQ2NQnvGGVVwRXGMTW1eYxfHTmyVku?= =?Windows-1252?Q?Y5AUeCrOFGj7zGHkYG1ly3SoxP194KeyQ4ZI2Q8jvfndRU8hSrb2vnJN?= =?Windows-1252?Q?rAdGcuEVjdcRazvRdI/aue96CGDm+lMoJ4gfmN6M8suYvbf0RqdW5neq?= =?Windows-1252?Q?jpq3Fa7ZZ/p5cGtMzzVgyy1GZsbqC9KCURO8YS4BT0M8JJRpMKIj9myK?= =?Windows-1252?Q?FjHdPdDjMFoaeTWrYl8e4n1FcIxOImbPeyqHYHZrjiaMibEX4S6218sG?= =?Windows-1252?Q?fxfuNQY8nzjT0ZS1K3447c+gnaV6HIEcnTMkSZEcxg+Z8uo8/ChCeEtO?= =?Windows-1252?Q?flJ7Kj7GQeT5q/b/ufMl1Tv7pw3OAIo1VmU/+8xHoMSvYRSmfMA+MR81?= =?Windows-1252?Q?tKZ6W5PN5gy10L2FktuK1e0pgTO+/DB9rHAqWEJfGcdoe/oyzdubKWzu?= =?Windows-1252?Q?EnKcAzqtZeyK+4ON/R23r++cPqZqRT+r7mHKtHyocicxJAtINRc/cVus?= =?Windows-1252?Q?Twni15ltGa8iIN1vOanBUX+c/oQmZFjeGHHJDW849/P1nIWclYDwyib0?= =?Windows-1252?Q?e+Qj1prSan5iUz0pKtJYSrM+Pf403WsYpmMDUpW3H0jdNo2HYkGSiHQ3?= =?Windows-1252?Q?tGb3PevX5NniaLgiA6GJkMYiBQxnNqh6GD0sBkLIkN00TYrM0JnJq6UP?= =?Windows-1252?Q?BCyHYJpDX85j04Sj+YlOSZKeFTHF3vuQVUqnk8O0DZgyLAvj3nTLphTl?= =?Windows-1252?Q?m0dqOvIP0ytMYo4rFBIEU48Rdey/gvq2xs7ORKejhSB4ACuGe5HZEt+S?= =?Windows-1252?Q?6iN+SSvXb6kKUeGaTF3MpYGtNixnB6mAQ7SsVUJ5J1vPVRKco0Fa7khf?= =?Windows-1252?Q?pJbLDZr8mtwxlDNec3TwmR8V+AKK0fnhIHB+jsHT2teqPId9ZBIJ6REW?= =?Windows-1252?Q?28wFsdQuBYm+CE6a08qAZFHVEH6Q0pEpA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB0969;6:arFjBzuOK2LQDL4EhJcmR/IaTwz4KCreOpQcsGwLLBwvPYQhbuNrwWFjX4gmiGaPQSdvjlCJg0qA0GA18ppKpqD7QRyIF+CeVJM6xT3SwiqzTb1PcquonoMIiGNnyhoYaT6ya6nSL175Qfd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(UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 534bc27f-f6e0-4296-bbb1-08d5474f629f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR15MB0969 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-19_12:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1056 Lines: 27 On 12/18/17 10:29 PM, Masami Hiramatsu wrote: >> >> +#if defined(__KERNEL__) && !defined(__ASSEMBLY__) >> +#ifdef CONFIG_BPF_KPROBE_OVERRIDE > > BTW, CONFIG_BPF_KPROBE_OVERRIDE is also confusable name. > Since this feature override a function to just return with > some return value (as far as I understand, or would you > also plan to modify execution path inside a function?), > I think it should be better CONFIG_BPF_FUNCTION_OVERRIDE or > CONFIG_BPF_EXECUTION_OVERRIDE. I don't think such renaming makes sense. The feature is overriding kprobe by changing how kprobe returns. It doesn't override BPF_FUNCTION or BPF_EXECUTION. The kernel enters and exists bpf program as normal. > Indeed, BPF is based on kprobes, but it seems you are limiting it > with ftrace (function-call trace) (I'm not sure the reason why), > so using "kprobes" for this feature seems strange for me. do you have an idea how kprobe override can happen when kprobe placed in the middle of the function? Please make your suggestion as patches based on top of bpf-next. Thanks