lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 6 Aug 2021 09:24:28 +0900
From:   Kuniyuki Iwashima <kuniyu@...zon.co.jp>
To:     <yhs@...com>
CC:     <andrii@...nel.org>, <ast@...nel.org>, <benh@...zon.com>,
        <bpf@...r.kernel.org>, <daniel@...earbox.net>,
        <davem@...emloft.net>, <john.fastabend@...il.com>, <kafai@...com>,
        <kpsingh@...nel.org>, <kuba@...nel.org>, <kuni1840@...il.com>,
        <kuniyu@...zon.co.jp>, <netdev@...r.kernel.org>,
        <songliubraving@...com>
Subject: Re: [PATCH v3 bpf-next 2/2] selftest/bpf: Implement sample UNIX domain socket iterator program.

From:   Yonghong Song <yhs@...com>
Date:   Thu, 5 Aug 2021 09:59:40 -0700
> On 8/4/21 12:08 AM, Kuniyuki Iwashima wrote:
> > If there are no abstract sockets, this prog can output the same result
> > compared to /proc/net/unix.
> > 
> >    # cat /sys/fs/bpf/unix | head -n 2
> >    Num       RefCount Protocol Flags    Type St Inode Path
> >    ffff9ab7122db000: 00000002 00000000 00010000 0001 01 10623 private/defer
> > 
> >    # cat /proc/net/unix | head -n 2
> >    Num       RefCount Protocol Flags    Type St Inode Path
> >    ffff9ab7122db000: 00000002 00000000 00010000 0001 01 10623 private/defer
> > 
> > According to the analysis by Yonghong Song (See the link), the BPF verifier
> > cannot load the code in the comment to print the name of the abstract UNIX
> > domain socket due to LLVM optimisation.  It can be uncommented once the
> > LLVM code gen is improved.
> 
> I have pushed the llvm fix to llvm14 trunk 
> (https://reviews.llvm.org/D107483), and filed a request to backport to 
> llvm13 (https://bugs.llvm.org/show_bug.cgi?id=51363), could you in the 
> next revision uncomment the "for" loop code and tested it with latest 
> llvm trunk compiler? Please also add an entry in selftests/bpf/README.rst
> to mention the llvm commit https://reviews.llvm.org/D107483 is needed
> for bpf_iter unix_socket selftest, otherwise, they will see an error
> like ...

Thank you for nice fixing so quickly!

I confirmed that the uncommented code can be loaded properly with the
latest LLVM master tree. :)

---8<---
$ sudo ./test_progs -t iter
...
#7/14 unix:OK
...
$ clang --version
clang version 14.0.0 (https://github.com/llvm/llvm-project.git 8a557d8311593627efd08d03178889971d5ae02b)
...
$ llvm-objdump -S bpf_iter_unix.o
...
; 				 for (i = 1 ; i < len; i++)
     110:	07 09 00 00 01 00 00 00	r9 += 1
     111:	ad 89 09 00 00 00 00 00	if r9 < r8 goto +9 <LBB0_18>
---8<---

In the next revision, I'll uncomment the code and add a note in README.rst
about your fix.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ