From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6F85C433EF for ; Sat, 16 Apr 2022 20:31:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D2D856B0072; Sat, 16 Apr 2022 16:31:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CDC8B6B0073; Sat, 16 Apr 2022 16:31:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7D816B0074; Sat, 16 Apr 2022 16:31:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id A609B6B0072 for ; Sat, 16 Apr 2022 16:31:08 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5BAD621619 for ; Sat, 16 Apr 2022 20:31:08 +0000 (UTC) X-FDA: 79363886616.22.B0F3DCE Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by imf20.hostedemail.com (Postfix) with ESMTP id B1C111C0002 for ; Sat, 16 Apr 2022 20:31:07 +0000 (UTC) Received: by mail-lf1-f50.google.com with SMTP id o2so18815637lfu.13 for ; Sat, 16 Apr 2022 13:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YLjXXGPCeZFoo0LSeAoNTeYQmnNJj43S9GqF3x/ym20=; b=SrSlzeiaQpCm4wc0MQ0m37QHAqoK9FT8MbEl9SPGH8rdWqMQedT7lTTS7GcsoBzJnC mwh/ajg/m0eG9+H3NUwn9OLJNGOLmtA5Tot2AAfRENjeYsH57sN9QT0cCZ6etY+bAiY8 POMTsc8VPFSI9b1QmVcOmHGCjJIie+BnfYtvE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YLjXXGPCeZFoo0LSeAoNTeYQmnNJj43S9GqF3x/ym20=; b=K1oKxhh4Sbalty7kzcbCFvS0UPCpfZuwiGE1NsnoKISJ5yaeBePkwmv2MXDHeUPb2p NGLDz5y7V5qyVh7AaloutD2pFBaynek8qUDtbtW0g42hPymWdCqc82iBLqMAYcfh1IOj teaVDl1c65Ht6oM9ee8O9KDXTNPEwSWj3YAsQHHy9mQKSWEVizxTyyJRB0JipA9FiWQa ouDonvHoJNHGS9jLyNACKImiWtOS6PHGr0NmN+yZzt4gcMArv3+5TE79MxCQUy3eTOLT rTzgiqloqo9/ftZGNPJoBBR646YSTryS13gFNGxEquWbMxscZxYezUHOY25M+lBwbudI pyNw== X-Gm-Message-State: AOAM530BnPJhupNSzHyadTNDnXJr1fBPOQJi9jwW/DsTvDScR3zTSBjN w6pbN9J4G/CSv9ah8I/ZZffbEoqpUkSeHMYkvoY= X-Google-Smtp-Source: ABdhPJxd40VXFv3Mey3FusAfsxfudQ8SiBwDH9VvDAhusxlDx9fNn+CTcNtxaHpupsL4PaLzqu+HwQ== X-Received: by 2002:a19:ad08:0:b0:46b:ae4d:2861 with SMTP id t8-20020a19ad08000000b0046bae4d2861mr3179437lfc.228.1650141065762; Sat, 16 Apr 2022 13:31:05 -0700 (PDT) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id r9-20020a2e9949000000b0024db3a9946esm146623ljj.110.2022.04.16.13.31.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 16 Apr 2022 13:31:03 -0700 (PDT) Received: by mail-lf1-f46.google.com with SMTP id y32so18864645lfa.6 for ; Sat, 16 Apr 2022 13:31:03 -0700 (PDT) X-Received: by 2002:ac2:4203:0:b0:448:8053:d402 with SMTP id y3-20020ac24203000000b004488053d402mr3175652lfh.687.1650141063333; Sat, 16 Apr 2022 13:31:03 -0700 (PDT) MIME-Version: 1.0 References: <20220415164413.2727220-1-song@kernel.org> <4AD023F9-FBCE-4C7C-A049-9292491408AA@fb.com> In-Reply-To: <4AD023F9-FBCE-4C7C-A049-9292491408AA@fb.com> From: Linus Torvalds Date: Sat, 16 Apr 2022 13:30:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 bpf 0/4] vmalloc: bpf: introduce VM_ALLOW_HUGE_VMAP To: Song Liu Cc: Christoph Hellwig , Luis Chamberlain , Song Liu , bpf , Linux Memory Management List , open list , Alexei Starovoitov , Daniel Borkmann , Kernel Team , Andrew Morton , "Edgecombe, Rick P" , Claudio Imbrenda Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: B1C111C0002 X-Stat-Signature: 3hfdm65pe4zrrgw6zxmibba11da6pz9a Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=SrSlzeia; spf=pass (imf20.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.50 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Rspam-User: X-HE-Tag: 1650141067-497886 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Apr 16, 2022 at 12:55 PM Song Liu wrote: > > Based on this analysis, I think we should either > 1) ship the whole set with 5.18; or > 2) ship 1/4, 3/4, and 4/4 with 5.18, and 2/4 with 5.19. Honestly, I think the proper thing to do is - apply #1, because yes, that "use huge pages" should be an opt-in. - but just disable hugepages for now. I think those games with set_memory_nx() and friends just show how rough this all is right now. In fact, I personally think that the whole bpf 'prog_pack' stuff should probably be disabled. It looks incredible broken to me right now. Unless I mis-read it, it does a "module_alloc()" to allocate the vmap area, and then just marks it executable without having even initialized the pages. Am I missing something? So now we have random kernel memory that is marked executable. Sure, it's also marked RO, but who cares? It's random data that is now executable. Maybe I am missing something, but I really don't think this is ready for prime-time. We should effectively disable it all, and have people think through it a lot more. Linus