Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6200092rwd; Wed, 24 May 2023 12:11:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ75wusErY9/ciBAXXci3BDdaxbRt+Bg3qjvX+iA7x6Zh92uDpp4ujVe1MTXZC9agk8xKA1x X-Received: by 2002:a17:902:7785:b0:1a1:dd2a:fe6c with SMTP id o5-20020a170902778500b001a1dd2afe6cmr16993198pll.53.1684955499693; Wed, 24 May 2023 12:11:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684955499; cv=pass; d=google.com; s=arc-20160816; b=iE0xHRuQCbKxQj+pzWtGLCmFliE5aFv6LgVew0HbJsRV93ccsqW02e4thma60SrpeF qCqwOUtiEbYj3nrPnR5TIByE0IXqZTKQeYnEvGMbgdZfVpbpK0ZOBF5mP5ekgVabfLpA GzaB8dTAn8PKDvMhDIQ5Gacy7KdtIsqTeg6MfoGxBBTOsGbseiB6ptwP7QWMO29SuPnl q4RyThfkm47KFaW01jkFk0BkZdwLFciqYF4erodwj0vPWj4mwgDgTUjR/5JH/FrF5D6k u8VQEH45g6L1yaY1xWkYLwQawsyCy1+2yZNZ+zVxya4IRS+uAdsPYmJ9eNMOITavrnPD pEYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=OwKabPI/qbsY2au9QNofyNdNfZC+++mL1WhYgrqgMaY=; b=nBFMbhfJzcSTKmAIDfonMx9rwjKDNa1zvzbZ7TZnCztscf18VCuJqpFbK0uxwj3JbY ZhDq0HJ7hAhD1HGocsA7NHpguD0MO3TsmgpKD9axEZhflAzce9uXvGNBGkU7gwAmuFbv FBpE/uCet2ZLmN/HCYI4mz76wn+ZO7Fa9OLs1VaUJ0evNdsCPKljumBPiJVeCT6v346g Z7Vi7Yg92ZDXE5xx6uUd4/4HNWIBqd38okLF9zQlPOd4UXTi/WgNGeMU6VmT7m8k+5+G VjBb/VscApWCyKWTd+WNaHkgmxrp2Y+YvhJJYB9N+4F/B1peZcOOhpxmf41FpWgm+K/Q VRTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b=LyxlKMP6; arc=pass (i=1 spf=pass spfdomain=meta.com dkim=pass dkdomain=meta.com dmarc=pass fromdomain=meta.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=meta.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020a170903110c00b001ae8c269c76si8992718plh.638.2023.05.24.12.11.27; Wed, 24 May 2023 12:11:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b=LyxlKMP6; arc=pass (i=1 spf=pass spfdomain=meta.com dkim=pass dkdomain=meta.com dmarc=pass fromdomain=meta.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=meta.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236201AbjEXSp7 (ORCPT + 99 others); Wed, 24 May 2023 14:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233796AbjEXSp5 (ORCPT ); Wed, 24 May 2023 14:45:57 -0400 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 334EEFC; Wed, 24 May 2023 11:45:56 -0700 (PDT) Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34OHFv8n024882; Wed, 24 May 2023 11:45:28 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=s2048-2021-q4; bh=OwKabPI/qbsY2au9QNofyNdNfZC+++mL1WhYgrqgMaY=; b=LyxlKMP6phdGbdFcoEd1MHBAhQvbD5CYnUlZlPLX1ao23rL2pTul0c4bts14xwOVmDLO 93/Z/IKJ8i//TWyJkAciDNv7BAHxNtneq0yYFwXC3KqPzu5T97HLkrq7mgzo4w6a8GSH QSwfioAvjMLfzcDZpMNBz7myESZJ2aPnNOOodLbZEV7vpTWBvMJ+7oxi3KQjasujVBIr PSwNzDKNN0tAbhwakFOoLian32dluk6spP8tNfqclp5lN8fM7rmAV+wbPW2sHnckseua Thd9SjmxKDJ+pra1HwhzwSExGjJyCHv0XCN96hZD6UwuLjaMF4cHck8AJ+CnezWnvibp rg== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3qsctfw0df-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 May 2023 11:45:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BCDPUVsT5mrBU/TmU/PLY/0bR6TvyWjozFmIQQ9+3MgV06H0NRpXESWJuYNLfFvTPDIFpK4wXypxrhiTyxuZ20YbSpGpezjxWsLcW13k+q3awEmbpiJUwxs6czTyQr76RmJSrFyxF0gpXnD5Hfb84Q5pQU6lGazyTso1ZCy9jZzpTPheoBpWFiP0VmWTmpjcMmbJBZU7dzNmQnaotBDKAcF4D57ZkJ9khxAxIPKpQXoTgcnoojMZP4ujvSQRd7e50wxI5RFB63nIHBCHeI7EZmwBCd5epP3lfAjQF13kvqjJX4w+YG/Rjia+VxKWjkBqgmdZIcWrBAexilBzLj9gRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OwKabPI/qbsY2au9QNofyNdNfZC+++mL1WhYgrqgMaY=; b=eF7qqw8b9URI6wI0lcBn65bnZoi5y9f8GTx6gst3gJ8olYhWyqyHKt2nSNTG1CvQxsIWZTGG/LsD1uGevLOwWnFYJde4wYkH3DgW8Q6isWx5VMDjXPl+VUXIwv1gOFs26Rs09HqMTX/dkaHO2vYFJbepMFWR8C+sUKdEm+avSvhm+AwO7j4+7toGya0jONYaVSwk+cVeBEi1Q9KbVQDxcTou4sUKkrxzPMHAJTVN/hlV70dWQbFju5blTXq6m9F1ebFlnA2u7/eW6aYTkjiCnQ4KMQQadr3Wpca9eQiqn24Ks7X5MsBU9X/vInrsH1bHYfnNUiXReriFLMeBcn4tZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=meta.com; dmarc=pass action=none header.from=meta.com; dkim=pass header.d=meta.com; arc=none Received: from SN6PR1501MB2064.namprd15.prod.outlook.com (2603:10b6:805:d::27) by PH7PR15MB5713.namprd15.prod.outlook.com (2603:10b6:510:279::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Wed, 24 May 2023 18:45:26 +0000 Received: from SN6PR1501MB2064.namprd15.prod.outlook.com ([fe80::589f:9230:518:7f53]) by SN6PR1501MB2064.namprd15.prod.outlook.com ([fe80::589f:9230:518:7f53%7]) with mapi id 15.20.6411.028; Wed, 24 May 2023 18:45:26 +0000 Message-ID: <186025b3-cea2-f07c-d2b9-8eadff6e0f4b@meta.com> Date: Wed, 24 May 2023 11:45:21 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 2/2] [v2] bpf: fix bpf_probe_read_kernel prototype mismatch Content-Language: en-US To: Arnd Bergmann , Arnd Bergmann , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Song Liu , Steven Rostedt , Masami Hiramatsu Cc: stable@vger.kernel.org, Martin KaFai Lau , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Kumar Kartikeya Dwivedi , Dave Marchevsky , Joanne Koong , Peter Zijlstra , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org References: <20230523194930.2116181-1-arnd@kernel.org> <20230523194930.2116181-2-arnd@kernel.org> <3c029fae-cb42-5a75-2858-7b8fc56a8769@meta.com> From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR11CA0084.namprd11.prod.outlook.com (2603:10b6:a03:f4::25) To SN6PR1501MB2064.namprd15.prod.outlook.com (2603:10b6:805:d::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR1501MB2064:EE_|PH7PR15MB5713:EE_ X-MS-Office365-Filtering-Correlation-Id: 6976d14c-8947-4f2b-cd94-08db5c8709f8 X-FB-Source: Internal X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vlc6W+kCiDJMQ7z3ofSnHTYklv2k06h6zR2nwq6QLisvyGj/4J9KhtuSIKQAlmMdHXUXgsM502pOQmBlYAmhgAgZnLMyDJDtxpguJa3h0ZUEhyvXhsg+tBEE+nqn31PT6MGEDP1eV6ogmpL+RH+afrrgA1/6ucq/1arE2BxuI4HgGQ6azy9v0EQUEFkPVSJs+YSLZ5EOF9rB3kQoYNbwnAapdgM3FKHQrPHlRB9axCmbJLuhrvpS9TeCJeSD/xgywT7nRjFnjfMHNJ198UHH+QMLtRY8y4WgTbUTu6K3KKxxG+EHPIuw3p6/SH/h/BwpAOYU6HRiLeMWkc0sMgnCvmWjylvxZV7KsxJTROrAcDYOdeSbtG0LOE8uxDuLb2u2CHCpx6T+axpCM/WPyf66rzTuXMJJKtF7X8g+ymaMdTodPmUv6lO3puuRa4pi5TaF7y9VlYLXcJ3WbD7E7OwoRuv1Yhss1ASrTaUYOsem2LZPplzXGPzPuQxq+yCcNT07L5wgOnklZe2mjPrjNT9YkZw+Hc8YI7SpM8XFJKgBW/dd6Vwc6VwmvVw91onJG6pkl1bTXgcnIkbDFPLFNdtIJWkZiufZq+pUOpar0swiVireA8wFZ8DkStn1WKC5bOcLm2qOeH7IpGmsy/M8Tz54Ww== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR1501MB2064.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(366004)(39860400002)(346002)(396003)(136003)(451199021)(8936002)(8676002)(7416002)(5660300002)(83380400001)(186003)(6512007)(53546011)(6506007)(31696002)(2616005)(86362001)(38100700002)(66946007)(478600001)(6486002)(36756003)(66476007)(4326008)(66556008)(110136005)(6666004)(54906003)(316002)(41300700001)(31686004)(2906002)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UmNPM3U4dklsT3dIeDJrOXplSGwzd1dYOGxER2V4UUNON1gyZnhrYnZTMVZL?= =?utf-8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d5dTZJd0J0MlM2ampHREN5Y21s?= =?utf-8?B?blROTituYWZPUDFoYWxmQTQ1QXhKVEVVU2FQaDJENzhuekFHTVZqOFNKcmNN?= =?utf-8?B?T0Y3Ti9RNlFveUM3TjVzZ0E5TU9ObnBrWk5PWVFlMzhEcVh2RGJwZXo2ZzBI?= =?utf-8?B?RGx3UnlGSlJGeGlZb1RMa3c5SHJIdFFLbVl2K0dBSlBTN2p2YjY5OXV1TXlk?= =?utf-8?B?VjN6bDQ0bnBndEhud0J1eDB2aWxBaG5SbWZ4K2FhSHVYKy85Q2ROa2ZxV0Zw?= =?utf-8?B?MndJeFdaWmQwYWhVUmduWHB2UzVWS1BzWTJHekhKTHpBZnRwVGZkSHNleXRS?= =?utf-8?B?VHc9PQ==?= X-OriginatorOrg: meta.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6976d14c-8947-4f2b-cd94-08db5c8709f8 X-MS-Exchange-CrossTenant-AuthSource: SN6PR1501MB2064.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2023 18:45:26.2344 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 054BFSUmRrYzGrvgN/3ik4gR33aKtzI3Gw8yr5R11eckge34xwOI8NhCyFxsfE9e X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR15MB5713 X-Proofpoint-ORIG-GUID: wKl5gf1YMuhcYdRQJcKNdzU2iqI7MV-J X-Proofpoint-GUID: wKl5gf1YMuhcYdRQJcKNdzU2iqI7MV-J X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-24_13,2023-05-24_01,2023-05-22_02 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/24/23 6:28 AM, Arnd Bergmann wrote: > On Wed, May 24, 2023, at 05:12, Yonghong Song wrote: >> On 5/23/23 12:43 PM, Arnd Bergmann wrote: > >>> Aside from the warning, this addresses a bug on 32-bit architectures >>> from incorrect argument passing with the mismatched prototype. >> >> Could you explain what is this '32-bit architectures ... incorrect >> argument passing' thing? > > I've expanded that paragraph now: > > | Aside from the warning, this addresses a bug on 32-bit architectures > | from incorrect argument passing with the mismatched prototype: > | BPF_CALL_x() functions use 64-bit arguments that are passed in > | pairs of register or on the stack on 32-bit architectures, while the > | normal function uses one register per argument. > > Let me know if you think I should put more details in there. Please mention the function you try to address for the bug on 32-bit architecture is: u64 __weak bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr) which will be incompatible with BPF_CALL_3(bpf_probe_read_kernel, void *, dst, u32, size, const void *, unsafe_ptr) in bpf_trace.c. So you fixed this bug by using internal function bpf_probe_read_kernel_common() instead. Thanks. > >>> @@ -1635,11 +1636,13 @@ bool bpf_opcode_in_insntable(u8 code) >>> } >>> >>> #ifndef CONFIG_BPF_JIT_ALWAYS_ON >>> -u64 __weak bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr) >>> +#ifndef CONFIG_BPF_EVENTS >>> +int bpf_probe_read_kernel_common(void * dst, u32 size, const void *unsafe_ptr) >> >> void * dst => void *dst >> > > Fixed now. > > Thanks, > > Arnd