Received: by 10.223.164.202 with SMTP id h10csp9427wrb; Mon, 13 Nov 2017 12:33:58 -0800 (PST) X-Google-Smtp-Source: AGs4zMassII7+tdADHXCbKntaKzS2PPz8VqEM9bgxUvGkVrfY3MKYzplupJdGyNKgC2lpom5MlXc X-Received: by 10.98.209.8 with SMTP id z8mr11041204pfg.184.1510605238842; Mon, 13 Nov 2017 12:33:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510605238; cv=none; d=google.com; s=arc-20160816; b=0bDpBD+QfUMBwOFOsWxwpBOwmDgAU3rSjKe1CIR1d/6z/tGQMR37DVwouOC6L/ktMZ 32RMXcvBqe8M0UhFQOVeh0v1eVCIsusesT9WNqwHJ00F2d6vqnvZ7Lkivgg76GbYM7g2 GPyK5h2zn4ivhWd7NohR4PjlVKbtT1sVFidponX4K42Ztsi6k2X/DA1ubjOCb+gpKfNl g9yfpQkU/KXtUgbVuY6Op+9wnuCms+YbvmPdrrR6Jz3mhGqPMxb0Z7EywroM3FrRQItg Fo1LhA/j+i7n+X6ZJkOP+3dWxCsdNi0mcDMTqA9zoByQu1hOHMlRCndgYngTms0chso5 UnUQ== 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=K34bZ9zUklouvVRFRQyZb+GaOX446xUjKzDBkS0kuc8=; b=GLnOdBpfljWU7XY5Z5U7UJkZmRRRiESXuiWq7UlkVmhWahasavXLM6RqwvmaggR4jt DO7k+ynamBJ4wbcMQwJ8+wJdDO2UCFcm6EEXXl7fxIfxySw9QqzzsOD5ZoDPdgQxW85b Qv/cNrZH0Gm1BUIPTFRpOtBfRxNli9oQp1YUA65jUOg5KYp0eSahf34Y37OxYwsmGPnT qT+LxpseyEuqlGUrImdfQ3D+u2BETFnK4z8cGk5QhfRcGDVCR6TPCZQMmSVn52VOUmW/ taVlTT1CdNRLKSZnF32B1SyAKxRq823INk1i2StDjwi3Oy+J46d2ieZ47+WTpt7RJTmk Mvmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=riUcnhp8; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=gjvf0ngL; 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 w71si16053780pfd.262.2017.11.13.12.33.45; Mon, 13 Nov 2017 12:33:58 -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=@fb.com header.s=facebook header.b=riUcnhp8; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=gjvf0ngL; 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 S1755519AbdKMUdE (ORCPT + 87 others); Mon, 13 Nov 2017 15:33:04 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:33630 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755185AbdKMUc7 (ORCPT ); Mon, 13 Nov 2017 15:32:59 -0500 Received: from pps.filterd (m0044008.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vADKTqjR016002; Mon, 13 Nov 2017 12:32:26 -0800 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=K34bZ9zUklouvVRFRQyZb+GaOX446xUjKzDBkS0kuc8=; b=riUcnhp8WA/bY9L+a/5AvMF/RaanAgj9G8GtUSulollMbFsS+WvxzCONcy5QbR5DRKw7 pe8VxaswayZu2Mv/KxgEacPBDahgEn2yW7ozeBRN5s0SbmvBH4HIWcLfvhuZNU9EDni6 FZiTUL/xUADMk/m95AaFT+zG+Ej5fpxU+I4= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2e7e2t129e-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 13 Nov 2017 12:32:26 -0800 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.21) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 13 Nov 2017 12:32:25 -0800 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=K34bZ9zUklouvVRFRQyZb+GaOX446xUjKzDBkS0kuc8=; b=gjvf0ngLH9cORloAz4E+OETNxivv+Z71jNMykgFf/adaTXlqRKMna72pzPwW6vKNh8kHLUIKP4SYA5SAp5hLw5vUOcwzohdcbybXqQfh9oChV6VNWXsiEMjf3vRwmQtk9BVmyy0hiXnpaiw1ogI6v8kccdl1ZV/C5yYIIPEzhq0= Received: from dhcp-172-24-229-77.DHCP.thefacebook.com (2620:10d:c090:200::6:5c0d) by DM5PR15MB1834.namprd15.prod.outlook.com (10.174.247.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Mon, 13 Nov 2017 20:32:22 +0000 Subject: Re: [PATCH][v2] uprobes/x86: emulate push insns for uprobe on x86 To: Oleg Nesterov CC: , , , , , , , References: <20171110172546.3185266-1-yhs@fb.com> <20171113125956.GA11516@redhat.com> From: Yonghong Song Message-ID: <6fdd9773-a0d0-7598-35d4-959bb3701d1b@fb.com> Date: Mon, 13 Nov 2017 12:32:18 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171113125956.GA11516@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:200::6:5c0d] X-ClientProxiedBy: CY4PR0601CA0035.namprd06.prod.outlook.com (52.132.96.48) To DM5PR15MB1834.namprd15.prod.outlook.com (10.174.247.11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9736b1e5-b118-45a1-f094-08d52ad5a585 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603258);SRVR:DM5PR15MB1834; X-Microsoft-Exchange-Diagnostics: 1;DM5PR15MB1834;3:jS8EweGJqXvAyzuFt25y3Iirz/fuEKob1kXvqh7qBf5HJMinjt7h+NL9TT1ZqhIib9yb0iK/baFb83Ncf4Bit1hI6ftHrFJkROHTxUDOkCLtAPgycHFJmAtxktEtfMYv3SfAIMgn87RxlLT2wM2QzsK8TL3LX8WwCc3Oech1NXWcTggWzb1vuIPRVSnMcUEIzJr0UAFu4LgnK3/ICzWyvPptatmeG5FPmjl2urbaMT4gKS9uk2R+CdHozvjUp24K;25:xsXtDF9GMoH54zypMtjVkKsesKOXuCaARWtKY4byeJ1dfPwjs39kgZHNjQMUjiJVmk/SXxrfymygUPhBTkZGrfJmbeJnsxqfQjRtBkQH5YVtLHYVmfOsa5ANUOHueFDoI05+XJ11C/jSyGwCgem4msBIDjU6Gw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ypN5eJK5zHTWQqCDPnIfW69Po+RzlvUbhDSxElzvgpEDqLHnDRonoHpSjddGBW43MdVqc+oRGaYX3otoW8UTKZ2a+O40TmKFLj4hvimdopx9/pBjK59jgx3YERXfTjMLn8owg9cbeSBYy1qE5U5AI6x9rgTRsuGIUcVWTjv4ZLrZySek/hik1qiWbHD/Y0LAomigxhro9Y7zrLp/iqa5pLghf5kUZA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(11241501159)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(10201501046)(3231022)(6041248)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR15MB1834;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR15MB1834; X-Forefront-PRVS: 0490BBA1F0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(346002)(376002)(189002)(24454002)(199003)(6916009)(6666003)(2950100002)(101416001)(53546010)(50986999)(68736007)(76176999)(54356999)(65826007)(5660300001)(8676002)(83506002)(81166006)(105586002)(8936002)(81156014)(106356001)(33646002)(31686004)(53936002)(7736002)(4326008)(305945005)(6246003)(6512007)(189998001)(64126003)(6116002)(65956001)(65806001)(47776003)(6486002)(6506006)(230700001)(229853002)(50466002)(67846002)(2906002)(86362001)(23676003)(31696002)(316002)(58126008)(25786009)(478600001)(97736004)(36756003)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR15MB1834;H:dhcp-172-24-229-77.DHCP.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: =?utf-8?B?MTtETTVQUjE1TUIxODM0OzIzOktBdkhMTFgxMFZvUGxaTmtKTm13Qm1ZZ0tz?= =?utf-8?B?WU9oRGh0bUFHajlNUmZONGUwSFRPMi9pQ2JtSGlxdytTZjgxMkxpZ2pPTFRD?= =?utf-8?B?N2hyci9oSGNoY3pvY3E0MjNRYUExdHpiVmVoMlpxZTlIaEU4c2VZbjVzREtX?= =?utf-8?B?bWFRS0FpWlAvSDNMSVlxbFZBY3B3aDRRcWpDY1FjYUc1cUN1MVBmc05vc0w3?= =?utf-8?B?d2x6Ylc4MFVJRXYzZmx5djYwMm1jVXJ0cHUvaWYyZHJFMGM0bis2ZitCTFRv?= =?utf-8?B?RG9JWGRPVWdnYWhabjI5dWpTSnFIZXkwOVhsOW0wNDVsNXh0b2lWUnhVTDdR?= =?utf-8?B?L1VmV2pTczdIK3A3czRPcEVBenp1VkU3REUwUi9DQXhMaDJDQ2RvQ0gxZlBr?= =?utf-8?B?N3ZDOThFMEtGWHY1K1RmdnlMeFJpOHN1K0ZJZkpMTy9SdFh0TnlVNUk4bXpR?= =?utf-8?B?NUcyU0xldDAzYkhDNEhyekUxQWhZMGNyS3R0KzBreGpMOHBjR0xVV0Q1L2lM?= =?utf-8?B?K2JScW84dityZG5YZC9UMjBEak82Nmt6VEtwd3g1b2ZyRW1Vd05OdVN4MnUr?= =?utf-8?B?TEtxMTFsUDBFRkpRSDd1RXp1TjlCcmVDb2UyQzZjeWx6cFAxbzN0cWNTM0JU?= =?utf-8?B?clRCYlRISm1YUTRXS0UxeHV0MVByQmdXMENmcnA0azFCdXl3Z3RRR2poandj?= =?utf-8?B?ZjV6MURwNlVPSHoraEc3R0l0cGtxNEZVeXFVZllPRVJSa1BNNGthUW82ZVZ2?= =?utf-8?B?Uy9jc0JEbUVMVG9GZUJPZkFvSkdlL2QvckYzRTJ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HSuaS4UZWDoixB70FhfcSRDK3n+X7gjTjchDumVjNtn5Eelj8IjXgqPSQwdTy3oyQzwYdUP4RN2nHJLFxlnYGOQ2gLyKg3o3zUsaHfg5CEi0oUVaD+jkhOHw33fdLPhZ0DzwooORyWun/kLpTcy+0JknkehsyYHFKSLk= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2017 20:32:22.5274 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9736b1e5-b118-45a1-f094-08d52ad5a585 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1834 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-13_11:,, 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 11/13/17 4:59 AM, Oleg Nesterov wrote: > The patch looks good to me, but I have a question because I know nothing > about insn encoding, > > On 11/10, Yonghong Song wrote: >> >> +static int push_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn) >> +{ >> + u8 opc1 = OPCODE1(insn), reg_offset = 0; >> + >> + if (opc1 < 0x50 || opc1 > 0x57) >> + return -ENOSYS; >> + >> + if (insn->length > 2) >> + return -ENOSYS; >> + if (insn->length == 2) { >> + /* only support rex_prefix 0x41 (x64 only) */ >> +#ifdef CONFIG_X86_64 >> + if (insn->rex_prefix.nbytes != 1 || >> + insn->rex_prefix.bytes[0] != 0x41) >> + return -ENOSYS; >> + >> + auprobe->push.ilen = 2; > > and the "else" branch does > > auprobe->push.ilen = 1; > > you could add > auprobe->push.ilen = insn->length; > > at the end of push_setup_xol_ops() instead, but this is minor/cosmetic, Will make this change in the next revision. > > >> + switch (opc1) { >> + case 0x50: >> + reg_offset = offsetof(struct pt_regs, r8); >> + break; >> + case 0x51: >> + reg_offset = offsetof(struct pt_regs, r9); >> + break; >> + case 0x52: >> + reg_offset = offsetof(struct pt_regs, r10); >> + break; >> + case 0x53: >> + reg_offset = offsetof(struct pt_regs, r11); >> + break; >> + case 0x54: >> + reg_offset = offsetof(struct pt_regs, r12); >> + break; >> + case 0x55: >> + reg_offset = offsetof(struct pt_regs, r13); >> + break; >> + case 0x56: >> + reg_offset = offsetof(struct pt_regs, r14); >> + break; >> + case 0x57: >> + reg_offset = offsetof(struct pt_regs, r15); >> + break; >> + } >> +#else >> + return -ENOSYS; >> +#endif > > OK, but shouldn't we also return ENOSYS if CONFIG_X86_64=y but the probed task is 32bit? Just tested with a 32bit app on x86 box and segfaults. Yes, we would need to return ENOSYS if the app is 32bit on 64bit system. I may not be worthwhile to emulate this uncommon case. I will use mmap_is_ia32 or a variant to test whether the app is 32bit or not. Please let me know whether this is correct approach or not. > > Or in this case uprobe_init_insn(x86_64 => false) should fail and push_setup_xol_ops() > won't be called? > > Oleg. > From 1583957636462398446@xxx Mon Nov 13 13:28:36 +0000 2017 X-GM-THRID: 1583700940287669077 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread