Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5088201rwb; Tue, 17 Jan 2023 09:03:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXvFPfujzs3RoiAePd41LNOdnymdVjlfjbh1nj1yU7x8FiPoKJVHmemUGTVlYoD78g0IynxI X-Received: by 2002:a05:6a20:8b25:b0:b5:c352:1fc8 with SMTP id l37-20020a056a208b2500b000b5c3521fc8mr3821085pzh.15.1673975009710; Tue, 17 Jan 2023 09:03:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673975009; cv=pass; d=google.com; s=arc-20160816; b=ALxxVA0WyL5J7YA9HiWF58UjuEh8KfH7+CJ5d7SpmH1wa35YcY+dWvuL3al9tVkV3J VMbGNP5zlcMHa5Ym6y4YoCZVaLh62v73bjhlignDKJLJQxejVP4iyBqW+Rok9mBi/YI6 nNCC3rMrfMAaTguIScbtt/LVLaFG7Pm0fG9RrokZOb4daLBsfWkz4JUxHrBBOrJqtzh+ iJ84oZzYypOsnnsZeq9c5hnMsPdLXr+NYtuy9elNMHSkyvIOhtOoBPuL2NdBsBKFRzHz OEIfm2TGUfg+ee98elU4sUOxSkI72RrxkZPuHyGtv6NdOKqxcIgZyF6ylnjfMxCzW6Hq H4Dw== 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=1aIjLvkhEr9ZvjMB6hae7XlMNQADqTuW5rG6Xt2MrpE=; b=yhdgnt6ttbkhqahUWvi4mvfDWisgISs3fwH6heA4a6uIc7eJu8kJTNHwWoXuNchQbD gMsXChcnCS8DRPb854l86znN1WpTxpJ9y7IGI35RS0HthFwCQVSSxQugD4F3NfTPT1/N Bqt3uMxD/fmtcrY7BqzWcqI0k4fkUWUqrjlRYibhZPRxhc0jS6m+1mGcKuNU6D8Ao2y1 3S25O9p5A/r9Xhz3o5QUVDQXRBz407PEpWyhRq4apddXndDzhJxERxyU6iQCLcaF1DT9 2ey+QhmoeX8pc3wors/NSU6XCEp7LvOkM4jfBcWCTLKYK6QbK7tnueGIM1k1rmNxokKL 56OA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b="P/sAcZ3W"; 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 d9-20020a631d09000000b004c5936dd6e1si13972229pgd.201.2023.01.17.09.03.23; Tue, 17 Jan 2023 09:03:29 -0800 (PST) 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="P/sAcZ3W"; 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 S229614AbjAQQW6 (ORCPT + 48 others); Tue, 17 Jan 2023 11:22:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232426AbjAQQWe (ORCPT ); Tue, 17 Jan 2023 11:22:34 -0500 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3903441B77; Tue, 17 Jan 2023 08:22:33 -0800 (PST) Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.17.1.19/8.17.1.19) with ESMTP id 30HG4Ebr020897; Tue, 17 Jan 2023 08:22:09 -0800 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=1aIjLvkhEr9ZvjMB6hae7XlMNQADqTuW5rG6Xt2MrpE=; b=P/sAcZ3WFkkDjXQK2rIMeVKbL7b+Zs5OTXsciBNINI7+E6sXU1Xcy3m6HFIhFgV6IF79 VfJS8Bt2COZou8jgcfjLFDRmBDvaPZm1TcTtIUBYPzFA4RBb1OiuvNWwVTPXIZKFt9SX YBgeN5Y46aabXQK+o5q38f2VZdPw76F4hjBF9rh1zlxzBjmq7cBYOHS5K3X+vHm79hlB 5qWqgoFbzVp9FDkxa9InpCntTV5YQ3Wmur03UADnhKlg8FOyZoYPfSYNTex2EiBFIL/j QyRz0c+csapQEgw0s2bX1FYGA1vp5UftuOE11VXN/J2/myGuxslwLH8x7rSgReVG7kqB +w== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by m0001303.ppops.net (PPS) with ESMTPS id 3n5w8ggq0t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Jan 2023 08:22:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QoDorVaJGd1R9tc0Wi5TKwLVgiaOSM3CXg70ePWLoRWt00mUNJz32SMvpRiuGUgjxweeOJp8iScl+Gt+ZQk1S3eZO7xFNnxTGLVDAlwHlxv+R/Ae5E8MOtlO52lzQ/tmz3dExVYsjoWXOm/iELo82ZOynDAWEyBg8Cof9/06RSLX1d99vyvMixx3Vg/w3/F5fTujXEPsxM9AnKT71pwRmWkFtbqVu+9eVSAbsUyDemnS0MoBIwqmW6n3ecWg+YFVV6SiR3wKkHqou20i0lE4+lzknuxjTmsHNAMRdMdoWsabNYuPyGObQXakxGGJTfyGOLCytuiLXj1rIlyMhdRwSQ== 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=1aIjLvkhEr9ZvjMB6hae7XlMNQADqTuW5rG6Xt2MrpE=; b=QTUc1fzlAxNpTU/7fpxaaTYDgfEAeoGJGBGfrDmru85wuGzD+h3SFC+WNK1OUKz6HqM9JVmPQvIEqXA8VEuUJReRYauiEHlXqv1ODH5ZqS2sdpOuTXhv0C/Xu+kJEzJW4aLDUICgDJo3kQD6Kh4kMdykdI+4RNM3ZVk4qj4bdn4ewNhz0Xj8rT1HLy9iKLq+fjG3xZ9U60AursOVgrFKt23tymhQqwDqZlEOc58Y/q9WL/imlu9IXhw8S/nL/jm9qARGsuwZl5xarAYoOvnZCluXsdFAut6ZO3hgaQJdPuGe4dYLHMmXbR5ctSnRovtuv76X+8Eugcl4WP3R0wbQrA== 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 PH0PR15MB4575.namprd15.prod.outlook.com (2603:10b6:510:89::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Tue, 17 Jan 2023 16:22:04 +0000 Received: from SN6PR1501MB2064.namprd15.prod.outlook.com ([fe80::3cc9:4d23:d516:59f0]) by SN6PR1501MB2064.namprd15.prod.outlook.com ([fe80::3cc9:4d23:d516:59f0%4]) with mapi id 15.20.5986.023; Tue, 17 Jan 2023 16:22:04 +0000 Message-ID: Date: Tue, 17 Jan 2023 08:22:01 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] tools: bpf: Disable stack protector Content-Language: en-US To: Peter Foley Cc: Eduard Zingerman , Quentin Monnet , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Nathan Chancellor , Nick Desaulniers , Tom Rix , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, "Jose E. Marchesi" References: <20230114-bpf-v1-1-f836695a8b62@pefoley.com> <194f38f2dc7d521375e5a660baaf1be31536be9a.camel@gmail.com> <1135125e-6b8a-7b75-5f0b-3208f6b6e8ae@meta.com> From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-ClientProxiedBy: SJ0PR05CA0150.namprd05.prod.outlook.com (2603:10b6:a03:33d::35) To SN6PR1501MB2064.namprd15.prod.outlook.com (2603:10b6:805:d::27) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR1501MB2064:EE_|PH0PR15MB4575:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f585e5d-fccd-463f-b953-08daf8a6f86c 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: QcCX5byZekPnagF0MNxH8q+pFn4cyUVi8vwbLu9kltekCfVsQ0l4KA10F+gYyMWvmy5BTr/EorA9Ls0TkiI2GhTnwdwYWPZXQysYi0vhjDBLdnXh3QwYnQ/FjZEPHlls79qW/xjHSlRG6pGdiwkWpJLSL1BXdsh8doVxbz4AMq/UHGrSs3uegDoyhT0ICa4EF5McmmzMsibanyeAi2MLJXkKgRkTqDtHAkqQnkTPnY0rJYYh4MavGbuvno6BDM5AI3vp8JpHb7mzMpGiQ5hkalg0vlQ3zWp8s/QxOmoOkp5mUuVMc/innMDMCjpVRrBlNeXCVLWfmIDplUKNYrp0ZCdpe6qh9/UjKmQjJ83pKSOTECVRuP11H0Y4gpXlFH1o7hnKY4dturwtIzceGvyx5g8eba6edlly22FSkpxHp6+HxH9gRsL5eyXpqOQbVVzTjgk1/gCGkkix3xGh1BecTZ1XUAGKK3X5EfqZWJpZHZRVzKmmfzHXLEfLTkuTX7kg3kASsg4v1ZD9awu8kq0Hs8tZ/m9v4qz1SaHMsDXsQf8o9P+o77qDU8FPQf+4KQ0OLlC3/gBo7K5OvUv59xAH4JO27tiCUXTyKqlbb8VKUi3S8YRh5jYl79nCXjTsyGCWd918H5ETk8nCkayfq3imS1dnp9hqyicoDHnC8gs5flKotfjxyB2FH/6dt/8DFpNmsYxa62LGaLF5RK58liljbDyjTcdIVbXMaHyfHPBElQHoKfQc1a1R8sSEy9tBugJO8bEOEm10G/BLJ3vB7SBSpQ== 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:(13230022)(4636009)(39860400002)(376002)(136003)(346002)(366004)(396003)(451199015)(31686004)(83380400001)(6512007)(53546011)(66556008)(66476007)(2616005)(186003)(6916009)(41300700001)(8676002)(4326008)(66946007)(36756003)(31696002)(86362001)(5660300002)(8936002)(6486002)(54906003)(2906002)(478600001)(316002)(6666004)(4744005)(7416002)(38100700002)(6506007)(966005)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-Message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UZTFyb05UMVUzNktjTVpXeW5mRThi?= =?utf-8?B?V2lTUHRaVXkrZzB2WHNKSGprb1dET1h4dmdWNnFGeVQxQWl4TC9Oa3EwaU9L?= =?utf-8?B?Yk1jVGQ4MmlKWUNtTlp6REwvWDhLUk52YzU5QmFZZTRKeEFlSHNWMU5aNkR1?= =?utf-8?B?clVzQS9YT0xpMDBxbmxQN3dSQmhmL1dwRm1EZDN0dVo3K1BrNnA5aFdMU2xi?= =?utf-8?B?d1E1SmN3cFZRY2E2bTJnb1ZBRXRReUM0Zzh2RGJKMlVIQ05RUXVDZmplT3Jh?= =?utf-8?B?TWcrK3JhUWxYNU9KNVlKdkRUWjZpRXN5SWMvRHo2MzEzSklnS09aUWp2eDZu?= =?utf-8?B?UTN0OHVwcCtRc1VhU1hOdGNvMWJFZTU2ckdlbWY2eVpBMWNkZTM2ZkM3bWtD?= =?utf-8?B?UVE9PQ==?= X-OriginatorOrg: meta.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f585e5d-fccd-463f-b953-08daf8a6f86c X-MS-Exchange-CrossTenant-AuthSource: SN6PR1501MB2064.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 16:22:04.5293 (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: KxZuCaShOIXU0EoiMxCRIKIcR5TB2m5kPY9fTzCzu6RqKD1t9eaYidVOJCeRVwo0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR15MB4575 X-Proofpoint-GUID: yUjqlxE4ZOvLIMoS4VhX3PLXMGJeN0Q_ X-Proofpoint-ORIG-GUID: yUjqlxE4ZOvLIMoS4VhX3PLXMGJeN0Q_ Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-17_07,2023-01-17_01,2022-06-22_01 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_NONE 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 1/16/23 11:09 PM, Peter Foley wrote: > On Mon, Jan 16, 2023 at 11:05 PM Yonghong Song wrote: >> >> If I understand correctly (by inspecting clang code), the stack >> protector is off by default. Do you have link to Gentoo build >> page to show how they enable stack protector? cmake config or >> a private patch? >> > The relevant override appears to be > https://github.com/gentoo/gentoo/blob/c5247250e9d4a09e67a602965a5f72be3cebbf34/sys-devel/clang-common/clang-common-15.0.7.ebuild#L93 Thanks for the link. Looks like this is a security feature added by hardened_gentoo progject (https://wiki.gentoo.org/wiki/Hardened_Gentoo) which unconditionally added -fstack-protector-strong to the clang compilation flag.