This is a followup from [1], in which a split of commits was suggested
by Greg. Additionally, the following changes were removed and not
included in this v2 version:
- dropped the binder_transaction_log_entry->strerr[] logic
- dropped the binder_transaction_error() do-it-all function
- dropped the re-work of current binder_user_error() messages
[1] https://lore.kernel.org/r/20220421042040.759068-1-cmllamas@google.com/
Carlos Llamas (5):
binder: add failed transaction logging info
binder: add BINDER_GET_EXTENDED_ERROR ioctl
binderfs: add extended_error feature entry
binder: convert logging macros into functions
binder: additional transaction error logs
drivers/android/binder.c | 153 ++++++++++++++++--
drivers/android/binder_internal.h | 3 +
drivers/android/binderfs.c | 8 +
include/uapi/linux/android/binder.h | 16 ++
.../filesystems/binderfs/binderfs_test.c | 1 +
5 files changed, 165 insertions(+), 16 deletions(-)
base-commit: 8013d1d3d2e33236dee13a133fba49ad55045e79
--
2.36.0.464.gb9c8b46e94-goog
When clatd starts with ebpf offloaing, and NETIF_F_GRO_FRAGLIST is enable,
several skbs are gathered in skb_shinfo(skb)->frag_list. The first skb's
ipv6 header will be changed to ipv4 after bpf_skb_proto_6_to_4,
network_header\transport_header\mac_header have been updated as ipv4 acts,
but other skbs in frag_list didnot update anything, just ipv6 packets.
udp_queue_rcv_skb will call skb_segment_list to traverse other skbs in
frag_list and make sure right udp payload is delivered to user space.
Unfortunately, other skbs in frag_list who are still ipv6 packets are
updated like the first skb and will have wrong transport header length.
e.g.before bpf_skb_proto_6_to_4,the first skb and other skbs in frag_list
has the same network_header(24)& transport_header(64), after
bpf_skb_proto_6_to_4, ipv6 protocol has been changed to ipv4, the first
skb's network_header is 44,transport_header is 64, other skbs in frag_list
didnot change.After skb_segment_list, the other skbs in frag_list has
different network_header(24) and transport_header(44), so there will be 20
bytes different from original,that is difference between ipv6 header and
ipv4 header. Just change transport_header to be the same with original.
Actually, there are two solutions to fix it, one is traversing all skbs
and changing every skb header in bpf_skb_proto_6_to_4, the other is
modifying frag_list skb's header in skb_segment_list. Considering
efficiency, adopt the second one--- when the first skb and other skbs in
frag_list has different network_header length, restore them to make sure
right udp payload is delivered to user space.
Signed-off-by: Lina Wang <lina.wang(a)mediatek.com>
---
net/core/skbuff.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 10bde7c6db44..e8006e0a1b25 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3897,7 +3897,7 @@ struct sk_buff *skb_segment_list(struct sk_buff *skb,
unsigned int delta_len = 0;
struct sk_buff *tail = NULL;
struct sk_buff *nskb, *tmp;
- int err;
+ int len_diff, err;
skb_push(skb, -skb_network_offset(skb) + offset);
@@ -3937,9 +3937,11 @@ struct sk_buff *skb_segment_list(struct sk_buff *skb,
skb_push(nskb, -skb_network_offset(nskb) + offset);
skb_release_head_state(nskb);
+ len_diff = skb_network_header_len(nskb) - skb_network_header_len(skb);
__copy_skb_header(nskb, skb);
skb_headers_offset_update(nskb, skb_headroom(nskb) - skb_headroom(skb));
+ nskb->transport_header += len_diff;
skb_copy_from_linear_data_offset(skb, -tnl_hlen,
nskb->data - tnl_hlen,
offset + tnl_hlen);
--
2.18.0
The gup_test binary will fail showing only the output of perror("open") in
the case that /sys/kernel/debug/gup_test is not found. This will almost
always be due to CONFIG_GUP_TEST not being set, which enables
compilation of a kernel that provides this file.
Add a short error message to clarify this failure and point the user to
the solution.
Signed-off-by: Joel Savitz <jsavitz(a)redhat.com>
---
tools/testing/selftests/vm/gup_test.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/vm/gup_test.c b/tools/testing/selftests/vm/gup_test.c
index cda837a14736..ac4e804d47f0 100644
--- a/tools/testing/selftests/vm/gup_test.c
+++ b/tools/testing/selftests/vm/gup_test.c
@@ -18,6 +18,8 @@
#define FOLL_WRITE 0x01 /* check pte is writable */
#define FOLL_TOUCH 0x02 /* mark page accessed */
+#define GUP_TEST_FILE "/sys/kernel/debug/gup_test"
+
static unsigned long cmd = GUP_FAST_BENCHMARK;
static int gup_fd, repeats = 1;
static unsigned long size = 128 * MB;
@@ -204,9 +206,11 @@ int main(int argc, char **argv)
if (write)
gup.gup_flags |= FOLL_WRITE;
- gup_fd = open("/sys/kernel/debug/gup_test", O_RDWR);
+ gup_fd = open(GUP_TEST_FILE, O_RDWR);
if (gup_fd == -1) {
perror("open");
+ fprintf(stderr, "Unable to open %s: check that CONFIG_GUP_TEST=y\n",
+ GUP_TEST_FILE);
exit(1);
}
--
2.27.0
My name is Warren Buffett, an American businessman and investor I have
something important to discuss with you.
Mr. Warren Buffett
warren001buffett(a)gmail.com
Chief Executive Officer: Berkshire Hathaway
aphy/Warren-Edward-Buffett
[memo to self: don't send stuff on Friday evenings]
Sorry about the spam, resend w/o config, see
https://people.redhat.com/~cohuck/config-mte
On Fri, May 06 2022, Cornelia Huck <cohuck(a)redhat.com> wrote:
> Hi,
>
> I'm currently trying to run the MTE selftests on the FVP simulator (Base
> Model)[1], mainly to verify things are sane on the host before wiring up
> the KVM support in QEMU. However, I'm seeing some failures (the non-mte
> tests seemed all fine):
>
> # selftests: /arm64: check_buffer_fill
> # 1..20
> # ok 1 Check buffer correctness by byte with sync err mode and mmap memory
> # ok 2 Check buffer correctness by byte with async err mode and mmap memory
> # ok 3 Check buffer correctness by byte with sync err mode and mmap/mprotect memory
> # ok 4 Check buffer correctness by byte with async err mode and mmap/mprotect memory
> # not ok 5 Check buffer write underflow by byte with sync mode and mmap memory
> # not ok 6 Check buffer write underflow by byte with async mode and mmap memory
> # ok 7 Check buffer write underflow by byte with tag check fault ignore and mmap memory
> # not ok 8 Check buffer write underflow by byte with sync mode and mmap memory
> # not ok 9 Check buffer write underflow by byte with async mode and mmap memory
> # ok 10 Check buffer write underflow by byte with tag check fault ignore and mmap memory
> # not ok 11 Check buffer write overflow by byte with sync mode and mmap memory
> # not ok 12 Check buffer write overflow by byte with async mode and mmap memory
> # ok 13 Check buffer write overflow by byte with tag fault ignore mode and mmap memory
> # ok 14 Check buffer write correctness by block with sync mode and mmap memory
> # ok 15 Check buffer write correctness by block with async mode and mmap memory
> # ok 16 Check buffer write correctness by block with tag fault ignore and mmap memory
> # ok 17 Check initial tags with private mapping, sync error mode and mmap memory
> # ok 18 Check initial tags with private mapping, sync error mode and mmap/mprotect memory
> # ok 19 Check initial tags with shared mapping, sync error mode and mmap memory
> # ok 20 Check initial tags with shared mapping, sync error mode and mmap/mprotect memory
> # # Totals: pass:14 fail:6 xfail:0 xpass:0 skip:0 error:0
> not ok 24 selftests: /arm64: check_buffer_fill # exit=1
>
> # selftests: /arm64: check_child_memory
> # 1..12
> # not ok 1 Check child anonymous memory with private mapping, precise mode and mmap memory
> # not ok 2 Check child anonymous memory with shared mapping, precise mode and mmap memory
> # not ok 3 Check child anonymous memory with private mapping, imprecise mode and mmap memory
> # not ok 4 Check child anonymous memory with shared mapping, imprecise mode and mmap memory
> # not ok 5 Check child anonymous memory with private mapping, precise mode and mmap/mprotect memory
> # not ok 6 Check child anonymous memory with shared mapping, precise mode and mmap/mprotect memory
> # not ok 7 Check child file memory with private mapping, precise mode and mmap memory
> # not ok 8 Check child file memory with shared mapping, precise mode and mmap memory
> # not ok 9 Check child file memory with private mapping, imprecise mode and mmap memory
> # not ok 10 Check child file memory with shared mapping, imprecise mode and mmap memory
> # not ok 11 Check child file memory with private mapping, precise mode and mmap/mprotect memory
> # not ok 12 Check child file memory with shared mapping, precise mode and mmap/mprotect memory
> # # Totals: pass:0 fail:12 xfail:0 xpass:0 skip:0 error:0
> not ok 25 selftests: /arm64: check_child_memory # exit=1
>
> # selftests: /arm64: check_gcr_el1_cswitch
> # 1..1
> # 1..1
> # 1..1
> # 1..1
> [...many more lines of the same...]
> # 1..1
> #
> not ok 26 selftests: /arm64: check_gcr_el1_cswitch # TIMEOUT 45 seconds
>
> # selftests: /arm64: check_mmap_options
> # 1..22
> # ok 1 Check anonymous memory with private mapping, sync error mode, mmap memory and tag check off
> # ok 2 Check file memory with private mapping, sync error mode, mmap/mprotect memory and tag check off
> # ok 3 Check anonymous memory with private mapping, no error mode, mmap memory and tag check off
> # ok 4 Check file memory with private mapping, no error mode, mmap/mprotect memory and tag check off
> # not ok 5 Check anonymous memory with private mapping, sync error mode, mmap memory and tag check on
> # not ok 6 Check anonymous memory with private mapping, sync error mode, mmap/mprotect memory and tag check on
> # not ok 7 Check anonymous memory with shared mapping, sync error mode, mmap memory and tag check on
> # not ok 8 Check anonymous memory with shared mapping, sync error mode, mmap/mprotect memory and tag check on
> # not ok 9 Check anonymous memory with private mapping, async error mode, mmap memory and tag check on
> # not ok 10 Check anonymous memory with private mapping, async error mode, mmap/mprotect memory and tag check on
> # not ok 11 Check anonymous memory with shared mapping, async error mode, mmap memory and tag check on
> # not ok 12 Check anonymous memory with shared mapping, async error mode, mmap/mprotect memory and tag check on
> # not ok 13 Check file memory with private mapping, sync error mode, mmap memory and tag check on
> # not ok 14 Check file memory with private mapping, sync error mode, mmap/mprotect memory and tag check on
> # not ok 15 Check file memory with shared mapping, sync error mode, mmap memory and tag check on
> # not ok 16 Check file memory with shared mapping, sync error mode, mmap/mprotect memory and tag check on
> # not ok 17 Check file memory with private mapping, async error mode, mmap memory and tag check on
> # not ok 18 Check file memory with private mapping, async error mode, mmap/mprotect memory and tag check on
> # not ok 19 Check file memory with shared mapping, async error mode, mmap memory and tag check on
> # not ok 20 Check file memory with shared mapping, async error mode, mmap/mprotect memory and tag check on
> # not ok 21 Check clear PROT_MTE flags with private mapping, sync error mode and mmap memory
> # not ok 22 Check clear PROT_MTE flags with private mapping and sync error mode and mmap/mprotect memory
> # # Totals: pass:4 fail:18 xfail:0 xpass:0 skip:0 error:0
> not ok 28 selftests: /arm64: check_mmap_options # exit=1
>
> # selftests: /arm64: check_tags_inclusion
> # 1..4
> # not ok 1 Check an included tag value with sync mode
> # not ok 2 Check different included tags value with sync mode
> # ok 3 Check none included tags value with sync mode
> # not ok 4 Check all included tags value with sync mode
> # # Totals: pass:1 fail:3 xfail:0 xpass:0 skip:0 error:0
> not ok 29 selftests: /arm64: check_tags_inclusion # exit=1
>
> check_ksm_options and check_user_mem work as expected.
>
> Are the MTE tests supposed to work on the FVP model? Something broken in
> my config? Anything I can debug?
>
> [1] Command line:
> "$MODEL" \
> -C cache_state_modelled=0 \
> -C bp.refcounter.non_arch_start_at_default=1 \
> -C bp.secure_memory=false \
> -C cluster0.has_arm_v8-1=1 \
> -C cluster0.has_arm_v8-2=1 \
> -C cluster0.has_arm_v8-3=1 \
> -C cluster0.has_arm_v8-4=1 \
> -C cluster0.has_arm_v8-5=1 \
> -C cluster0.has_amu=1 \
> -C cluster0.NUM_CORES=4 \
> -C cluster0.memory_tagging_support_level=2 \
> -a "cluster0.*=$AXF" \
>
> where $AXF contains a kernel at v5.18-rc5-16-g107c948d1d3e[2] and an
> initrd built by mbuto[3] from that level with a slightly tweaked "kselftests"
> profile (adding /dev/shm).
>
> [2] CONFIG_ARM64_MTE=y, no modules; complete config below[4]
>
> [3] https://mbuto.sh/mbuto/
>
> [4] kernel config: https://people.redhat.com/~cohuck/config-mte