From: Mark Rutland <mark.rutland@arm.com>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: davem@davemloft.net, linux-arm-kernel@lists.infradead.org,
netdev@vger.kernel.org, ast@kernel.org, nschichan@freebox.fr
Subject: Re: [PATCH net] bpf, arm: start flushing icache range from header
Date: Mon, 16 Nov 2015 11:40:55 +0000 [thread overview]
Message-ID: <20151116114055.GC20696@leverpostej> (raw)
In-Reply-To: <971980449d680e6b26e273130d74546c5148893c.1447446440.git.daniel@iogearbox.net>
On Sat, Nov 14, 2015 at 01:26:53AM +0100, Daniel Borkmann wrote:
> During review I noticed that the icache range we're flushing should
> start at header already and not at ctx.image.
>
> Reason is that after 55309dd3d4cd ("net: bpf: arm: address randomize
> and write protect JIT code"), we also want to make sure to flush the
> random-sized trap in front of the start of the actual program (analogous
> to x86). No operational differences from user side.
>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> Tested-by: Nicolas Schichan <nschichan@freebox.fr>
> Cc: Alexei Starovoitov <ast@kernel.org>
> ---
> ( As arm32 fixes usually go via Dave's tree, targeting -net. )
>
> arch/arm/net/bpf_jit_32.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
> index 2f4b14c..591f9db 100644
> --- a/arch/arm/net/bpf_jit_32.c
> +++ b/arch/arm/net/bpf_jit_32.c
> @@ -1061,7 +1061,7 @@ void bpf_jit_compile(struct bpf_prog *fp)
> }
> build_epilogue(&ctx);
>
> - flush_icache_range((u32)ctx.target, (u32)(ctx.target + ctx.idx));
> + flush_icache_range((u32)header, (u32)(ctx.target + ctx.idx));
As with the arm64 patch, doesn't this prevent us from flushing the end
of the image? ctx.idx doesn't seem to take into account the header size.
Mark.
next prev parent reply other threads:[~2015-11-16 11:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-14 0:26 [PATCH net] bpf, arm: start flushing icache range from header Daniel Borkmann
2015-11-16 11:40 ` Mark Rutland [this message]
2015-11-16 12:00 ` Mark Rutland
2015-11-16 19:41 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151116114055.GC20696@leverpostej \
--to=mark.rutland@arm.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=nschichan@freebox.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).