Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3236506imw; Mon, 11 Jul 2022 04:56:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v3XoANUppPCcCSVlC07GvH8KHYScNW3XqrksQLeexGeGmNf0kFWBQrg3ilCLmGf4ja8sH6 X-Received: by 2002:a17:907:6818:b0:72b:5bac:c3a3 with SMTP id qz24-20020a170907681800b0072b5bacc3a3mr3090028ejc.139.1657540603739; Mon, 11 Jul 2022 04:56:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657540603; cv=none; d=google.com; s=arc-20160816; b=0UjE2+RyUqvAlb327q3UDwVGGdGYgNi/o+UVxPJSMpminKdx2YvuBG7KrnyEND+j+k XzxW8flzB4iJ3InqMebPoXlZO5Ya6jE9wZTg3rFPfiH74JNa1Xdea84ABGGZ+W4jCct6 KZZkBlGZV2sLB/a/XLlRrp5lpeZoJceTU9gw8g+Iq3ks9GPxHgz0XrPVlhVltRSoz2av sM+zs9em8plNNjrvx6wUM+P5rsDsKID8l4/lH28K3yY1GHwwELS6krq0lV61rPEJbh2o JRKUjBS5OzHEvS+KmpmVrEVCpFKWADRD4N3J0Fm96k1BoLQaztOKKyme9sj16Zf/eWcq xqmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ZVC5+vLlHSkEVu0gdtlphAcJ8c2U3360hXV9M7aAdQE=; b=0yqtcvtRAHBHlS8fpErzIobpD9fjWdbGVihHrIG3oXw4bbuQYhui4fx1kF4Pb+wTcu 9dJRrWaTg3BBRio7tSC31MhALNDmeiCdsQaEGdDwRYUdsR0mFA4PMzmofSJIQ1ornP/i pFLscPkoyNKHYQdaBc5y5ppxt/qMk73mhSZmePKW32zdh2PZwy3Iz2nwBNL8BvTZYqNt sl0YRqd/YYG2VffdlZ9PeQED/OcC9fe7GYGiollvv9n4amPiwMJRtCSo/goTNMkJr1VX T3k0RennZ/u70e0Bec3aUCP07NR0DUYDN3w/KkcNtLMdel8rjuB4qLIvCnW7nBmfAzv5 KDRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U+uRXeE6; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a50cc8c000000b0043639a0b48bsi10519988edi.276.2022.07.11.04.56.19; Mon, 11 Jul 2022 04:56:43 -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=@redhat.com header.s=mimecast20190719 header.b=U+uRXeE6; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229668AbiGKLtD (ORCPT + 99 others); Mon, 11 Jul 2022 07:49:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbiGKLtB (ORCPT ); Mon, 11 Jul 2022 07:49:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D6104B84E for ; Mon, 11 Jul 2022 04:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657540136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZVC5+vLlHSkEVu0gdtlphAcJ8c2U3360hXV9M7aAdQE=; b=U+uRXeE60US+CaWoTf7svBw65q6NhPiGp7or5PoDAbbR5vwUhodTbiECMuYcDk1YxBKzXn euRPPIbXgBQDHMESxb7+q7Y3+NK9QDklFnMbT1EwWwETWNgyylRz3xmmGTxWNzRzC3Wc5M x2m7RhC737gemIWKKLtf4nCvpjpE+Rk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-619-wHLVoU5ZM82MtN1MmMIylw-1; Mon, 11 Jul 2022 07:48:55 -0400 X-MC-Unique: wHLVoU5ZM82MtN1MmMIylw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C8ABE85A581; Mon, 11 Jul 2022 11:48:54 +0000 (UTC) Received: from samus.usersys.redhat.com (unknown [10.43.17.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7DAA61121314; Mon, 11 Jul 2022 11:48:53 +0000 (UTC) Date: Mon, 11 Jul 2022 13:48:51 +0200 From: Artem Savkov To: Jiri Olsa Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrea Arcangeli Subject: Re: [RFC PATCH bpf-next 2/4] bpf: add BPF_F_DESTRUCTIVE flag for BPF_PROG_LOAD Message-ID: Mail-Followup-To: Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrea Arcangeli References: <20220711083220.2175036-1-asavkov@redhat.com> <20220711083220.2175036-3-asavkov@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,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 Mon, Jul 11, 2022 at 12:56:28PM +0200, Jiri Olsa wrote: > On Mon, Jul 11, 2022 at 10:32:18AM +0200, Artem Savkov wrote: > > Add a BPF_F_DESTRUCTIVE will be required to be supplied to > > BPF_PROG_LOAD for programs to utilize destructive helpers such as > > bpf_panic(). > > I'd think that having kernel.destructive_bpf_enabled sysctl knob enabled > would be enough to enable that helper from any program, not sure having > extra load flag adds more security I agree it doesn't add more security. The idea was to have a way for a developer to explicitly state he understand this will be dangerous. This flag can also translate well into something like a --destructive option for bpftrace without needing to keep a list of destructive helpers on their side. -- Artem