1. 21 Aug, 2024 7 commits
  2. 19 Aug, 2024 6 commits
  3. 15 Aug, 2024 15 commits
  4. 12 Aug, 2024 1 commit
  5. 07 Aug, 2024 4 commits
  6. 06 Aug, 2024 4 commits
  7. 02 Aug, 2024 1 commit
  8. 31 Jul, 2024 2 commits
    • Martin KaFai Lau's avatar
      Merge branch 'selftests/bpf: convert test_dev_cgroup to test_progs' · b7ea631b
      Martin KaFai Lau authored
      Alexis Lothoré (eBPF Foundation) says:
      
      ====================
      Hello,
      this small series aims to integrate test_dev_cgroup in test_progs so it
      could be run automatically in CI. The new version brings a few differences
      with the current one:
      - test now uses directly syscalls instead of wrapping commandline tools
        into system() calls
      - test_progs manipulates /dev/null (eg: redirecting test logs into it), so
        disabling access to it in the bpf program confuses the tests. To fix this,
        the first commit modifies the bpf program to allow access to char devices
        1:3 (/dev/null), and disable access to char devices 1:5 (/dev/zero)
      - once test is converted, add a small subtest to also check for device type
        interpretation (char or block)
      - paths used in mknod tests are now in /dev instead of /tmp: due to the CI
        runner organisation and mountpoints manipulations, trying to create nodes
        in /tmp leads to errors unrelated to the test (ie, mknod calls refused by
        kernel, not the bpf program). I don't understand exactly the root cause
        at the deepest point (all I see in CI is an -ENXIO error on mknod when trying to
        create the node in tmp, and I can not make sense out of it neither
        replicate it locally), so I would gladly take inputs from anyone more
        educated than me about this.
      
      The new test_progs part has been tested in a local qemu environment as well
      as in upstream CI:
      
        ./test_progs -a cgroup_dev
        47/1    cgroup_dev/allow-mknod:OK
        47/2    cgroup_dev/allow-read:OK
        47/3    cgroup_dev/allow-write:OK
        47/4    cgroup_dev/deny-mknod:OK
        47/5    cgroup_dev/deny-read:OK
        47/6    cgroup_dev/deny-write:OK
        47/7    cgroup_dev/deny-mknod-wrong-type:OK
        47      cgroup_dev:OK
        Summary: 1/7 PASSED, 0 SKIPPED, 0 FAILED
      ---
      Changes in v4:
      - Fix mixup between ret and errno by testing both
      - Properly apply ack tag from Stanislas
      - Link to v3: https://lore.kernel.org/r/20240730-convert_dev_cgroup-v3-0-93e573b74357@bootlin.com
      
      Changes in v3:
      - delete mknod file only if it has been created
      - use bpf_program__attach_cgroup() instead of bpf_prog_attach
      - reorganize subtests order
      - collect review/ack tags from Alan and Stanislas
      - Link to v2: https://lore.kernel.org/r/20240729-convert_dev_cgroup-v2-0-4c1fc0520545@bootlin.com
      
      Changes in v2:
      - directly pass expected ret code to subtests instead of boolean pass/not
        pass
      - fix faulty fd check in subtest expected to fail on open
      - fix wrong subtest name
      - pass test buffer and corresponding size to read/write subtests
      - use correct series prefix
      - Link to v1: https://lore.kernel.org/r/20240725-convert_dev_cgroup-v1-0-2c8cbd487c44@bootlin.com
      ====================
      Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
      b7ea631b
    • Alexis Lothoré (eBPF Foundation)'s avatar
      selftests/bpf: add wrong type test to cgroup dev · 84cdbff4
      Alexis Lothoré (eBPF Foundation) authored
      Current cgroup_dev test mostly tests that device operation is accepted or
      refused base on passed major/minor (and so, any operation performed during
      test involves only char device)
      
      Add a small subtest ensuring that the device type passed to bpf program
      allows it to take decisions as well.
      Reviewed-by: default avatarAlan Maguire <alan.maguire@oracle.com>
      Acked-by: default avatarStanislav Fomichev <sdf@fomichev.me>
      Signed-off-by: default avatarAlexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
      Link: https://lore.kernel.org/r/20240731-convert_dev_cgroup-v4-3-849425d90de6@bootlin.comSigned-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
      84cdbff4