linux-stable/samples
Wang Hai 85102ba58b samples/bpf: Fix Segmentation fault for xdp_redirect command
A Segmentation fault error is caused when the following command
is executed.

$ sudo ./samples/bpf/xdp_redirect lo
Segmentation fault

This command is missing a device <IFNAME|IFINDEX> as an argument, resulting
in out-of-bounds access from argv.

If the number of devices for the xdp_redirect parameter is not 2,
we should report an error and exit.

Fixes: 24251c2647 ("samples/bpf: add option for native and skb mode for redirect apps")
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210616042324.314832-1-wanghai38@huawei.com
2021-06-18 11:10:26 -07:00
..
acrn sample/acrn: Introduce a sample of HSM ioctl interface usage 2021-02-09 10:58:19 +01:00
auxdisplay .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
binderfs .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
bpf samples/bpf: Fix Segmentation fault for xdp_redirect command 2021-06-18 11:10:26 -07:00
configfs treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
connector .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
ftrace samples/ftrace: Mark my_tramp[12]? global 2020-11-30 21:42:48 -05:00
hidraw .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
hw_breakpoint samples/hw_breakpoint: drop use of kallsyms_lookup_name() 2020-04-07 10:43:44 -07:00
kdb
kfifo kfifo: fix ternary sign extension bugs 2021-04-30 11:20:35 -07:00
kmemleak mm,kmemleak-test.c: move kmemleak-test.c to samples dir 2020-10-13 18:38:27 -07:00
kobject
kprobes samples/kprobes: Add riscv support 2021-04-26 08:25:03 -07:00
landlock samples/landlock: Add a sandbox manager example 2021-04-22 12:22:11 -07:00
livepatch livepatch: Handle allocation failure in the sample of shadow variable API 2020-01-17 11:12:06 +01:00
mei .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
nitro_enclaves .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
pidfd .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
pktgen samples: pktgen: add UDP tx checksum support 2021-05-28 14:52:13 -07:00
qmi samples: qmi: Constify static qmi ops 2020-11-24 17:08:47 -06:00
rpmsg samples/rpmsg: Introduce a module parameter for message count 2019-08-26 22:10:39 -07:00
seccomp .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
timers .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
trace_events tracing: Fix doc mistakes in trace sample 2020-05-07 13:32:57 -04:00
trace_printk samples/trace_printk: Wait for IRQ work to finish 2019-12-21 16:08:22 -05:00
uhid kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
v4l media: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:52:39 +01:00
vfio-mdev vfio/mdev: remove unnecessary NULL check in mbochs_create() 2021-05-04 09:56:02 -06:00
vfs .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
watch_queue .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
watchdog .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig samples/landlock: Add a sandbox manager example 2021-04-22 12:22:11 -07:00
Makefile samples/landlock: Add a sandbox manager example 2021-04-22 12:22:11 -07:00