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-next>] [day] [month] [year] [list]
Message-Id: <20220907051657.55597-1-jie2x.zhou@intel.com>
Date:   Wed,  7 Sep 2022 13:16:57 +0800
From:   Jie2x Zhou <jie2x.zhou@...el.com>
To:     jie2x.zhou@...el.com, andrii@...nel.org, mykolal@...com,
        ast@...nel.org, daniel@...earbox.net, martin.lau@...ux.dev,
        davem@...emloft.net, kuba@...nel.org, hawk@...nel.org
Cc:     netdev@...r.kernel.org, bpf@...r.kernel.org,
        linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
        Philip Li <philip.li@...el.com>
Subject: test ./tools/testing/selftests/bpf/test_offload.py failed

hi,

I try to know why output following error?
I found that "disable_ifindex" file do not set read function, so return -EINVAL when do read.
Is it a bug in test_offload.py?

test output:
 selftests: bpf: test_offload.py
 Test destruction of generic XDP...
......
     raise Exception("Command failed: %s\n%s" % (proc.args, stderr))
 Exception: Command failed: cat /sys/kernel/debug/netdevsim/netdevsim0//ports/0/dev/hwstats/l3/disable_ifindex
 
 cat: /sys/kernel/debug/netdevsim/netdevsim0//ports/0/dev/hwstats/l3/disable_ifindex: Invalid argument
 not ok 20 selftests: bpf: test_offload.py # exit=1

source code:
In drivers/net/netdevsim/hwstats.c:
define NSIM_DEV_HWSTATS_FOPS(ACTION, TYPE)                     \
        {                                                       \
                .fops = {                                       \
                        .open = simple_open,                    \
                        .write = nsim_dev_hwstats_do_write,     \
                        .llseek = generic_file_llseek,          \
                        .owner = THIS_MODULE,                   \
                },                                              \
                .action = ACTION,                               \
                .type = TYPE,                                   \
        }

static const struct nsim_dev_hwstats_fops nsim_dev_hwstats_l3_disable_fops =
        NSIM_DEV_HWSTATS_FOPS(NSIM_DEV_HWSTATS_DO_DISABLE,
                              NETDEV_OFFLOAD_XSTATS_TYPE_L3);

        debugfs_create_file("disable_ifindex", 0600, hwstats->l3_ddir, hwstats,
                            &nsim_dev_hwstats_l3_disable_fops.fops);

In fs/read_write.c:
ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
{
......
        if (file->f_op->read)
                ret = file->f_op->read(file, buf, count, pos);
        else if (file->f_op->read_iter)
                ret = new_sync_read(file, buf, count, pos);
        else
                ret = -EINVAL;
......
}

best regards,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ