[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200723095953.1003302-1-jakub@cloudflare.com>
Date: Thu, 23 Jul 2020 11:59:51 +0200
From: Jakub Sitnicki <jakub@...udflare.com>
To: bpf@...r.kernel.org
Cc: netdev@...r.kernel.org, kernel-team@...udflare.com,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Yonghong Song <yhs@...com>
Subject: [PATCH bpf v2 0/2] Fix narrow loads from an offset outside of target field
This is a second attempt at fixing narrow loads from context fields backed
by smaller-in-size target fields, when load offset is beyond the target
field.
Following Yonghong suggestion, verifier now emits an 'wX = 0' or 'rX = 0'
instruction for loads from offsets outside of target field.
Cc: Yonghong Song <yhs@...com>
[v1] https://lore.kernel.org/bpf/20200710173123.427983-1-jakub@cloudflare.com/
Jakub Sitnicki (2):
bpf: Load zeros for narrow loads beyond target field
selftests/bpf: Add test for narrow loads from context at an offset
kernel/bpf/verifier.c | 23 ++++-
.../selftests/bpf/prog_tests/narrow_load.c | 84 +++++++++++++++++++
.../selftests/bpf/progs/test_narrow_load.c | 43 ++++++++++
3 files changed, 148 insertions(+), 2 deletions(-)
create mode 100644 tools/testing/selftests/bpf/prog_tests/narrow_load.c
create mode 100644 tools/testing/selftests/bpf/progs/test_narrow_load.c
--
2.25.4
Powered by blists - more mailing lists