Received: by 10.192.165.148 with SMTP id m20csp514423imm; Fri, 27 Apr 2018 03:00:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqAO/V2yiB6dei4nn+SKsUQtZIYCDzfiJM8kyR7EQdkHFemOwoUyXO5XAJ08Dumthm4mC9j X-Received: by 10.98.137.219 with SMTP id n88mr1596047pfk.11.1524823249951; Fri, 27 Apr 2018 03:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524823249; cv=none; d=google.com; s=arc-20160816; b=BWlAYRWzjkzz9BNC2mJdaLgdbgZI0/NxgIIE5ZrN8qJcAakRkzEBTCw4GUwhZ8GFid HkFSv0yfCeRo0TwAc0MRCz5lUJKW5tJw8EhgVxibIJYS3p+/FldTELkMpqcGko60rm/b AaQemh+jILzGJ2Ad/+6M9Ds1joO6oFQP5oCLeR1XQexo/rzUIBW6NviIlOkGpspCwbzN au0+NMCQA3hir2raEtuyr5GfzRzHVoMV9H6RELBHfC7xM+ybq3fvjU7azWFlrWShH/BS jgaf+thFGaCXgEuT8E25vvpyhDCd8U4n4HceUhe3fHF++sL3lPMGw7SNufUlE7vQQN7B JmPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=hHmInkPMofp+bAhHjLNkp78xi0PEQ2iWh9uRnxJL+qc=; b=atpnM8M/8EpVstoiZPWssGqdCSJsoxiIuCMyyyavVCJ8n2po9AKcMDDOVtlq9nO/JH 4U2PoSyqCFywAyWjdPa3jYalj3rh82vbXh3PAo9/8EX2qWr+johEyx2RtMS66NavG87C 96OaMIO/mejxC7ikxMoZUqiqEOjiV+EXJt4Go9vNcUY3Z4X6w5cvbMoyViq6zwxjjxCD nXUhfcgBROJh1YESV02wfge2UE58m4ycMOSzl7KkL/JOOSdXX2N8wbqRsBfT+if1TfMB 0kiZuJvJzzSYZmxMTZIH4YOvjA9GgTFdPaXZ0VRX/FhNZ+nBdSxrgRI8Eo6TvgLJ0lRC la6g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11-v6si927227pgn.530.2018.04.27.03.00.34; Fri, 27 Apr 2018 03:00:49 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932628AbeD0J7X (ORCPT + 99 others); Fri, 27 Apr 2018 05:59:23 -0400 Received: from www62.your-server.de ([213.133.104.62]:48816 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932491AbeD0J7S (ORCPT ); Fri, 27 Apr 2018 05:59:18 -0400 Received: from [62.202.221.10] (helo=linux.home) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.85_2) (envelope-from ) id 1fC09p-0004HP-MP; Fri, 27 Apr 2018 11:59:13 +0200 Subject: Re: [PATCH bpf-next] bpf, doc: Update bpf_jit_enable limitation for CONFIG_BPF_JIT_ALWAYS_ON To: Leo Yan Cc: Alexei Starovoitov , "David S. Miller" , Jonathan Corbet , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: <1524709611-29437-1-git-send-email-leo.yan@linaro.org> <275e03a2-b74e-8f60-4ffe-26c9a79fae9d@iogearbox.net> <20180427094910.GA31015@leoy-ThinkPad-X240s> From: Daniel Borkmann Message-ID: Date: Fri, 27 Apr 2018 11:59:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180427094910.GA31015@leoy-ThinkPad-X240s> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.99.3/24517/Fri Apr 27 06:24:46 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/27/2018 11:49 AM, Leo Yan wrote: > On Fri, Apr 27, 2018 at 11:44:44AM +0200, Daniel Borkmann wrote: >> On 04/26/2018 04:26 AM, Leo Yan wrote: >>> When CONFIG_BPF_JIT_ALWAYS_ON is enabled, kernel has limitation for >>> bpf_jit_enable, so it has fixed value 1 and we cannot set it to 2 >>> for JIT opcode dumping; this patch is to update the doc for it. >>> >>> Signed-off-by: Leo Yan >>> --- >>> Documentation/networking/filter.txt | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/Documentation/networking/filter.txt b/Documentation/networking/filter.txt >>> index fd55c7d..feddab9 100644 >>> --- a/Documentation/networking/filter.txt >>> +++ b/Documentation/networking/filter.txt >>> @@ -483,6 +483,12 @@ Example output from dmesg: >>> [ 3389.935851] JIT code: 00000030: 00 e8 28 94 ff e0 83 f8 01 75 07 b8 ff ff 00 00 >>> [ 3389.935852] JIT code: 00000040: eb 02 31 c0 c9 c3 >>> >>> +When CONFIG_BPF_JIT_ALWAYS_ON is enabled, bpf_jit_enable is set to 1 by default >>> +and it returns failure if change to any other value from proc node; this is >>> +for security consideration to avoid leaking info to unprivileged users. In this >>> +case, we can't directly dump JIT opcode image from kernel log, alternatively we >>> +need to use bpf tool for the dumping. >>> + >> >> Could you change this doc text a bit, I think it's slightly misleading. From the first >> sentence one could also interpret that value 0 would leaking info to unprivileged users >> whereas here we're only talking about the case of value 2. Maybe something roughly like >> this to make it more clear: >> >> When CONFIG_BPF_JIT_ALWAYS_ON is enabled, bpf_jit_enable is permanently set to 1 and >> setting any other value than that will return in failure. This is even the case for >> setting bpf_jit_enable to 2, since dumping the final JIT image into the kernel log >> is discouraged and introspection through bpftool (under tools/bpf/bpftool/) is the >> generally recommended approach instead. > > Yeah, your rephrasing is more clear and better. Will do this and send > new patch soon. Thanks for your helping. Awesome, thank you!