Re: [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value

2020-08-02 Thread Christoph Hellwig
On Sun, Aug 02, 2020 at 02:14:06PM -0500, Bjorn Helgaas wrote: > But what guarantees that a PCI config register cannot contain ~0? > If there's something about that in the spec I'd love to know where it > is because it would simplify a lot of things. There isn't. An we even have cases like the NV

Re: [PATCH bpf-next 1/2] bpf: change uapi for bpf iterator map elements

2020-08-02 Thread Yonghong Song
On 8/2/20 10:11 PM, Andrii Nakryiko wrote: On Sun, Aug 2, 2020 at 7:23 PM Yonghong Song wrote: On 8/2/20 6:25 PM, Andrii Nakryiko wrote: On Sat, Aug 1, 2020 at 9:22 PM Yonghong Song wrote: Commit a5cbe05a6673 ("bpf: Implement bpf iterator for map elements") added bpf iterator support

RE: [PATCH] ieee802154/adf7242: check status of adf7242_read_reg

2020-08-02 Thread Hennerich, Michael
> -Original Message- > From: t...@redhat.com > Sent: Sonntag, 2. August 2020 16:24 > To: Hennerich, Michael ; > alex.ar...@gmail.com; ste...@datenfreihafen.org; da...@davemloft.net; > k...@kernel.org; mar...@holtmann.org > Cc: linux-w...@vger.kernel.org; netdev@vger.kernel.org; linux- >

Re: [PATCH] kprobes: fix NULL pointer dereference at kprobe_ftrace_handler

2020-08-02 Thread Song Liu
> On Jul 27, 2020, at 11:45 PM, Muchun Song wrote: > > We found a case of kernel panic on our server. The stack trace is as > follows(omit some irrelevant information): > > BUG: kernel NULL pointer dereference, address: 0080 > RIP: 0010:kprobe_ftrace_handler+0x5e/0xe0 > RSP: 00

Re: [PATCH] kprobes: fix NULL pointer dereference at kprobe_ftrace_handler

2020-08-02 Thread Muchun Song
Ping guys. Any comments or suggestions? On Tue, Jul 28, 2020 at 2:45 PM Muchun Song wrote: > > We found a case of kernel panic on our server. The stack trace is as > follows(omit some irrelevant information): > > BUG: kernel NULL pointer dereference, address: 0080 > RIP: 0010:kpro

[PATCH v4 02/11] dt-bindings: net: mdio-gpio: add compatible for microchip,mdio-smi0

2020-08-02 Thread Michael Grzeschik
Microchip SMI0 Mode is a special mode, where the MDIO Read/Write commands are part of the PHY Address and the OP Code is always 0. We add the compatible for this special mode of the bitbanged mdio driver. Cc: devicet...@vger.kernel.org Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Acked

[PATCH v4 03/11] net: tag: ksz: Add KSZ8863 tag code

2020-08-02 Thread Michael Grzeschik
Add DSA tag code for Microchip KSZ8863 switch. Reviewed-by: Florian Fainelli Signed-off-by: Michael Grzeschik --- v1 -> v2: - fixed __be16 handling v2 -> v3: - no changes v3 -> v4: - changed handling to only one padding byte include/net/dsa.h | 2 ++ net/dsa/tag_ksz.c | 57 ++

[PATCH v4 11/11] dt-bindings: net: dsa: document additional Microchip KSZ8863/8873 switch

2020-08-02 Thread Michael Grzeschik
It is a 3-Port 10/100 Ethernet Switch. One CPU-Port and two Switch-Ports. Cc: devicet...@vger.kernel.org Reviewed-by: Andrew Lunn Acked-by: Rob Herring Signed-off-by: Michael Grzeschik --- v1 -> v3: - nothing changes - already Acked-by Rob Herring v1 -> v4: - nothing changes Docume

[PATCH v4 01/11] net: phy: Add support for microchip SMI0 MDIO bus

2020-08-02 Thread Michael Grzeschik
From: Andrew Lunn SMI0 is a mangled version of MDIO. The main low level difference is the MDIO C22 OP code is always 0, not 0x2 or 0x1 for Read/Write. The read/write information is instead encoded in the PHY address. Extend the bit-bang code to allow the op code to be overridden, but default to

[PATCH v4 07/11] net: dsa: microchip: ksz8795: move register offsets and shifts to separate struct

2020-08-02 Thread Michael Grzeschik
In order to get this driver used with other switches the functions need to use different offsets and register shifts. This patch changes the direct use of the register defines to register description structures, which can be set depending on the chips register layout. Signed-off-by: Michael Grzesc

[PATCH v4 06/11] net: dsa: microchip: ksz8795: change drivers prefix to be generic

2020-08-02 Thread Michael Grzeschik
The driver can be used on other chips of this type. To reflect this we rename the drivers prefix from ksz8795 to ksz8. Signed-off-by: Michael Grzeschik --- v1 -> v4: - extracted this change from bigger previous patch drivers/net/dsa/microchip/ksz8795.c | 222 drive

[PATCH v4 09/11] net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support

2020-08-02 Thread Michael Grzeschik
Add KSZ88X3 driver support. We add support for the KXZ88X3 three port switches using the Microchip SMI Interface. They are supported using the MDIO-Bitbang Interface. Signed-off-by: Michael Grzeschik --- v1 -> v2: - this code was part of previuos patch v2 -> v3: - this code was part of previuo

[PATCH v4 04/11] net: dsa: microchip: ksz8795: use port_cnt where possible

2020-08-02 Thread Michael Grzeschik
Since the driver can be used on more switches it needs to use flexible port count whereever possible. Signed-off-by: Michael Grzeschik --- v1 -> v4: - extracted this change from bigger previous patch drivers/net/dsa/microchip/ksz8795.c | 16 1 file changed, 8 insertions(+), 8

[PATCH v4 10/11] net: dsa: microchip: Add Microchip KSZ8863 SPI based driver support

2020-08-02 Thread Michael Grzeschik
Add KSZ88X3 driver support. We add support for the KXZ88X3 three port switches using the SPI Interface. Signed-off-by: Michael Grzeschik --- v1 -> v2: - this glue was not implemented v2 -> v3: - this glue was part of previous bigger patch v3 -> v4: - this glue was moved to this separate patch

[PATCH v4 08/11] net: dsa: microchip: ksz8795: add support for ksz88xx chips

2020-08-02 Thread Michael Grzeschik
We add support for the ksz8863 and ksz8873 chips which are using the same register patterns but other offsets as the ksz8795. Signed-off-by: Michael Grzeschik --- v1 -> v4: - extracted this change from bigger previous patch drivers/net/dsa/microchip/ksz8795.c | 541 +---

[PATCH v4 00/11] microchip: add support for ksz88x3 driver family

2020-08-02 Thread Michael Grzeschik
This series adds support for the ksz88x3 driver family to the dsa based ksz drivers. The driver is making use of the already available ksz8795 driver and moves it to an generic driver for the ksz8 based chips which have similar functions but an totaly different register layout. Andrew Lunn (1):

[PATCH v4 05/11] net: dsa: microchip: ksz8795: dynamic allocate memory for flush_dyn_mac_table

2020-08-02 Thread Michael Grzeschik
To get the driver working with other chips using different port counts the dyn_mac_table should be flushed depending on the amount of physical ports. Signed-off-by: Michael Grzeschik --- v1 -> v4: - extracted this change from bigger previous patch drivers/net/dsa/microchip/ksz8795.c | 5 +++--

Re: [PATCH bpf-next 1/2] bpf: change uapi for bpf iterator map elements

2020-08-02 Thread Andrii Nakryiko
On Sun, Aug 2, 2020 at 7:23 PM Yonghong Song wrote: > > > > On 8/2/20 6:25 PM, Andrii Nakryiko wrote: > > On Sat, Aug 1, 2020 at 9:22 PM Yonghong Song wrote: > >> > >> Commit a5cbe05a6673 ("bpf: Implement bpf iterator for > >> map elements") added bpf iterator support for > >> map elements. The m

Re: [PATCH bpf-next 5/5] selftests/bpf: add benchmark for uprobe vs. user_prog

2020-08-02 Thread Andrii Nakryiko
On Sun, Aug 2, 2020 at 9:47 PM Song Liu wrote: > > > > On Aug 2, 2020, at 6:51 PM, Andrii Nakryiko > > wrote: > > > > On Sat, Aug 1, 2020 at 1:50 AM Song Liu wrote: > >> > >> Add a benchmark to compare performance of > >> 1) uprobe; > >> 2) user program w/o args; > >> 3) user program w/ args

Re: [PATCH bpf-next 3/5] selftests/bpf: add selftest for BPF_PROG_TYPE_USER

2020-08-02 Thread Andrii Nakryiko
On Sun, Aug 2, 2020 at 9:33 PM Song Liu wrote: > > > > > On Aug 2, 2020, at 6:43 PM, Andrii Nakryiko > > wrote: > > > > On Sat, Aug 1, 2020 at 1:50 AM Song Liu wrote: > >> > >> This test checks the correctness of BPF_PROG_TYPE_USER program, including: > >> running on the right cpu, passing in c

Re: BUG: unable to handle kernel NULL pointer dereference in bpf_prog_ADDR

2020-08-02 Thread John Fastabend
Eric Dumazet wrote: > > > On 8/2/20 3:45 PM, syzbot wrote: > > Hello, > > > > syzbot found the following issue on: > > > > HEAD commit:ac3a0c84 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. > > git tree: upstream > > console output: https://syzkaller.appspot.com/x/log.txt?x=1323

Re: [PATCH bpf-next 2/5] libbpf: support BPF_PROG_TYPE_USER programs

2020-08-02 Thread Andrii Nakryiko
On Sun, Aug 2, 2020 at 9:21 PM Song Liu wrote: > > > > > On Aug 2, 2020, at 6:40 PM, Andrii Nakryiko > > wrote: > > > > On Sat, Aug 1, 2020 at 1:50 AM Song Liu wrote: > >> > >> Add cpu_plus to bpf_prog_test_run_attr. Add BPF_PROG_SEC "user" for > >> BPF_PROG_TYPE_USER programs. > >> > >> Signed

KASAN: use-after-free Write in sco_chan_del

2020-08-02 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:ac3a0c84 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=11638a4290 kernel config: https://syzkaller.appspot.com/x/.config?x=c0cfcf935bcc94d2 das

Re: [PATCH] tools/bpf/bpftool: Fix wrong return value in do_dump()

2020-08-02 Thread John Fastabend
Andrii Nakryiko wrote: > On Sun, Aug 2, 2020 at 4:16 AM Tianjia Zhang > wrote: > > > > In case of btf_id does not exist, a negative error code -ENOENT > > should be returned. > > > > Fixes: c93cc69004df3 ("bpftool: add ability to dump BTF types") > > Cc: Andrii Nakryiko > > Signed-off-by: Tianjia

Re: [Linux-kernel-mentees] [PATCH net] rds: Prevent kernel-infoleak in rds_notify_queue_get()

2020-08-02 Thread Leon Romanovsky
On Sun, Aug 02, 2020 at 03:45:40PM -0700, Joe Perches wrote: > On Sun, 2020-08-02 at 19:28 -0300, Jason Gunthorpe wrote: > > On Sun, Aug 02, 2020 at 03:23:58PM -0700, Joe Perches wrote: > > > On Sun, 2020-08-02 at 19:10 -0300, Jason Gunthorpe wrote: > > > > On Sat, Aug 01, 2020 at 08:38:33AM +0300,

Re: [PATCH bpf-next 5/5] selftests/bpf: add benchmark for uprobe vs. user_prog

2020-08-02 Thread Song Liu
> On Aug 2, 2020, at 6:51 PM, Andrii Nakryiko wrote: > > On Sat, Aug 1, 2020 at 1:50 AM Song Liu wrote: >> >> Add a benchmark to compare performance of >> 1) uprobe; >> 2) user program w/o args; >> 3) user program w/ args; >> 4) user program w/ args on random cpu. >> > > Can you please

Re: [PATCH bpf-next 4/5] selftests/bpf: move two functions to test_progs.c

2020-08-02 Thread Song Liu
> On Aug 2, 2020, at 6:46 PM, Andrii Nakryiko wrote: > > On Sat, Aug 1, 2020 at 1:50 AM Song Liu wrote: >> >> Move time_get_ns() and get_base_addr() to test_progs.c, so they can be >> used in other tests. >> >> Signed-off-by: Song Liu >> --- >> .../selftests/bpf/prog_tests/attach_probe.c

Re: [PATCH bpf-next 3/5] selftests/bpf: add selftest for BPF_PROG_TYPE_USER

2020-08-02 Thread Song Liu
> On Aug 2, 2020, at 6:43 PM, Andrii Nakryiko wrote: > > On Sat, Aug 1, 2020 at 1:50 AM Song Liu wrote: >> >> This test checks the correctness of BPF_PROG_TYPE_USER program, including: >> running on the right cpu, passing in correct args, returning retval, and >> being able to call bpf_get_s

Re: [PATCH bpf-next 2/5] libbpf: support BPF_PROG_TYPE_USER programs

2020-08-02 Thread Song Liu
> On Aug 2, 2020, at 6:40 PM, Andrii Nakryiko wrote: > > On Sat, Aug 1, 2020 at 1:50 AM Song Liu wrote: >> >> Add cpu_plus to bpf_prog_test_run_attr. Add BPF_PROG_SEC "user" for >> BPF_PROG_TYPE_USER programs. >> >> Signed-off-by: Song Liu >> --- >> tools/lib/bpf/bpf.c | 1 + >> t

Re: Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards

2020-08-02 Thread Ben Hutchings
On Sun, 2020-08-02 at 22:44 +0200, Thorsten Glaser wrote: > On Sun, 2 Aug 2020, Ben Hutchings wrote: > > > The RFC says that the IPV6_TCLASS option's value is an int, and that > > for setsockopt (“option's”), not cmsg > > > No, the wording is *not* clear. > > Agreed. > > So perhaps let’s try t

linux-next: manual merge of the bpf-next tree with the net-next tree

2020-08-02 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the bpf-next tree got a conflict in: net/core/dev.c between commit: 829eb208e80d ("rtnetlink: add support for protodown reason") from the net-next tree and commits: 7f0a838254bd ("bpf, xdp: Maintain info on attached XDP BPF programs in net_device")

Re: [PATCH bpf-next 2/2] libbpf: support new uapi for map element bpf iterator

2020-08-02 Thread Yonghong Song
On 8/2/20 6:35 PM, Andrii Nakryiko wrote: On Sat, Aug 1, 2020 at 9:22 PM Yonghong Song wrote: Previous commit adjusted kernel uapi for map element bpf iterator. This patch adjusted libbpf API due to uapi change. Signed-off-by: Yonghong Song --- tools/lib/bpf/bpf.c| 4 +++- tools/li

Re: [PATCH bpf-next 1/2] bpf: change uapi for bpf iterator map elements

2020-08-02 Thread Yonghong Song
On 8/2/20 6:25 PM, Andrii Nakryiko wrote: On Sat, Aug 1, 2020 at 9:22 PM Yonghong Song wrote: Commit a5cbe05a6673 ("bpf: Implement bpf iterator for map elements") added bpf iterator support for map elements. The map element bpf iterator requires info to identify a particular map. In the abo

[PATCH net-next] tipc: Use is_broadcast_ether_addr() instead of memcmp()

2020-08-02 Thread Huang Guobin
Using is_broadcast_ether_addr() instead of directly use memcmp() to determine if the ethernet address is broadcast address. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Huang Guobin --- net/tipc/eth_media.c | 4 +--- 1 file changed, 1 i

Re: [PATCH bpf-next 5/5] selftests/bpf: add benchmark for uprobe vs. user_prog

2020-08-02 Thread Andrii Nakryiko
On Sat, Aug 1, 2020 at 1:50 AM Song Liu wrote: > > Add a benchmark to compare performance of > 1) uprobe; > 2) user program w/o args; > 3) user program w/ args; > 4) user program w/ args on random cpu. > Can you please add it to the existing benchmark runner instead, e.g., along the other

Re: [PATCH bpf-next 4/5] selftests/bpf: move two functions to test_progs.c

2020-08-02 Thread Andrii Nakryiko
On Sat, Aug 1, 2020 at 1:50 AM Song Liu wrote: > > Move time_get_ns() and get_base_addr() to test_progs.c, so they can be > used in other tests. > > Signed-off-by: Song Liu > --- > .../selftests/bpf/prog_tests/attach_probe.c | 21 - > .../selftests/bpf/prog_tests/test_overhead.c |

Re: [PATCH bpf-next 3/5] selftests/bpf: add selftest for BPF_PROG_TYPE_USER

2020-08-02 Thread Andrii Nakryiko
On Sat, Aug 1, 2020 at 1:50 AM Song Liu wrote: > > This test checks the correctness of BPF_PROG_TYPE_USER program, including: > running on the right cpu, passing in correct args, returning retval, and > being able to call bpf_get_stack|stackid. > > Signed-off-by: Song Liu > --- > .../selftests/b

Re: [PATCH bpf-next 2/5] libbpf: support BPF_PROG_TYPE_USER programs

2020-08-02 Thread Andrii Nakryiko
On Sat, Aug 1, 2020 at 1:50 AM Song Liu wrote: > > Add cpu_plus to bpf_prog_test_run_attr. Add BPF_PROG_SEC "user" for > BPF_PROG_TYPE_USER programs. > > Signed-off-by: Song Liu > --- > tools/lib/bpf/bpf.c | 1 + > tools/lib/bpf/bpf.h | 3 +++ > tools/lib/bpf/libbpf.c

Re: [PATCH bpf-next 2/2] libbpf: support new uapi for map element bpf iterator

2020-08-02 Thread Andrii Nakryiko
On Sat, Aug 1, 2020 at 9:22 PM Yonghong Song wrote: > > Previous commit adjusted kernel uapi for map > element bpf iterator. This patch adjusted libbpf API > due to uapi change. > > Signed-off-by: Yonghong Song > --- > tools/lib/bpf/bpf.c| 4 +++- > tools/lib/bpf/bpf.h| 5 +++-- > tools/

Re: [PATCH bpf-next 1/2] bpf: change uapi for bpf iterator map elements

2020-08-02 Thread Andrii Nakryiko
On Sat, Aug 1, 2020 at 9:22 PM Yonghong Song wrote: > > Commit a5cbe05a6673 ("bpf: Implement bpf iterator for > map elements") added bpf iterator support for > map elements. The map element bpf iterator requires > info to identify a particular map. In the above > commit, the attr->link_create.targ

Re: [PATCH] tools/bpf/bpftool: Fix wrong return value in do_dump()

2020-08-02 Thread Andrii Nakryiko
On Sun, Aug 2, 2020 at 4:16 AM Tianjia Zhang wrote: > > In case of btf_id does not exist, a negative error code -ENOENT > should be returned. > > Fixes: c93cc69004df3 ("bpftool: add ability to dump BTF types") > Cc: Andrii Nakryiko > Signed-off-by: Tianjia Zhang > --- Acked-by: Andrii Nakryiko

Re: KASAN: use-after-free Write in __sco_sock_close

2020-08-02 Thread syzbot
syzbot has bisected this issue to: commit 43ea43b9d8b27b7acd443ec59319faa3cdb8a616 Author: Mauro Carvalho Chehab Date: Wed Oct 12 11:21:43 2016 + [media] radio-bcm2048: don't ignore errors bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1036e6a490 start commit: ac3a

Re: BUG: unable to handle kernel NULL pointer dereference in bpf_prog_ADDR

2020-08-02 Thread Eric Dumazet
On 8/2/20 3:45 PM, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:ac3a0c84 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=1323497090 > kernel config: https://sy

Re: [PATCH v3 7/9] net: phy: dp83640: Use generic helper function

2020-08-02 Thread Richard Cochran
On Thu, Jul 30, 2020 at 10:00:46AM +0200, Kurt Kanzenbach wrote: > In order to reduce code duplication between ptp drivers, generic helper > functions were introduced. Use them. > > Signed-off-by: Kurt Kanzenbach > --- > drivers/net/phy/dp83640.c | 69 +-- > 1

Re: [PATCH bpf-next v5 1/2] bpf: setup socket family and addresses in bpf_prog_test_run_skb

2020-08-02 Thread Alexei Starovoitov
On Mon, Aug 03, 2020 at 12:36:30AM +0300, Dmitry Yakunin wrote: > Now it's impossible to test all branches of cgroup_skb bpf program which > accesses skb->family and skb->{local,remote}_ip{4,6} fields because they > are zeroed during socket allocation. This commit fills socket family and > addresse

Re: [Linux-kernel-mentees] [PATCH net] rds: Prevent kernel-infoleak in rds_notify_queue_get()

2020-08-02 Thread Joe Perches
On Sun, 2020-08-02 at 19:28 -0300, Jason Gunthorpe wrote: > On Sun, Aug 02, 2020 at 03:23:58PM -0700, Joe Perches wrote: > > On Sun, 2020-08-02 at 19:10 -0300, Jason Gunthorpe wrote: > > > On Sat, Aug 01, 2020 at 08:38:33AM +0300, Leon Romanovsky wrote: > > > > > > > I'm using {} instead of {0} be

BUG: unable to handle kernel NULL pointer dereference in bpf_prog_ADDR

2020-08-02 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:ac3a0c84 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1323497090 kernel config: https://syzkaller.appspot.com/x/.config?x=c0cfcf935bcc94d2 das

[PATCH v5 bpf-next 1/4] bpf: Factor out bpf_link_by_id() helper.

2020-08-02 Thread Alexei Starovoitov
From: Alexei Starovoitov Refactor the code a bit to extract bpf_link_by_id() helper. It's similar to existing bpf_prog_by_id(). Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Acked-by: Song Liu --- include/linux/bpf.h | 1 + kernel/bpf/syscall.c | 46 ++

[PATCH v5 bpf-next 3/4] bpf: Add kernel module with user mode driver that populates bpffs.

2020-08-02 Thread Alexei Starovoitov
From: Alexei Starovoitov Add kernel module with user mode driver that populates bpffs with BPF iterators. $ mount bpffs /my/bpffs/ -t bpf $ ls -la /my/bpffs/ total 4 drwxrwxrwt 2 root root0 Jul 2 00:27 . drwxr-xr-x 19 root root 4096 Jul 2 00:09 .. -rw--- 1 root root0 Jul 2 00:27

[PATCH v5 bpf-next 0/4] bpf: Populate bpffs with map and prog iterators

2020-08-02 Thread Alexei Starovoitov
From: Alexei Starovoitov v4->v5: - addressed Song and Andrii feedback. s/pages/max_entries/ v3->v4: - took THIS_MODULE in patch 3 as suggested by Daniel to simplify the code. - converted BPF iterator to use BTF (when available) to print full BPF program name instead of 16-byte truncated version

[PATCH v5 bpf-next 2/4] bpf: Add BPF program and map iterators as built-in BPF programs.

2020-08-02 Thread Alexei Starovoitov
From: Alexei Starovoitov The program and map iterators work similar to seq_file-s. Once the program is pinned in bpffs it can be read with "cat" tool to print human readable output. In this case about BPF programs and maps. For example: $ cat /sys/fs/bpf/progs.debug id nameattached

[PATCH v5 bpf-next 4/4] selftests/bpf: Add bpffs preload test.

2020-08-02 Thread Alexei Starovoitov
From: Alexei Starovoitov Add a test that mounts two bpffs instances and checks progs.debug and maps.debug for sanity data. Signed-off-by: Alexei Starovoitov --- .../selftests/bpf/prog_tests/test_bpffs.c | 94 +++ 1 file changed, 94 insertions(+) create mode 100644 tools/te

Re: [Linux-kernel-mentees] [PATCH net] rds: Prevent kernel-infoleak in rds_notify_queue_get()

2020-08-02 Thread Jason Gunthorpe
On Sun, Aug 02, 2020 at 03:23:58PM -0700, Joe Perches wrote: > On Sun, 2020-08-02 at 19:10 -0300, Jason Gunthorpe wrote: > > On Sat, Aug 01, 2020 at 08:38:33AM +0300, Leon Romanovsky wrote: > > > > > I'm using {} instead of {0} because of this GCC bug. > > > https://gcc.gnu.org/bugzilla/show_bug.c

RE: [PATCH] hv_netvsc: Add validation for untrusted Hyper-V values

2020-08-02 Thread Haiyang Zhang
> -Original Message- > From: Andres Beltran > Sent: Tuesday, July 28, 2020 6:53 PM > To: KY Srinivasan ; Haiyang Zhang > ; Stephen Hemminger ; > wei@kernel.org > Cc: linux-hyp...@vger.kernel.org; linux-ker...@vger.kernel.org; Michael > Kelley ; parri.and...@gmail.com; Saruhan > Kara

Re: [Linux-kernel-mentees] [PATCH net] rds: Prevent kernel-infoleak in rds_notify_queue_get()

2020-08-02 Thread Joe Perches
On Sun, 2020-08-02 at 19:10 -0300, Jason Gunthorpe wrote: > On Sat, Aug 01, 2020 at 08:38:33AM +0300, Leon Romanovsky wrote: > > > I'm using {} instead of {0} because of this GCC bug. > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 > > This is why the {} extension exists.. There is no gua

Re: [Linux-kernel-mentees] [PATCH net] rds: Prevent kernel-infoleak in rds_notify_queue_get()

2020-08-02 Thread Jason Gunthorpe
On Sat, Aug 01, 2020 at 08:38:33AM +0300, Leon Romanovsky wrote: > I'm using {} instead of {0} because of this GCC bug. > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119 This is why the {} extension exists.. Jason

Re: [PATCH bpf-next] tools build: propagate build failures from tools/build/Makefile.build

2020-08-02 Thread Jiri Olsa
On Sun, Aug 02, 2020 at 11:22:07AM -0700, Andrii Nakryiko wrote: > On Sun, Aug 2, 2020 at 9:11 AM Jiri Olsa wrote: > > > > On Thu, Jul 30, 2020 at 07:42:44PM -0700, Andrii Nakryiko wrote: > > > The '&&' command seems to have a bad effect when $(cmd_$(1)) exits with > > > non-zero effect: the comma

[PATCH bpf-next v5 0/2] bpf: cgroup skb improvements for bpf_prog_test_run

2020-08-02 Thread Dmitry Yakunin
This patchset contains some improvements for testing cgroup/skb programs through BPF_PROG_TEST_RUN command. v2: - fix build without CONFIG_CGROUP_BPF (kernel test robot ) v3: - fix build without CONFIG_IPV6 (kernel test robot ) v4: - remove cgroup storage related commits for future rework

WARNING: ODEBUG bug in bt_host_release

2020-08-02 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:ac3a0c84 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=11e1da9290 kernel config: https://syzkaller.appspot.com/x/.config?x=e59ee776d5aa8d55 das

[PATCH bpf-next v5 2/2] bpf: allow to specify ifindex for skb in bpf_prog_test_run_skb

2020-08-02 Thread Dmitry Yakunin
Now skb->dev is unconditionally set to the loopback device in current net namespace. But if we want to test bpf program which contains code branch based on ifindex condition (eg filters out localhost packets) it is useful to allow specifying of ifindex from userspace. This patch adds such option th

[PATCH bpf-next v5 1/2] bpf: setup socket family and addresses in bpf_prog_test_run_skb

2020-08-02 Thread Dmitry Yakunin
Now it's impossible to test all branches of cgroup_skb bpf program which accesses skb->family and skb->{local,remote}_ip{4,6} fields because they are zeroed during socket allocation. This commit fills socket family and addresses from related fields in constructed skb. v2: - fix build without CON

Re: [PATCH bpf-next v4 0/2] bpf: cgroup skb improvements for bpf_prog_test_run

2020-08-02 Thread Dmitry Yakunin
Sorry, forgot to bump version in cover letter subject. I will resend it. 03.08.2020, 00:30, "Dmitry Yakunin" : > This patchset contains some improvements for testing cgroup/skb programs > through BPF_PROG_TEST_RUN command. > > v2: >   - fix build without CONFIG_CGROUP_BPF (kernel test robot ) > >

[PATCH v3 bpf-next] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2020-08-02 Thread Carlos Neira
Currently tests for bpf_get_ns_current_pid_tgid() are outside test_progs. This change folds a test case into test_progs. Changes from V2: - Tests are now using skeleton. - Test not creating a new namespace has been included in test_progs. - Test creating a new pid namespace has been added as

[PATCH bpf-next v4 0/2] bpf: cgroup skb improvements for bpf_prog_test_run

2020-08-02 Thread Dmitry Yakunin
This patchset contains some improvements for testing cgroup/skb programs through BPF_PROG_TEST_RUN command. v2: - fix build without CONFIG_CGROUP_BPF (kernel test robot ) v3: - fix build without CONFIG_IPV6 (kernel test robot ) v4: - remove cgroup storage related commits for future rework

[PATCH bpf-next v5 1/2] bpf: setup socket family and addresses in bpf_prog_test_run_skb

2020-08-02 Thread Dmitry Yakunin
Now it's impossible to test all branches of cgroup_skb bpf program which accesses skb->family and skb->{local,remote}_ip{4,6} fields because they are zeroed during socket allocation. This commit fills socket family and addresses from related fields in constructed skb. v2: - fix build without CON

[PATCH bpf-next v5 2/2] bpf: allow to specify ifindex for skb in bpf_prog_test_run_skb

2020-08-02 Thread Dmitry Yakunin
Now skb->dev is unconditionally set to the loopback device in current net namespace. But if we want to test bpf program which contains code branch based on ifindex condition (eg filters out localhost packets) it is useful to allow specifying of ifindex from userspace. This patch adds such option th

Re: Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards

2020-08-02 Thread Thorsten Glaser
On Sun, 2 Aug 2020, Ben Hutchings wrote: > The RFC says that the IPV6_TCLASS option's value is an int, and that for setsockopt (“option's”), not cmsg > No, the wording is *not* clear. Agreed. So perhaps let’s try to find out what’s actually right… Thanks for helping, //mirabilos -- tarent so

KMSAN: uninit-value in process_adv_report

2020-08-02 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:93f54a72 instrumented.h: fix KMSAN support git tree: https://github.com/google/kmsan.git master console output: https://syzkaller.appspot.com/x/log.txt?x=13238a4290 kernel config: https://syzkaller.appspot.com/x/.config?x=fa4f

KASAN: use-after-free Read in hci_send_acl

2020-08-02 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:ac3a0c84 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1348290490 kernel config: https://syzkaller.appspot.com/x/.config?x=c0cfcf935bcc94d2 das

KASAN: use-after-free Read in hci_chan_del

2020-08-02 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:ac3a0c84 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=11b8d57090 kernel config: https://syzkaller.appspot.com/x/.config?x=e59ee776d5aa8d55 das

KASAN: use-after-free Write in __sco_sock_close

2020-08-02 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:ac3a0c84 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1708290490 kernel config: https://syzkaller.appspot.com/x/.config?x=e59ee776d5aa8d55 das

general protection fault in hci_phy_link_complete_evt

2020-08-02 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:ac3a0c84 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=15ab47ca90 kernel config: https://syzkaller.appspot.com/x/.config?x=c0cfcf935bcc94d2 das

general protection fault in hci_event_packet

2020-08-02 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:ac3a0c84 Merge git://git.kernel.org/pub/scm/linux/kernel/g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=11af867090 kernel config: https://syzkaller.appspot.com/x/.config?x=e59ee776d5aa8d55 das

Re: Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards

2020-08-02 Thread Ben Hutchings
On Sun, 2020-08-02 at 19:29 +, Thorsten Glaser wrote: > Ben Hutchings dixit: > > >ip(7) also doesn't document IP_PKTOPIONS. > > Hmm, I don’t use IP_PKTOPIONS though. I’m not exactly sure I found > the correct place in the kernel for what I do. The first instance of put_cmsg(...IP_TOS...) you

Re: [PATCH v3 9/9] ptp: Remove unused macro

2020-08-02 Thread Florian Fainelli
On 7/30/2020 1:00 AM, Kurt Kanzenbach wrote: > The offset for the control field is not needed anymore. Remove it. > > Signed-off-by: Kurt Kanzenbach Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH v3 8/9] ptp: ptp_ines: Use generic helper function

2020-08-02 Thread Florian Fainelli
On 7/30/2020 1:00 AM, Kurt Kanzenbach wrote: > In order to reduce code duplication between ptp drivers, generic helper > functions were introduced. Use them. > > Signed-off-by: Kurt Kanzenbach Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH v3 6/9] ethernet: ti: cpts: Use generic helper function

2020-08-02 Thread Florian Fainelli
On 7/30/2020 1:00 AM, Kurt Kanzenbach wrote: > In order to reduce code duplication between ptp drivers, generic helper > functions were introduced. Use them. > > Signed-off-by: Kurt Kanzenbach > --- [snip] > - if (unlikely(ptp_class & PTP_CLASS_V1)) > - msgtype = data + offset

Re: [PATCH v3 7/9] net: phy: dp83640: Use generic helper function

2020-08-02 Thread Florian Fainelli
On 7/30/2020 1:00 AM, Kurt Kanzenbach wrote: > In order to reduce code duplication between ptp drivers, generic helper > functions were introduced. Use them. > > Signed-off-by: Kurt Kanzenbach Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH v3 4/9] mlxsw: spectrum_ptp: Use generic helper function

2020-08-02 Thread Florian Fainelli
On 7/30/2020 1:00 AM, Kurt Kanzenbach wrote: > In order to reduce code duplication between ptp drivers, generic helper > functions were introduced. Use them. > > Signed-off-by: Kurt Kanzenbach Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH v3 3/9] net: dsa: mv88e6xxx: Use generic helper function

2020-08-02 Thread Florian Fainelli
On 7/30/2020 1:00 AM, Kurt Kanzenbach wrote: > In order to reduce code duplication between ptp drivers, generic helper > functions were introduced. Use them. > > Signed-off-by: Kurt Kanzenbach Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH v3 2/9] ptp: Add generic ptp message type function

2020-08-02 Thread Florian Fainelli
On 7/30/2020 1:00 AM, Kurt Kanzenbach wrote: > The message type is located at different offsets within the ptp header > depending > on the ptp version (v1 or v2). Therefore, drivers which also deal with ptp v1 > have some code for it. > > Extract this into a helper function for drivers to be u

Re: [PATCH v3 1/9] ptp: Add generic ptp v2 header parsing function

2020-08-02 Thread Florian Fainelli
On 7/30/2020 1:00 AM, Kurt Kanzenbach wrote: > Reason: A lot of the ptp drivers - which implement hardware time stamping - > need > specific fields such as the sequence id from the ptp v2 header. Currently all > drivers implement that themselves. > > Introduce a generic function to retrieve a

Re: [PATCH bpf-next v4 1/2] bpf: setup socket family and addresses in bpf_prog_test_run_skb

2020-08-02 Thread Eric Dumazet
On 8/2/20 11:26 AM, Dmitry Yakunin wrote: > Now it's impossible to test all branches of cgroup_skb bpf program which > accesses skb->family and skb->{local,remote}_ip{4,6} fields because they > are zeroed during socket allocation. This commit fills socket family and > addresses from related fiel

Re: [PATCH v2 3/4 net-next] net: mdiobus: add reset-post-delay-us handling

2020-08-02 Thread Florian Fainelli
On 7/30/2020 12:57 PM, Bruno Thomsen wrote: > Load new "reset-post-delay-us" value from MDIO properties, > and if configured to a greater then zero delay do a > flexible sleeping delay after MDIO bus reset deassert. > This allows devices to exit reset state before start > bus communication. > >

Re: [net-next PATCH] net: phy: mdio-mvusb: select MDIO_DEVRES in Kconfig

2020-08-02 Thread Florian Fainelli
On 8/2/2020 12:49 AM, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > PHYLIB is not selected by the mvusb driver but it uses mdio devres > helpers. Explicitly select MDIO_DEVRES in this driver's Kconfig entry. > > Reported-by: kernel test robot > Fixes: 1814cff26739 ("net: phy: ad

Re: [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value

2020-08-02 Thread Borislav Petkov
On Sun, Aug 02, 2020 at 02:14:06PM -0500, Bjorn Helgaas wrote: > Wait, I'm not convinced yet. I know that if a PCI read fails, you > normally get ~0 data because the host bridge fabricates it to complete > the CPU load. > > But what guarantees that a PCI config register cannot contain ~0? Well,

Re: [PATCH v2 4/4 net-next] net: mdio device: use flexible sleeping in reset function

2020-08-02 Thread Florian Fainelli
On 7/30/2020 12:57 PM, Bruno Thomsen wrote: > MDIO device reset assert and deassert length was created by > usleep_range() but that does not ensure optimal handling of > all the different values from device tree properties. > By switching to the new flexible sleeping helper function, > fsleep(),

Re: [PATCH v2 2/4 net-next] net: mdiobus: use flexible sleeping for reset-delay-us

2020-08-02 Thread Florian Fainelli
On 7/30/2020 12:57 PM, Bruno Thomsen wrote: > MDIO bus reset pulse width is created by using udelay() > and that function might not be optimal depending on > device tree value. By switching to the new fsleep() helper > the correct delay function is called depending on > delay length, e.g. udelay

Re: [PATCH v2 1/4 net-next] dt-bindings: net: mdio: add reset-post-delay-us property

2020-08-02 Thread Florian Fainelli
On 7/30/2020 12:57 PM, Bruno Thomsen wrote: > Add "reset-post-delay-us" parameter to MDIO bus properties, > so it's possible to add a delay after reset deassert. > This is optional in case external hardware slows down > release of the reset signal. > > Signed-off-by: Bruno Thomsen Reviewed-by

INFO: task can't die in p9_client_rpc

2020-08-02 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:01830e6c Add linux-next specific files for 20200731 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=176146cc90 kernel config: https://syzkaller.appspot.com/x/.config?x=2e226b2d1364112c dashboard

Re: Bug#966459: linux: traffic class socket options (both IPv4/IPv6) inconsistent with docs/standards

2020-08-02 Thread Thorsten Glaser
Ben Hutchings dixit: >ip(7) also doesn't document IP_PKTOPIONS. Hmm, I don’t use IP_PKTOPIONS though. I’m not exactly sure I found the correct place in the kernel for what I do. On the sending side, I use setsockopt with either IPPROTO_IP,IP_TOS or IPPROTO_IPV6,IPV6_TCLASS to set the default tra

[net v3] drivers/net/wan/lapbether: Use needed_headroom instead of hard_header_len

2020-08-02 Thread Xie He
In net/packet/af_packet.c, the function packet_snd first reserves a headroom of length (dev->hard_header_len + dev->needed_headroom). Then if the socket is a SOCK_DGRAM socket, it calls dev_hard_header, which calls dev->header_ops->create, to create the link layer header. If the socket is a SOCK_RA

Re: [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value

2020-08-02 Thread Bjorn Helgaas
On Sun, Aug 02, 2020 at 08:46:48PM +0200, Borislav Petkov wrote: > On Sun, Aug 02, 2020 at 07:28:00PM +0200, Saheed Bolarinwa wrote: > > Because the value ~0 has a meaning to some drivers and only > > No, ~0 means that the PCI read failed. For *every* PCI device I know. Wait, I'm not convinced ye

pull-request: wireless-drivers-next-2020-08-02

2020-08-02 Thread Kalle Valo
Hi, here's a pull request to net-next tree, more info below. Please let me know if there are any problems. Kalle The following changes since commit dfecd3e00cd32b2a6d1cfdb30b513dd42575ada3: Merge branch 'net-dsa-mv88e6xxx-port-mtu-support' (2020-07-24 20:03:28 -0700) are available in the git

Re: [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value

2020-08-02 Thread Borislav Petkov
On Sun, Aug 02, 2020 at 07:28:00PM +0200, Saheed Bolarinwa wrote: > Because the value ~0 has a meaning to some drivers and only No, ~0 means that the PCI read failed. For *every* PCI device I know. Here's me reading from 0xf0 offset of my hostbridge: # setpci -s 00:00.0 0xf0.l 0100 That dev

[PATCH 4/7] netfilter: Replace HTTP links with HTTPS ones

2020-08-02 Thread Pablo Neira Ayuso
From: "Alexander A. Klimov" Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://

[PATCH 5/7] netfilter: ip6tables: Remove redundant null checks

2020-08-02 Thread Pablo Neira Ayuso
From: Gaurav Singh Remove superfluous check for NULL pointer to header. Signed-off-by: Gaurav Singh Signed-off-by: Pablo Neira Ayuso --- net/ipv6/netfilter/ip6t_ah.c | 3 +-- net/ipv6/netfilter/ip6t_frag.c | 3 +-- net/ipv6/netfilter/ip6t_hbh.c | 3 +-- net/ipv6/netfilter/ip6t_rt.c | 3 +

[PATCH 3/7] netfilter: Use fallthrough pseudo-keyword

2020-08-02 Thread Pablo Neira Ayuso
From: "Gustavo A. R. Silva" Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallth

[PATCH 7/7] netfilter: nf_tables: report EEXIST on overlaps

2020-08-02 Thread Pablo Neira Ayuso
Replace EBUSY by EEXIST in the following cases: - If the user adds a chain with a different configuration such as different type, hook and priority. - If the user adds a non-base chain that clashes with an existing basechain. - If the user adds a { key : value } mapping element and the key exi

[PATCH 6/7] netfilter: nf_tables: extended netlink error reporting for expressions

2020-08-02 Thread Pablo Neira Ayuso
This patch extends 36dd1bcc07e5 ("netfilter: nf_tables: initial support for extended ACK reporting") to include netlink extended error reporting for expressions. This allows userspace to identify what rule expression is triggering the error. Signed-off-by: Pablo Neira Ayuso --- net/netfilter/nf_

  1   2   >