• Tahera Fahimi's avatar
    selftests/landlock: Test abstract UNIX socket scoping · fefcf0f7
    Tahera Fahimi authored
    Add three tests that examine different scenarios for abstract UNIX
    socket:
    
    1) scoped_domains: Base tests of the abstract socket scoping mechanism
       for a landlocked process, same as the ptrace test.
    
    2) scoped_vs_unscoped: Generates three processes with different domains
       and tests if a process with a non-scoped domain can connect to other
       processes.
    
    3) outside_socket: Since the socket's creator credentials are used
       for scoping sockets, this test examines the cases where the socket's
       credentials are different from the process using it.
    
    Move protocol_variant, service_fixture, and sys_gettid() from net_test.c
    to common.h, and factor out code into a new set_unix_address() helper.
    Signed-off-by: default avatarTahera Fahimi <fahimitahera@gmail.com>
    Link: https://lore.kernel.org/r/9321c3d3bcd9212ceb4b50693e29349f8d625e16.1725494372.git.fahimitahera@gmail.com
    [mic: Fix commit message, remove useless clang-format tags, move
    drop_caps() calls, move and rename variables, rename variants, use more
    EXPECT, improve comments, simplify the outside_socket test]
    Signed-off-by: default avatarMickaël Salaün <mic@digikod.net>
    fefcf0f7
scoped_multiple_domain_variants.h 3.57 KB