From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753774AbcAMAb2 (ORCPT ); Tue, 12 Jan 2016 19:31:28 -0500 Received: from www62.your-server.de ([213.133.104.62]:49856 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752716AbcAMAb1 (ORCPT ); Tue, 12 Jan 2016 19:31:27 -0500 Message-ID: <56959AD8.90206@iogearbox.net> Date: Wed, 13 Jan 2016 01:31:20 +0100 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Laura Abbott CC: Alexei Starovoitov , Catalin Marinas , Will Deacon , Mark Rutland , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: Allow vmalloc regions to be set with set_memory_* References: <1452635187-8057-1-git-send-email-labbott@fedoraproject.org> <20160113000112.GA36310@ast-mbp.thefacebook.com> In-Reply-To: <20160113000112.GA36310@ast-mbp.thefacebook.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/13/2016 01:01 AM, Alexei Starovoitov wrote: > On Tue, Jan 12, 2016 at 01:46:27PM -0800, Laura Abbott wrote: >> >> The range of set_memory_* is currently restricted to the module address >> range because of difficulties in breaking down larger block sizes. >> vmalloc maps PAGE_SIZE pages so it is safe to use as well. Update the >> function ranges and add a comment explaining why the range is restricted >> the way it is. >> >> Signed-off-by: Laura Abbott >> --- >> This should let the protections for the eBPF work as expected, I don't >> know if there is some sort of self test for thatL. > > you can test it with: > # sysctl net.core.bpf_jit_enable=1 > # insmod test_bpf.ko > > On x64 it shows: > test_bpf: Summary: 291 PASSED, 0 FAILED, [282/283 JIT'ed] > > arm64 may have less JIT'ed tests. Also, in that lib/test_bpf.c file, you can do a test by overwriting/'corrupting' part of the fp->insnsi instructions right after bpf_prog_select_runtime(fp) to see if setting the bpf_prog as RO works. Thanks, Daniel