Re: [PATCH v2] net-fq: Add WARN_ON check for null flow.

2018-06-07 Thread Cong Wang
On Thu, Jun 7, 2018 at 4:48 PM, wrote: > diff --git a/include/net/fq_impl.h b/include/net/fq_impl.h > index be7c0fa..cb911f0 100644 > --- a/include/net/fq_impl.h > +++ b/include/net/fq_impl.h > @@ -78,7 +78,10 @@ static struct sk_buff *fq_tin_dequeue(struct fq *fq, >

Re: [Patch net] socket: close race condition between sock_close() and sockfs_setattr()

2018-06-07 Thread Cong Wang
On Thu, Jun 7, 2018 at 3:04 PM, Al Viro wrote: > On Thu, Jun 07, 2018 at 02:45:58PM -0700, Cong Wang wrote: >> On Thu, Jun 7, 2018 at 2:26 PM, Al Viro wrote: >> > On Thu, Jun 07, 2018 at 01:39:49PM -0700, Cong Wang wrote: >> >> fchownat() doesn't even hold ref

Re: [PATCH] net-fq: Add WARN_ON check for null flow.

2018-06-07 Thread Cong Wang
On Thu, Jun 7, 2018 at 2:41 PM, Ben Greear wrote: > On 06/07/2018 02:29 PM, Cong Wang wrote: >> >> On Thu, Jun 7, 2018 at 9:06 AM, wrote: >>> >>> --- a/include/net/fq_impl.h >>> +++ b/include/net/fq_impl.h >>> @@ -80,6 +80,9 @@

Re: [Patch net] socket: close race condition between sock_close() and sockfs_setattr()

2018-06-07 Thread Cong Wang
On Thu, Jun 7, 2018 at 2:26 PM, Al Viro wrote: > On Thu, Jun 07, 2018 at 01:39:49PM -0700, Cong Wang wrote: >> fchownat() doesn't even hold refcnt of fd until it figures out >> fd is really needed (otherwise is ignored) and releases it after >> it resolves the path. This mea

Re: [PATCH] net-fq: Add WARN_ON check for null flow.

2018-06-07 Thread Cong Wang
On Thu, Jun 7, 2018 at 9:06 AM, wrote: > --- a/include/net/fq_impl.h > +++ b/include/net/fq_impl.h > @@ -80,6 +80,9 @@ static struct sk_buff *fq_tin_dequeue(struct fq *fq, > > flow = list_first_entry(head, struct fq_flow, flowchain); > > + if (WARN_ON_ONCE(!flow)) > +

[Patch net] socket: close race condition between sock_close() and sockfs_setattr()

2018-06-07 Thread Cong Wang
nda Cc: Lorenzo Colitti Cc: Al Viro Signed-off-by: Cong Wang --- net/socket.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/net/socket.c b/net/socket.c index af57d85bcb48..8a109012608a 100644 --- a/net/socket.c +++ b/net/socket.c @@ -541,7 +541,

[Patch net v2] netdev-FAQ: clarify DaveM's position for stable backports

2018-06-05 Thread Cong Wang
Per discussion with David at netconf 2018, let's clarify DaveM's position of handling stable backports in netdev-FAQ. This is important for people relying on upstream -stable releases. Cc: sta...@vger.kernel.org Cc: Greg Kroah-Hartman Signed-off-by: Cong Wang --- Documentation/networking

Re: [Patch net-next] netdev-FAQ: clarify DaveM's position for stable backports

2018-06-05 Thread Cong Wang
On Tue, Jun 5, 2018 at 6:43 AM, David Miller wrote: > From: Cong Wang > Date: Mon, 4 Jun 2018 11:07:19 -0700 > >> +Q: Are all networking bug fixes backported to all stable releases? >> + >> +A: Due to capacity, Dave could only take care of the backports for the la

[Patch net-next] netdev-FAQ: clarify DaveM's position for stable backports

2018-06-04 Thread Cong Wang
Per discussion with David at netconf 2018, let's clarify DaveM's position of handling stable backports in netdev-FAQ. This is important for people relying on upstream -stable releases. Cc: sta...@vger.kernel.org Cc: Greg Kroah-Hartman Signed-off-by: Cong Wang --- Documentation/networking

Re: [PATCH net-next 0/2] cls_flower: Various fixes

2018-06-04 Thread Cong Wang
On Mon, Jun 4, 2018 at 12:35 AM, Roi Dayan wrote: > > > On 03/06/2018 22:39, Jiri Pirko wrote: >> >> Sun, Jun 03, 2018 at 08:33:25PM CEST, xiyou.wangc...@gmail.com wrote: >>> >>> On Wed, May 30, 2018 at 1:17 AM, Paul Blakey wrote: Two of the fixes are for my multiple mask patch

Re: [PATCH net-next 0/2] cls_flower: Various fixes

2018-06-03 Thread Cong Wang
On Wed, May 30, 2018 at 1:17 AM, Paul Blakey wrote: > Two of the fixes are for my multiple mask patch > > Paul Blakey (2): > cls_flower: Fix missing free of rhashtable > cls_flower: Fix comparing of old filter mask with new filter Both are bug fixes and one-line fixes, so definitely should

Re: [PATCH v3 00/11] Modify action API for implementing lockless actions

2018-05-28 Thread Cong Wang
On Sun, May 27, 2018 at 2:17 PM, Vlad Buslov wrote: > Currently, all netlink protocol handlers for updating rules, actions and > qdiscs are protected with single global rtnl lock which removes any > possibility for parallelism. This patch set is a first step to remove > rtnl lock dependency from

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-25 Thread Cong Wang
On Fri, May 25, 2018 at 1:39 PM, Vlad Buslov <vla...@mellanox.com> wrote: > > On Thu 24 May 2018 at 23:34, Cong Wang <xiyou.wangc...@gmail.com> wrote: >> On Mon, May 14, 2018 at 7:27 AM, Vlad Buslov <vla...@mellanox.com> wrote: >>> Currently, all netli

Re: [PATCH net-next] net:sched: add action inheritdsfield to skbmod

2018-05-25 Thread Cong Wang
On Thu, May 24, 2018 at 10:45 PM, Fu, Qiaobin wrote: > The new action inheritdsfield copies the field DS of > IPv4 and IPv6 packets into skb->priority. This enables > later classification of packets based on the DS field. Please move it to skbedit.

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-24 Thread Cong Wang
On Mon, May 14, 2018 at 7:27 AM, Vlad Buslov wrote: > Currently, all netlink protocol handlers for updating rules, actions and > qdiscs are protected with single global rtnl lock which removes any > possibility for parallelism. This patch set is a first step to remove > rtnl

Re: [PATCH net-next v3] net: sched: don't disable bh when accessing action idr

2018-05-23 Thread Cong Wang
en get rid of this spinlock since most of the callers hold RTNL lock, not sure about the dump() path where RTNL might be removed recently. Anyway, Acked-by: Cong Wang <xiyou.wangc...@gmail.com>

Re: [PATCH net-next] net:sched: add action inheritdsfield to skbmod

2018-05-23 Thread Cong Wang
On Thu, May 17, 2018 at 12:33 PM, Fu, Qiaobin wrote: > net/sched: add action inheritdsfield to skbmod > > The new action inheritdsfield copies the field DS of > IPv4 and IPv6 packets into skb->prioriry. This enables > later classification of packets based on the DS field. > >

[Patch net-next] net_sched: switch to rcu_work

2018-05-23 Thread Cong Wang
lt;paul...@linux.vnet.ibm.com> Cc: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- include/net/pkt_cls.h| 2 +- net/sched/cls_api.c | 5 +++-- net/sched/cls_basic.c| 24 +++- net/sched/cls_bpf.c

Re: [PATCH net-next v2] net: sched: don't disable bh when accessing action idr

2018-05-22 Thread Cong Wang
On Mon, May 21, 2018 at 1:03 PM, Vlad Buslov wrote: > Initial net_device implementation used ingress_lock spinlock to synchronize > ingress path of device. This lock was used in both process and bh context. > In some code paths action map lock was obtained while holding

Re: [PATCH] net: sched: don't disable bh when accessing action idr

2018-05-18 Thread Cong Wang
On Fri, May 18, 2018 at 8:45 AM, Vlad Buslov wrote: > Underlying implementation of action map has changed and doesn't require > disabling bh anymore. Replace all action idr spinlock usage with regular > calls that do not disable bh. Please explain explicitly why it is not

Re: [PATCH net-next v12 3/7] sch_cake: Add optional ACK filter

2018-05-17 Thread Cong Wang
On Thu, May 17, 2018 at 4:23 AM, Toke Høiland-Jørgensen wrote: > Eric Dumazet writes: > >> On 05/16/2018 01:29 PM, Toke Høiland-Jørgensen wrote: >>> The ACK filter is an optional feature of CAKE which is designed to improve >>> performance on links with very

Re: [PATCH net-next v12 2/7] sch_cake: Add ingress mode

2018-05-16 Thread Cong Wang
On Wed, May 16, 2018 at 1:29 PM, Toke Høiland-Jørgensen wrote: > + if (tb[TCA_CAKE_AUTORATE]) { > + if (!!nla_get_u32(tb[TCA_CAKE_AUTORATE])) > + q->rate_flags |= CAKE_FLAG_AUTORATE_INGRESS; > + else > +

Re: [PATCH net-next v12 4/7] sch_cake: Add NAT awareness to packet classifier

2018-05-16 Thread Cong Wang
On Wed, May 16, 2018 at 1:29 PM, Toke Høiland-Jørgensen wrote: > When CAKE is deployed on a gateway that also performs NAT (which is a > common deployment mode), the host fairness mechanism cannot distinguish > internal hosts from each other, and so fails to work correctly. > > To

Re: [PATCH net-next v12 1/7] sched: Add Common Applications Kept Enhanced (cake) qdisc

2018-05-16 Thread Cong Wang
On Wed, May 16, 2018 at 1:29 PM, Toke Høiland-Jørgensen wrote: > + > +static struct Qdisc *cake_leaf(struct Qdisc *sch, unsigned long arg) > +{ > + return NULL; > +} > + > +static unsigned long cake_find(struct Qdisc *sch, u32 classid) > +{ > + return 0; > +} > + >

Re: [PATCH net-next] sched: cls: enable verbose logging

2018-05-14 Thread Cong Wang
On Mon, May 14, 2018 at 1:47 PM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Mon, May 14, 2018 at 01:30:53PM -0700, Cong Wang wrote: >> On Sun, May 13, 2018 at 1:44 PM, Marcelo Ricardo Leitner >> <marcelo.leit...@gmail.com> wrote: &g

Re: [PATCH net-next] sched: cls: enable verbose logging

2018-05-14 Thread Cong Wang
On Sun, May 13, 2018 at 1:44 PM, Marcelo Ricardo Leitner wrote: > Currently, when the rule is not to be exclusively executed by the > hardware, extack is not passed along and offloading failures don't > get logged. The idea was that hardware failures are okay because

Re: [PATCH net 1/1] net sched actions: fix refcnt leak in skbmod

2018-05-11 Thread Cong Wang
troduce skbmod action") > Signed-off-by: Roman Mashak <m...@mojatatu.com> Acked-by: Cong Wang <xiyou.wangc...@gmail.com>

Re: [patch net] net: sched: fix error path in tcf_proto_create() when modules are not configured

2018-05-11 Thread Cong Wang
ched: push TC filter protocol creation into a separate > function") > Signed-off-by: Jiri Pirko <j...@mellanox.com> Acked-by: Cong Wang <xiyou.wangc...@gmail.com>

Re: [PATCH v2 net 1/1] net sched actions: fix invalid pointer dereferencing if skbedit flags missing

2018-05-11 Thread Cong Wang
> *a", > which later may be initialized to point at the existing action, otherwise > "struct tc_action *a" is still invalid, and therefore dereferencing it is an > error as happens in tcf_idr_release, where refcnt is decremented. > > So in case of missing flags tcf_idr_release must be called only for > existing actions. > > v2: > - prepare patch for net tree > > Signed-off-by: Roman Mashak <m...@mojatatu.com> Fixes: 5e1567aeb7fe ("net sched: skbedit action fix late binding") Acked-by: Cong Wang <xiyou.wangc...@gmail.com>

Re: [PATCH net V2] tun: fix use after free for ptr_ring

2018-05-11 Thread Cong Wang
On Thu, May 10, 2018 at 7:49 PM, Jason Wang wrote: > static void __tun_detach(struct tun_file *tfile, bool clean) > { > struct tun_file *ntfile; > @@ -736,7 +727,8 @@ static void __tun_detach(struct tun_file *tfile, bool > clean) >

Re: [PATCH net] tun: fix use after free for ptr_ring

2018-05-10 Thread Cong Wang
On Tue, May 8, 2018 at 11:59 PM, Jason Wang wrote: > We used to initialize ptr_ring during TUNSETIFF, this is because its > size depends on the tx_queue_len of netdevice. And we try to clean it > up when socket were detached from netdevice. A race were spotted when > trying

Re: [PATCH net-next 1/1] net sched actions: fix invalid pointer dereferencing if skbedit flags missing

2018-05-10 Thread Cong Wang
On Wed, May 9, 2018 at 2:18 PM, Roman Mashak wrote: > The caller calls action's ->init() and passes pointer to "struct tc_action > *a", > which later may initialized to point at the existing action, otherwise > "struct tc_action *a" is still invalid, and therefore

Re: [PATCH net-next] net:sched: add gkprio scheduler

2018-05-10 Thread Cong Wang
On Wed, May 9, 2018 at 7:09 AM, Michel Machado <mic...@digirati.com.br> wrote: > On 05/08/2018 10:24 PM, Cong Wang wrote: >> >> On Tue, May 8, 2018 at 5:59 AM, Michel Machado <mic...@digirati.com.br> >> wrote: >>>>> >>>>> Overall

Re: BUG: spinlock bad magic in tun_do_read

2018-05-08 Thread Cong Wang
On Mon, May 7, 2018 at 11:04 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > > > On 05/07/2018 10:54 PM, Cong Wang wrote: >> >> Yeah, we should return early before hitting this uninitialized ptr ring... >> Something like: >> >> diff --git a/d

Re: [PATCH net-next] net:sched: add gkprio scheduler

2018-05-08 Thread Cong Wang
On Tue, May 8, 2018 at 6:29 AM, Jamal Hadi Salim wrote: > Have you considered using skb->prio instead of peeking into the packet > header. > Also have you looked at the dsmark qdisc? > dsmark modifies ds fields, while this one just maps ds fields into different queues.

Re: [PATCH net-next] net:sched: add gkprio scheduler

2018-05-08 Thread Cong Wang
On Tue, May 8, 2018 at 5:59 AM, Michel Machado wrote: >>> Overall it looks good to me, just one thing below: >>> +struct Qdisc_ops gkprio_qdisc_ops __read_mostly = { + .id = "gkprio", + .priv_size = sizeof(struct

Re: BUG: spinlock bad magic in tun_do_read

2018-05-07 Thread Cong Wang
On Mon, May 7, 2018 at 10:27 PM, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:75bc37fefc44 Linux 4.17-rc4 > git tree: upstream > console output:

Re: [PATCH net-next] net:sched: add gkprio scheduler

2018-05-07 Thread Cong Wang
On Mon, May 7, 2018 at 2:36 AM, Nishanth Devarajan wrote: > net/sched: add gkprio scheduler > > Gkprio (Gatekeeper Priority Queue) is a queueing discipline that prioritizes > IPv4 and IPv6 packets accordingly to their DSCP field. Although Gkprio can be > employed in any QoS

Re: [PATCH net-next v8 1/7] sched: Add Common Applications Kept Enhanced (cake) qdisc

2018-05-07 Thread Cong Wang
On Mon, May 7, 2018 at 11:37 AM, Toke Høiland-Jørgensen <t...@toke.dk> wrote: > Cong Wang <xiyou.wangc...@gmail.com> writes: > >> On Fri, May 4, 2018 at 12:10 PM, Toke Høiland-Jørgensen <t...@toke.dk> wrote: >>> Thank you for the review!

Re: [PATCH net-next v8 1/7] sched: Add Common Applications Kept Enhanced (cake) qdisc

2018-05-07 Thread Cong Wang
On Fri, May 4, 2018 at 12:10 PM, Toke Høiland-Jørgensen wrote: > Thank you for the review! A few comments below, I'll fix the rest. > >> [...] >> >> So sch_cake doesn't accept normal tc filters? Is this intentional? >> If so, why? > > For two reasons: > > - The two-level scheduling

Re: [PATCH net-next v8 1/7] sched: Add Common Applications Kept Enhanced (cake) qdisc

2018-05-04 Thread Cong Wang
On Fri, May 4, 2018 at 7:02 AM, Toke Høiland-Jørgensen wrote: > +struct cake_sched_data { > + struct cake_tin_data *tins; > + > + struct cake_heap_entry overflow_heap[CAKE_QUEUES * CAKE_MAX_TINS]; > + u16 overflow_timeout; > + > + u16

Re: [lkp-robot] 486ad79630 [ 15.532543] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004

2018-05-03 Thread Cong Wang
On Wed, May 2, 2018 at 10:44 PM, Andrew Morton <a...@linux-foundation.org> wrote: > On Wed, 2 May 2018 21:58:25 -0700 Cong Wang <xiyou.wangc...@gmail.com> wrote: > >> On Wed, May 2, 2018 at 9:27 PM, Andrew Morton <a...@linux-foundation.org> >> wrote: >>

Re: [lkp-robot] 486ad79630 [ 15.532543] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004

2018-05-02 Thread Cong Wang
On Wed, May 2, 2018 at 9:27 PM, Andrew Morton wrote: > > So it's saying that something which got committed into Linus's tree > after 4.17-rc3 has caused a NULL deref in > sock_release->llc_ui_release+0x3a/0xd0 Do you mean it contains commit 3a04ce7130a7 ("llc: fix NULL

Re: [PATCH net-next v6] Add Common Applications Kept Enhanced (cake) qdisc

2018-05-01 Thread Cong Wang
On Tue, May 1, 2018 at 12:12 PM, Eric Dumazet wrote: > > I guess that nobody really wants to really review Cake if > it is a file with 2700 lines of code and hundreds of variables/tunables. > > Sure, we have big files in networking land, as a result of thousands of >

Re: [PATCH net-next v6] Add Common Applications Kept Enhanced (cake) qdisc

2018-04-30 Thread Cong Wang
On Mon, Apr 30, 2018 at 2:27 PM, Dave Taht <dave.t...@gmail.com> wrote: > On Mon, Apr 30, 2018 at 2:21 PM, Cong Wang <xiyou.wangc...@gmail.com> wrote: >> On Sun, Apr 29, 2018 at 2:34 PM, Toke Høiland-Jørgensen <t...@toke.dk> wrote: >>> sch_cake targets the

Re: [PATCH net-next v6] Add Common Applications Kept Enhanced (cake) qdisc

2018-04-30 Thread Cong Wang
On Sun, Apr 29, 2018 at 2:34 PM, Toke Høiland-Jørgensen wrote: > sch_cake targets the home router use case and is intended to squeeze the > most bandwidth and latency out of even the slowest ISP links and routers, > while presenting an API simple enough that even an ISP can

Re: [PATCH net-next] net: sch: prio: Set bands to default on delete instead of noop

2018-04-27 Thread Cong Wang
On Thu, Apr 26, 2018 at 6:32 AM, Nogah Frankel wrote: > When a band is created, it is set to the default qdisc, which is > "invisible" pfifo. Isn't TCA_DUMP_INVISIBLE for dumping this invisible qdisc? > However, if a band is set to a qdisc that is later being deleted, it

[Patch nf] ipvs: initialize tbl->entries in ip_vs_lblc_init_svc()

2018-04-23 Thread Cong Wang
ov <j...@ssi.bg> Cc: Pablo Neira Ayuso <pa...@netfilter.org> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- net/netfilter/ipvs/ip_vs_lblc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index 3057e453bf

[Patch nf] ipvs: initialize tbl->entries after allocation

2018-04-23 Thread Cong Wang
@ssi.bg> Cc: Pablo Neira Ayuso <pa...@netfilter.org> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- net/netfilter/ipvs/ip_vs_lblcr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index 92adc04557ed..bc2bc5

Re: KASAN: null-ptr-deref Read in refcount_inc_not_zero

2018-04-23 Thread Cong Wang
#syz fix: llc: fix NULL pointer deref for SOCK_ZAPPED

[Patch net] llc: fix NULL pointer deref for SOCK_ZAPPED

2018-04-19 Thread Cong Wang
For SOCK_ZAPPED socket, we don't need to care about llc->sap, so we should just skip these refcount functions in this case. Fixes: f7e43672683b ("llc: hold llc_sap before release_sock()") Reported-by: kernel test robot <l...@intel.com> Signed-off-by: Cong Wang <xiyou.wangc.

[Patch net] llc: delete timers synchronously in llc_sk_free()

2018-04-19 Thread Cong Wang
change them to synchronously when needed. Also, move the code to net/llc/llc_conn.c, which is apparently a better place. Reported-by: <syzbot+f922284c18ea23a8e...@syzkaller.appspotmail.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- include/net/llc_conn.h | 1 + net/ll

[Patch net] llc: hold llc_sap before release_sock()

2018-04-18 Thread Cong Wang
tmail.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- net/llc/af_llc.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index 01dcc0823d1f..6d29b2b94e84 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c @@ -189,6 +189,7 @@ static

Re: [PATCH 8/8] CREDITS: Add Chris Novakovic

2018-04-17 Thread Cong Wang
On Tue, Apr 17, 2018 at 1:58 PM, Chris Novakovic wrote: > Signed-off-by: Chris Novakovic > --- > CREDITS | 4 It is rare to update CREDITS, people now use git to credit contributions.

[Patch net] tipc: use the right skb in tipc_sk_fill_sock_diag()

2018-04-06 Thread Cong Wang
TIPC) Cc: GhantaKrishnamurthy MohanKrishna <mohan.krishna.ghanta.krishnamur...@ericsson.com> Cc: Jon Maloy <jon.ma...@ericsson.com> Cc: Ying Xue <ying@windriver.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- net/tipc/diag.c | 2 +- net/tipc/socket.c | 6 +

[Patch net] net_sched: fix a missing idr_remove() in u32_delete_key()

2018-04-06 Thread Cong Wang
tion.org> Cc: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- net/sched/cls_u32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index ed8b6a24b9e9..bac47b5d18fd 100644 --- a/net/sched/cls_u32.c +

Re: Problem with the kernel 4.15 - cutting the band (tc)

2018-04-06 Thread Cong Wang
On Fri, Apr 6, 2018 at 2:56 PM, Linus Torvalds wrote: > Forwarding a report about what looks like a regression between 4.14 and 4.15. > > New ENOSPC issue? I don't even knew where to start guessing where to look. > > Help me, Davem-Wan Kenobi, you are my only hope.

Re: possible deadlock in skb_queue_tail

2018-04-03 Thread Cong Wang
On Tue, Apr 3, 2018 at 4:42 AM, Kirill Tkhai wrote: > On 03.04.2018 14:25, Dmitry Vyukov wrote: >> On Tue, Apr 3, 2018 at 11:50 AM, Kirill Tkhai wrote: >>> sk_diag_dump_icons() dumps only sockets in TCP_LISTEN state. >>> TCP_LISTEN state may be

[Patch net] af_unix: remove redundant lockdep class

2018-04-02 Thread Cong Wang
oesn't fix it (this is why I don't add Reported-by). Fixes: 581319c58600 ("net/socket: use per af lockdep classes for sk queues") Cc: Paolo Abeni <pab...@redhat.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- net/unix/af_unix.c | 10 -- 1 file changed, 10 del

[Patch nf] nf_conntrack_extend: silent a memory leak warning

2018-03-30 Thread Cong Wang
<pa...@netfilter.org> Cc: Jozsef Kadlecsik <kad...@blackhole.kfki.hu> Cc: Florian Westphal <f...@strlen.de> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- net/netfilter/nf_conntrack_extend.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/

Re: WARNING in refcount_dec

2018-03-28 Thread Cong Wang
(Cc'ing netdev and Willem) On Wed, Mar 28, 2018 at 12:03 PM, Byoungyoung Lee wrote: > Another crash patterns observed: race between (setsockopt$packet_int) > and (bind$packet). > > -- > [ 357.731597] kernel BUG at >

[Patch net] llc: properly handle dev_queue_xmit() return value

2018-03-26 Thread Cong Wang
ed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- include/net/llc_conn.h | 2 +- net/llc/llc_c_ac.c | 15 +-- net/llc/llc_conn.c | 32 +++- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/include/net/llc_conn.h b/include/net/llc_

Re: [net PATCH v2] net: sched, fix OOO packets with pfifo_fast

2018-03-26 Thread Cong Wang
On Sat, Mar 24, 2018 at 10:25 PM, John Fastabend wrote: > After the qdisc lock was dropped in pfifo_fast we allow multiple > enqueue threads and dequeue threads to run in parallel. On the > enqueue side the skb bit ooo_okay is used to ensure all related > skbs are

Re: [PATCH net v2 0/7] fix idr leak in actions

2018-03-20 Thread Cong Wang
On Mon, Mar 19, 2018 at 7:31 AM, Davide Caratti <dcara...@redhat.com> wrote: > This series fixes situations where a temporary failure to install a TC > action results in the permanent impossibility to reuse the configured > value of 'index'. > > Thanks to Cong Wang for the i

Re: WARNING: CPU: 3 PID: 0 at net/sched/sch_hfsc.c:1388 hfsc_dequeue+0x319/0x350 [sch_hfsc]

2018-03-15 Thread Cong Wang
On Wed, Mar 14, 2018 at 1:10 AM, Marco Berizzi <pupi...@libero.it> wrote: >> Il 9 marzo 2018 alle 0.14 Cong Wang <xiyou.wangc...@gmail.com> ha scritto: >> >> >> On Thu, Mar 8, 2018 at 8:02 AM, Marco Berizzi <pupi...@libero.it> wrote: >> >>

Re: [PATCH net] net/sched: act_simple: don't leak 'index' in the error path

2018-03-15 Thread Cong Wang
On Wed, Mar 14, 2018 at 3:43 PM, Davide Caratti <dcara...@redhat.com> wrote: > hello Cong, thank you for reviewing this. > > On Wed, 2018-03-14 at 11:41 -0700, Cong Wang wrote: >> On Tue, Mar 13, 2018 at 7:13 PM, Davide Caratti <dcara...@redhat.com> wrote: >> >

Re: [PATCH net] net/sched: act_simple: don't leak 'index' in the error path

2018-03-14 Thread Cong Wang
On Tue, Mar 13, 2018 at 7:13 PM, Davide Caratti wrote: > Similarly to what other TC actions do, we can duplicate 'sdata' before > calling tcf_idr_create(), and avoid calling tcf_idr_cleanup(), so that > leaks of 'index' don't occur anymore. Looks like we just need to replace

Re: [PATCH 1/1] net: check dev->reg_state before deref of napi netdev_ops

2018-03-12 Thread Cong Wang
On Sun, Mar 11, 2018 at 12:22 PM, Josh Elsasser wrote: > init_dummy_netdev() leaves its netdev_ops pointer zeroed. This leads > to a NULL pointer dereference when sk_busy_loop fires against an iwlwifi > wireless adapter and checks napi->dev->netdev_ops->ndo_busy_poll. > >

Re: [PATCH net-next 1/1] net sched actions: return explicit error when tunnel_key mode is not specified

2018-03-12 Thread Cong Wang
6dd8a914f ("net/sched: Introduce act_tunnel_key") > Signed-off-by: Roman Mashak <m...@mojatatu.com> Acked-by: Cong Wang <xiyou.wangc...@gmail.com> This should go to -net rather than -net-next. Thanks.

Re: WARNING in __proc_create

2018-03-09 Thread Cong Wang
On Fri, Mar 9, 2018 at 3:21 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > > > On 03/09/2018 03:05 PM, Cong Wang wrote: >> >> >> BTW, the warning itself is all about empty names, so perhaps >> it's better to fix them separately. > > > Huh ? Yo

Re: WARNING in __proc_create

2018-03-09 Thread Cong Wang
On Fri, Mar 9, 2018 at 2:58 PM, Eric Dumazet wrote: > > > On 03/09/2018 02:56 PM, Eric Dumazet wrote: > >> >> I sent a patch a while back, but Pablo/Florian wanted more than that >> simple fix. >> >> We also need to filter special characters like '/' proc_create_data()

Re: WARNING in __proc_create

2018-03-09 Thread Cong Wang
On Fri, Mar 9, 2018 at 1:59 PM, syzbot wrote: > Hello, > > syzbot hit the following crash on net-next commit > 617aebe6a97efa539cc4b8a52adccd89596e6be0 (Sun Feb 4 00:25:42 2018 +) > Merge tag 'usercopy-v4.16-rc1' of >

Re: WARNING: CPU: 3 PID: 0 at net/sched/sch_hfsc.c:1388 hfsc_dequeue+0x319/0x350 [sch_hfsc]

2018-03-08 Thread Cong Wang
On Thu, Mar 8, 2018 at 8:02 AM, Marco Berizzi wrote: >> Marco Berizzi wrote: >> >> >> Hello everyone, >> >> Yesterday I got this error on a slackware linux 4.16-rc4 system >> running as a traffic shaping gateway and netfilter nat. >> The error has been arisen after a partial

[Patch nf-next] netfilter: make xt_rateest hash table per net

2018-03-01 Thread Cong Wang
As suggested by Eric, we need to make the xt_rateest hash table and its lock per netns to reduce lock contentions. Cc: Florian Westphal <f...@strlen.de> Cc: Eric Dumazet <eduma...@google.com> Cc: Pablo Neira Ayuso <pa...@netfilter.org> Signed-off-by: Cong Wang <xiy

[Patch 4.14 4/4] net: sched: fix use-after-free in tcf_block_put_ext

2018-03-01 Thread Cong Wang
From: Jiri Pirko [ Upstream commit df45bf84e4f5a48f23d4b1a07d21d5 ] Since the block is freed with last chain being put, once we reach the end of iteration of list_for_each_entry_safe, the block may be already freed. I'm hitting this only by creating and deleting clsact: [

[Patch 4.14 3/4] net_sched: get rid of rcu_barrier() in tcf_block_put_ext()

2018-03-01 Thread Cong Wang
..@mellanox.com> Cc: Jamal Hadi Salim <j...@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> Signed-off-by: David S. Miller <da...@davemloft.net> --- include/net/sch_generic.h | 1 - net/sched/cls_api.c | 29 + 2 files ch

[Patch 4.14 2/4] net: sched: crash on blocks with goto chain action

2018-03-01 Thread Cong Wang
From: Roman Kapl [ Upstream commit a60b3f515d30d0fe8537c64671926879a3548103 ] tcf_block_put_ext has assumed that all filters (and thus their goto actions) are destroyed in RCU callback and thus can not race with our list iteration. However, that is not true during netns cleanup

[Patch 4.14 1/4] net: sched: fix crash when deleting secondary chains

2018-03-01 Thread Cong Wang
From: Roman Kapl [ Upstream commit d7aa04a5e82b4f254d306926c81eae8df69e5200 ] If you flush (delete) a filter chain other than chain 0 (such as when deleting the device), the kernel may run into a use-after-free. The chain refcount must not be decremented unless we are sure we are

[Patch 4.14 0/4] net_sched: backport tc filter fixes to 4.14

2018-03-01 Thread Cong Wang
-by: Roland Franke <fl...@franke-prem.de> Tested-by: Roland Franke <fl...@franke-prem.de> Cc: Jiri Pirko <j...@mellanox.com> Cc: Roman Kapl <c...@rkapl.cz> Cc: David S. Miller <da...@davemloft.net> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> ---

Re: [PATCH] net: make tc-police action MTU behavior match documentation

2018-02-28 Thread Cong Wang
On Tue, Feb 27, 2018 at 9:41 AM, Andrew Collins wrote: >> I don't find such statement from the man page: >> http://man7.org/linux/man-pages/man8/tc-police.8.html > > >> What am I missing? > > Under MTU the man page states: > > mtu BYTES[/BYTES] > This is

Re: [PATCH] net: make tc-police action MTU behavior match documentation

2018-02-26 Thread Cong Wang
On Mon, Feb 26, 2018 at 12:10 PM, Andrew Collins wrote: > The man page for tc-police states that the MTU defaults to > unlimited if peakrate is not specified, but it actually defaults > to 2047. I don't find such statement from the man page:

Re: Kernel panic with 4.16-rc1 (and 4.16-rc2) running selftest

2018-02-23 Thread Cong Wang
On Fri, Feb 23, 2018 at 3:27 PM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Fri, Feb 23, 2018 at 11:00 AM, Randy Dunlap <rdun...@infradead.org> wrote: >> [adding netdev] >> >> On 02/23/2018 08:05 AM, Khalid Aziz wrote: >>> I am seeing a kernel pan

Re: Kernel panic with 4.16-rc1 (and 4.16-rc2) running selftest

2018-02-23 Thread Cong Wang
On Fri, Feb 23, 2018 at 11:00 AM, Randy Dunlap wrote: > [adding netdev] > > On 02/23/2018 08:05 AM, Khalid Aziz wrote: >> I am seeing a kernel panic with 4.16-rc1 and 4.16-rc2 kernels when running >> selftests >> from tools/testing/selftests. Last messages from selftest

Re: ppp/pppoe, still panic 4.15.3 in ppp_push

2018-02-21 Thread Cong Wang
On Thu, Feb 15, 2018 at 11:31 AM, Guillaume Nault wrote: > On Thu, Feb 15, 2018 at 06:01:16PM +0200, Denys Fedoryshchenko wrote: >> On 2018-02-15 17:55, Guillaume Nault wrote: >> > On Thu, Feb 15, 2018 at 12:19:52PM +0200, Denys Fedoryshchenko wrote: >> > > Here we go: >> >

Re: [PATCH 2/3] net: Make cleanup_list and net::cleanup_list of llist type

2018-02-20 Thread Cong Wang
On Mon, Feb 19, 2018 at 1:58 AM, Kirill Tkhai wrote: > void __put_net(struct net *net) > { > /* Cleanup the network namespace in process context */ > - unsigned long flags; > - > - spin_lock_irqsave(_list_lock, flags); > - list_add(>cleanup_list,

Re: [PATCH v2] sched: report if filter is too large to dump

2018-02-20 Thread Cong Wang
ily if you create a filter > with 32 actions and have 4kb pages. Also recent versions of iproute try > to be clever with their buffer allocation size, which in turn leads to > > Signed-off-by: Roman Kapl <c...@rkapl.cz> Acked-by: Cong Wang <xiyou.wangc...@gmail.com>

Re: KASAN: use-after-free Read in sit_tunnel_xmit

2018-02-15 Thread Cong Wang
On Tue, Feb 13, 2018 at 10:48 AM, Dmitry Vyukov <dvyu...@google.com> wrote: > On Mon, Oct 30, 2017 at 7:41 PM, Cong Wang <xiyou.wangc...@gmail.com> wrote: >> On Mon, Oct 30, 2017 at 8:34 AM, syzbot >> <bot+1aa412fe58f4059538c0204a0f096524e6dce...@syzkaller.appspo

Re: Fwd: u32 ht filters

2018-02-10 Thread Cong Wang
On Wed, Feb 7, 2018 at 11:38 PM, Jiri Pirko wrote: > Thu, Feb 08, 2018 at 12:08:36AM CET, xiyou.wangc...@gmail.com wrote: >>On Tue, Feb 6, 2018 at 11:01 PM, Jiri Pirko wrote: >>> Wed, Feb 07, 2018 at 06:09:15AM CET, xiyou.wangc...@gmail.com wrote: Hi, Jiri

[Patch net v2] ipt_CLUSTERIP: fix a refcount bug in clusterip_config_find_get()

2018-02-08 Thread Cong Wang
xes: d73f33b16883 ("netfilter: CLUSTERIP: RCU conversion") Cc: Eric Dumazet <eric.duma...@gmail.com> Cc: Pablo Neira Ayuso <pa...@netfilter.org> Cc: Florian Westphal <f...@strlen.de> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- net/ipv4/netfilter/ipt_CLUSTE

Re: [Patch net] ipt_CLUSTERIP: fix a refcount bug in clusterip_config_find_get()

2018-02-08 Thread Cong Wang
On Thu, Feb 8, 2018 at 12:01 AM, Florian Westphal <f...@strlen.de> wrote: > Cong Wang <xiyou.wangc...@gmail.com> wrote: >> In clusterip_config_find_get() we hold RCU read lock so it could >> run concurrently with clusterip_config_entry_put(), as a result, >> the

[Patch net] ipt_CLUSTERIP: fix a refcount bug in clusterip_config_find_get()

2018-02-07 Thread Cong Wang
xes: d73f33b16883 ("netfilter: CLUSTERIP: RCU conversion") Cc: Eric Dumazet <eric.duma...@gmail.com> Cc: Pablo Neira Ayuso <pa...@netfilter.org> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- net/ipv4/netfilter/ipt_CLUSTERIP.c | 6 -- 1 file changed, 4 insertions

[Patch net] ipt_CLUSTERIP: fix a race condition of proc file creation

2018-02-07 Thread Cong Wang
t; Cc: Pablo Neira Ayuso <pa...@netfilter.org> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --- net/ipv4/netfilter/ipt_CLUSTERIP.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c

Re: Fwd: u32 ht filters

2018-02-07 Thread Cong Wang
On Tue, Feb 6, 2018 at 11:01 PM, Jiri Pirko wrote: > Wed, Feb 07, 2018 at 06:09:15AM CET, xiyou.wangc...@gmail.com wrote: >>Hi, Jiri >> >>Your commit 7fa9d974f3c2a016b9accb18f4ee2ed2a738585c >>breaks the tc script by Paweł. Please find below for details. > > Did you do the

Re: WARNING: proc registration bug in clusterip_tg_check

2018-02-06 Thread Cong Wang
On Tue, Feb 6, 2018 at 6:27 AM, syzbot wrote: > Hello, > > syzbot hit the following crash on net-next commit > 617aebe6a97efa539cc4b8a52adccd89596e6be0 (Sun Feb 4 00:25:42 2018 +) > Merge tag 'usercopy-v4.16-rc1' of >

Re: Two net_sched fixes for stable

2018-02-06 Thread Cong Wang
On Tue, Feb 6, 2018 at 12:20 PM, David Miller <da...@davemloft.net> wrote: > From: Cong Wang <xiyou.wangc...@gmail.com> >> >> Please let me know how you want to handle this for 4.14. > > Ok, I sent this off for 4.15 -stable but I need you to do the > 4.14

Fwd: u32 ht filters

2018-02-06 Thread Cong Wang
mit it becomes per-block or per-class... this is why the script below is broken. -- Forwarded message -- From: Paweł Staszewski <pstaszew...@itcare.pl> Date: Tue, Feb 6, 2018 at 8:05 AM Subject: u32 ht filters To: Cong Wang <xiyou.wangc...@gmail.com> Hi Is there so

Two net_sched fixes for stable

2018-02-06 Thread Cong Wang
Hi, David Can you queue the following commits for stable? They fix a sleep-in-atomic warning reported by Roland. commit efbf78973978b0d25af59bc26c8013a942af6e64 Author: Cong Wang <xiyou.wangc...@gmail.com> Date: Mon Dec 4 10:48:18 2017 -0800 net_sched: get rid of rcu_b

[Patch net v2] xt_RATEEST: acquire xt_rateest_mutex for hash insert

2018-02-05 Thread Cong Wang
bot+5cb189720978275e4...@syzkaller.appspotmail.com> Fixes: 5859034d7eb8 ("[NETFILTER]: x_tables: add RATEEST target") Cc: Pablo Neira Ayuso <pa...@netfilter.org> Cc: Eric Dumazet <eric.duma...@gmail.com> Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> --

Re: [PATCH net v4] cls_u32: fix use after free in u32_destroy_key()

2018-02-05 Thread Cong Wang
ned-up code comment > v3 -> v4: > - dropped unneeded comment > > Reported-by: Li Shuang <shu...@redhat.com> > Fixes: c0d378ef1266 ("net_sched: use tcf_queue_work() in u32 filter") > Signed-off-by: Paolo Abeni <pab...@redhat.com> Acked-by: Cong Wang <xiyou.wangc...@gmail.com> Thanks.

Re: [PATCH net v3] cls_u32: fix use after free in u32_destroy_key()

2018-02-05 Thread Cong Wang
On Mon, Feb 5, 2018 at 1:20 AM, Paolo Abeni wrote: > @@ -625,6 +627,8 @@ static int u32_destroy_hnode(struct tcf_proto *tp, struct > tc_u_hnode *ht, > idr_destroy(>handle_idr); > idr_remove_ext(_c->handle_idr, ht->handle); >

<    1   2   3   4   5   6   7   8   9   10   >