[PATCH net-next 2/2] neighbour: send netlink notification if NTF_ROUTER changes

2018-09-22 Thread Roopa Prabhu
From: Roopa Prabhu 

send netlink notification if neigh_update results in NTF_ROUTER
change and if NEIGH_UPDATE_F_ISROUTER is on. Also move the
NTF_ROUTER change function into a helper.

Signed-off-by: Roopa Prabhu 
---
 include/net/neighbour.h | 15 +++
 net/core/neighbour.c|  7 ++-
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 6c1eecd..0874f7fc 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -544,4 +544,19 @@ static inline void neigh_update_ext_learned(struct 
neighbour *neigh, u32 flags,
*notify = 1;
}
 }
+
+static inline void neigh_update_is_router(struct neighbour *neigh, u32 flags,
+ int *notify)
+{
+   u8 ndm_flags = 0;
+
+   ndm_flags |= (flags & NEIGH_UPDATE_F_ISROUTER) ? NTF_ROUTER : 0;
+   if ((neigh->flags ^ ndm_flags) & NTF_ROUTER) {
+   if (ndm_flags & NTF_ROUTER)
+   neigh->flags |= NTF_ROUTER;
+   else
+   neigh->flags &= ~NTF_ROUTER;
+   *notify = 1;
+   }
+}
 #endif
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index ca99456..fb89294 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1277,11 +1277,8 @@ int neigh_update(struct neighbour *neigh, const u8 
*lladdr, u8 new,
neigh->arp_queue_len_bytes = 0;
}
 out:
-   if (update_isrouter) {
-   neigh->flags = (flags & NEIGH_UPDATE_F_ISROUTER) ?
-   (neigh->flags | NTF_ROUTER) :
-   (neigh->flags & ~NTF_ROUTER);
-   }
+   if (update_isrouter)
+   neigh_update_is_router(neigh, flags, );
write_unlock_bh(>lock);
 
if (notify)
-- 
2.1.4



[PATCH net-next 1/2] neighbour: allow admin to set NTF_ROUTER

2018-09-22 Thread Roopa Prabhu
From: Roopa Prabhu 

This patch allows admin setting of NTF_ROUTER flag
on a neighbour entry. This enables external control
plane (like bgp evpn) to manage neigh entries with
NTF_ROUTER flag.

Signed-off-by: Roopa Prabhu 
---
 net/core/neighbour.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index aa19d86..ca99456 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1709,7 +1709,8 @@ static int neigh_delete(struct sk_buff *skb, struct 
nlmsghdr *nlh,
 static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 struct netlink_ext_ack *extack)
 {
-   int flags = NEIGH_UPDATE_F_ADMIN | NEIGH_UPDATE_F_OVERRIDE;
+   int flags = NEIGH_UPDATE_F_ADMIN | NEIGH_UPDATE_F_OVERRIDE |
+   NEIGH_UPDATE_F_OVERRIDE_ISROUTER;
struct net *net = sock_net(skb->sk);
struct ndmsg *ndm;
struct nlattr *tb[NDA_MAX+1];
@@ -1784,12 +1785,16 @@ static int neigh_add(struct sk_buff *skb, struct 
nlmsghdr *nlh,
}
 
if (!(nlh->nlmsg_flags & NLM_F_REPLACE))
-   flags &= ~NEIGH_UPDATE_F_OVERRIDE;
+   flags &= ~(NEIGH_UPDATE_F_OVERRIDE |
+  NEIGH_UPDATE_F_OVERRIDE_ISROUTER);
}
 
if (ndm->ndm_flags & NTF_EXT_LEARNED)
flags |= NEIGH_UPDATE_F_EXT_LEARNED;
 
+   if (ndm->ndm_flags & NTF_ROUTER)
+   flags |= NEIGH_UPDATE_F_ISROUTER;
+
if (ndm->ndm_flags & NTF_USE) {
neigh_event_send(neigh, NULL);
err = 0;
-- 
2.1.4



[PATCH net-next 0/2] few NTF_ROUTER related updates

2018-09-22 Thread Roopa Prabhu
From: Roopa Prabhu 

This series allows setting of NTF_ROUTER by an external
entity (eg BGP E-VPN control plane). Also fixes missing
netlink notification on neigh NTF_ROUTER flag changes.

Roopa Prabhu (2):
  neighbour: allow admin to set NTF_ROUTER
  neighbour: send netlink notification if NTF_ROUTER changes

 include/net/neighbour.h | 15 +++
 net/core/neighbour.c| 16 +---
 2 files changed, 24 insertions(+), 7 deletions(-)

-- 
2.1.4



Re: [PATCH] net-ethtool: ETHTOOL_GUFO did not and should not require CAP_NET_ADMIN

2018-09-22 Thread David Miller
From: "Maciej Żenczykowski" 
Date: Sat, 22 Sep 2018 01:34:01 -0700

> From: Maciej Żenczykowski 
> 
> So it should not fail with EPERM even though it is no longer implemented...
> 
> This is a fix for:
>   (userns)$ egrep ^Cap /proc/self/status
>   CapInh: 003f
>   CapPrm: 003f
>   CapEff: 003f
>   CapBnd: 003f
>   CapAmb: 003f
> 
>   (userns)$ tcpdump -i usb_rndis0
>   tcpdump: WARNING: usb_rndis0: SIOCETHTOOL(ETHTOOL_GUFO) ioctl failed: 
> Operation not permitted
>   Warning: Kernel filter failed: Bad file descriptor
>   tcpdump: can't remove kernel filter: Bad file descriptor
> 
> With this change it returns EOPNOTSUPP instead of EPERM.
> 
> See also https://github.com/the-tcpdump-group/libpcap/issues/689
> 
> Fixes: 08a00fea6de2 "net: Remove references to NETIF_F_UFO from ethtool."
> Cc: David S. Miller 
> Signed-off-by: Maciej Żenczykowski 

Applied and queued up for -stable, thanks.


Re: [PATCH RFT net-next 0/2] net: phy: Eliminate unnecessary soft

2018-09-22 Thread Andrew Lunn
On Tue, Sep 18, 2018 at 06:35:03PM -0700, Florian Fainelli wrote:
> Hi all,
> 
> This patch series eliminates unnecessary software resets of the PHY.
> This should hopefully not break anybody's hardware; but I would
> appreciate testing to make sure this is is the case.
> 
> Sorry for this long email list, I wanted to make sure I reached out to
> all people who made changes to the Marvell PHY driver.

I got around to testing this at last. Not too much testing, just
booting it on five different systems using Marvell and Micrel PHYs.
They all got link as expected.

Tested-by: Andrew Lunn 

Andrew


[PATCH iproute2 4/7] configure: Remove non-posix shell expansion

2018-09-22 Thread Petr Vorel
+ change shebang to /bin/sh

Signed-off-by: Petr Vorel 
---
 configure | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 34325f99..8f4a7f1e 100755
--- a/configure
+++ b/configure
@@ -1,4 +1,4 @@
-#! /bin/bash
+#!/bin/sh
 # SPDX-License-Identifier: GPL-2.0
 # This is not an autoconf generated configure
 #
@@ -180,7 +180,8 @@ check_ipt_lib_dir()
 
for dir in /lib /usr/lib /usr/local/lib
do
-   for file in $dir/{xtables,iptables}/lib*t_*so ; do
+   for file in "xtables" "iptables"; do
+   file="$dir/$file/lib*t_*so"
if [ -f $file ]; then
echo ${file%/*}
echo "IPT_LIB_DIR:=${file%/*}" >> $CONFIG
-- 
2.19.0.rc2



[PATCH iproute2 5/7] configure: Code cleanup

2018-09-22 Thread Petr Vorel
Signed-off-by: Petr Vorel 
---
 configure | 65 +++
 1 file changed, 18 insertions(+), 47 deletions(-)

diff --git a/configure b/configure
index 8f4a7f1e..86c4cf58 100755
--- a/configure
+++ b/configure
@@ -32,9 +32,7 @@ int main(int argc, char **argv) {
 }
 EOF
 
-$CC -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1
-if [ $? -eq 0 ]
-then
+if $CC -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 
2>&1; then
echo "TC_CONFIG_ATM:=y" >>$CONFIG
echo yes
 else
@@ -45,8 +43,7 @@ EOF
 
 check_xtables()
 {
-   if ! ${PKG_CONFIG} xtables --exists
-   then
+   if ! ${PKG_CONFIG} xtables --exists; then
echo "TC_CONFIG_NO_XT:=y" >>$CONFIG
fi
 }
@@ -85,10 +82,7 @@ EOF
 check_xt_old()
 {
 # bail if previous XT checks has already succeded.
-if grep -q TC_CONFIG_XT $CONFIG
-then
-   return
-fi
+grep -q TC_CONFIG_XT $CONFIG && return
 
 #check if we dont need our internal header ..
 cat >$TMPDIR/ipttest.c &1
-if [ $? -eq 0 ]
-then
+if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl 
>/dev/null 2>&1; then
echo "TC_CONFIG_XT_OLD:=y" >>$CONFIG
echo "using old xtables (no need for xt-internal.h)"
 fi
@@ -124,10 +116,7 @@ EOF
 check_xt_old_internal_h()
 {
 # bail if previous XT checks has already succeded.
-if grep -q TC_CONFIG_XT $CONFIG
-then
-   return
-fi
+grep -q TC_CONFIG_XT $CONFIG && return
 
 #check if we need our own internal.h
 cat >$TMPDIR/ipttest.c &1
-
-   if [ $? -eq 0 ]
-   then
+   if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl 
>/dev/null 2>&1; then
echo "using old xtables with xt-internal.h"
echo "TC_CONFIG_XT_OLD_H:=y" >>$CONFIG
fi
@@ -163,8 +149,7 @@ EOF
 
 check_ipt()
 {
-   if ! grep TC_CONFIG_XT $CONFIG > /dev/null
-   then
+   if ! grep TC_CONFIG_XT $CONFIG > /dev/null; then
echo "using iptables"
fi
 }
@@ -178,8 +163,7 @@ check_ipt_lib_dir()
return
fi
 
-   for dir in /lib /usr/lib /usr/local/lib
-   do
+   for dir in /lib /usr/lib /usr/local/lib; do
for file in "xtables" "iptables"; do
file="$dir/$file/lib*t_*so"
if [ -f $file ]; then
@@ -202,9 +186,7 @@ int main(int argc, char **argv)
return 0;
 }
 EOF
-$CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1
-if [ $? -eq 0 ]
-then
+if $CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 
2>&1; then
echo "IP_CONFIG_SETNS:=y" >>$CONFIG
echo "yes"
echo "CFLAGS += -DHAVE_SETNS" >>$CONFIG
@@ -235,8 +217,7 @@ int main(void)
 #endif
 EOF
 
-if $CC -I$INCLUDE -o $TMPDIR/ipsettest $TMPDIR/ipsettest.c >/dev/null 2>&1
-then
+if $CC -I$INCLUDE -o $TMPDIR/ipsettest $TMPDIR/ipsettest.c >/dev/null 
2>&1; then
echo "TC_CONFIG_IPSET:=y" >>$CONFIG
echo "yes"
 else
@@ -247,8 +228,7 @@ EOF
 
 check_elf()
 {
-if ${PKG_CONFIG} libelf --exists
-then
+if ${PKG_CONFIG} libelf --exists; then
echo "HAVE_ELF:=y" >>$CONFIG
echo "yes"
 
@@ -262,8 +242,7 @@ check_elf()
 check_selinux()
 # SELinux is a compile time option in the ss utility
 {
-   if ${PKG_CONFIG} libselinux --exists
-   then
+   if ${PKG_CONFIG} libselinux --exists; then
echo "HAVE_SELINUX:=y" >>$CONFIG
echo "yes"
 
@@ -276,8 +255,7 @@ check_selinux()
 
 check_mnl()
 {
-   if ${PKG_CONFIG} libmnl --exists
-   then
+   if ${PKG_CONFIG} libmnl --exists; then
echo "HAVE_MNL:=y" >>$CONFIG
echo "yes"
 
@@ -299,9 +277,7 @@ int main(int argc, char **argv) {
return 0;
 }
 EOF
-$CC -I$INCLUDE -o $TMPDIR/dbtest $TMPDIR/dbtest.c -ldb >/dev/null 2>&1
-if [ $? -eq 0 ]
-then
+if $CC -I$INCLUDE -o $TMPDIR/dbtest $TMPDIR/dbtest.c -ldb >/dev/null 2>&1; 
then
echo "HAVE_BERKELEY_DB:=y" >>$CONFIG
echo "yes"
 else
@@ -320,9 +296,7 @@ int main(int argc, char **argv) {
return 0;
 }
 EOF
-$CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1
-if [ $? -eq 0 ]
-then
+if $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1; 
then
echo "no"
 else
echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG
@@ -333,8 +307,7 @@ EOF
 
 check_cap()
 {
-   if ${PKG_CONFIG} libcap --exists
-   then
+   if ${PKG_CONFIG} libcap --exists; then
echo "HAVE_CAP:=y" >>$CONFIG
echo "yes"
 
@@ -382,8 +355,7 @@ echo -n " ATM   "
 check_atm
 
 check_xtables
-if ! grep -q TC_CONFIG_NO_XT $CONFIG
-then
+if ! grep -q TC_CONFIG_NO_XT $CONFIG; then
echo -n " IPT   "
check_xt

[PATCH iproute2 2/7] tests: Use /bin/sh shebang

2018-09-22 Thread Petr Vorel
Bashisms for both tests were removed in ecd44e68 ("tests: Remove
bashisms (s/source/.)"), so no need to use bash shebang.

+ remove trailing whitespace.

Signed-off-by: Petr Vorel 
---
 testsuite/tests/tc/cls-testbed.t | 4 ++--
 testsuite/tests/tc/dsmark.t  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/testsuite/tests/tc/cls-testbed.t b/testsuite/tests/tc/cls-testbed.t
index d5c21e5c..cf34dd63 100755
--- a/testsuite/tests/tc/cls-testbed.t
+++ b/testsuite/tests/tc/cls-testbed.t
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # vim: ft=sh
 
 . lib/generic.sh
@@ -61,7 +61,7 @@ for q in ${QDISCS}; do
ts_tc "cls-testbed" "tree listing" qdisc list dev eth0
ts_tc "cls-testbed" "tree class listing" class list dev eth0
ts_log "cls-testbed: starting classifier test $c"
-   $c 
+   $c
 
case "$q" in
*)
diff --git a/testsuite/tests/tc/dsmark.t b/testsuite/tests/tc/dsmark.t
index 177585e6..3f1d5ef2 100755
--- a/testsuite/tests/tc/dsmark.t
+++ b/testsuite/tests/tc/dsmark.t
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # vim: ft=sh
 
 . lib/generic.sh
-- 
2.19.0.rc2



[PATCH iproute2 6/7] examples: Remove dhcp-client-script

2018-09-22 Thread Petr Vorel
This script is obsolete.

Signed-off-by: Petr Vorel 
---
 examples/dhcp-client-script | 446 
 1 file changed, 446 deletions(-)
 delete mode 100644 examples/dhcp-client-script

diff --git a/examples/dhcp-client-script b/examples/dhcp-client-script
deleted file mode 100644
index f39bc109..
--- a/examples/dhcp-client-script
+++ /dev/null
@@ -1,446 +0,0 @@
-#!/bin/bash
-#
-# dhclient-script for Linux.
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version
-#  2 of the License, or (at your option) any later version.
-#
-# Authors: Alexey Kuznetsov, 
-#
-# Probably, I did not understand, what this funny feature as "alias"
-# means exactly. For now I suppose, that it is a static address, which
-# we should install and preserve.
-#
-
-exec >> /var/log/DHS.log 2>&1
-
-echo dhc-script $* reason=$reason
-set | grep "^\(old_\|new_\|check_\)"
-
-LOG () {
-echo LOG $* ;
-}
-
-# convert 8bit mask to length
-# arg: $1 = mask
-#
-Mask8ToLen() {
-   local l=0;
-
-   while [ $l -le 7 ]; do
-   if [ $[ ( 1 << $l ) + $1 ] -eq 256 ]; then
-   return  $[ 8 - $l ]
-   fi
-   l=$[ $l + 1 ]
-   done
-   return 0;
-}
-
-# convert inet dotted quad mask to length
-# arg: $1 = dotquad mask
-#
-MaskToLen() {
- local masklen=0
- local mask8=$1
-
- case $1 in
- 0.0.0.0)
-   return 0;
-   ;;
- 255.*.0.0)
-   masklen=8
-   mask8=${mask8#255.}
-   mask8=${mask8%.0.0}
-   ;;
- 255.255.*.0)
-   masklen=16
-   mask8=${mask8#255.255.}
-   mask8=${mask8%.0}
-   ;;
- 255.255.255.*)
-   masklen=24
-   mask8=${mask8#255.255.255.}
-   ;;
- *)
-   return 255
-   ;;
- esac
- Mask8ToLen $mask8
- return $[ $? + $masklen ]
-}
-
-# calculate ABC "natural" mask
-# arg: $1 = dotquad address
-#
-ABCMask () {
- local class;
-
- class=${1%%.*}
-
- if [ "$1" = "255.255.255.255" ]; then
-echo $1
- elif [ "$1" = "0.0.0.0" ]; then
-echo $1
- elif [ $class -ge 224 ]; then
-echo 240.0.0.0
- elif [ $class -ge 192 ]; then
-echo 255.255.255.0
- elif [ $class -ge 128 ]; then
-echo 255.255.0.0
- else
-echo 255.0.0.0
- fi
-}
-
-# calculate ABC "natural" mask length
-# arg: $1 = dotquad address
-#
-ABCMaskLen () {
- local class;
-
- class=${1%%.*}
-
- if [ "$1" = "255.255.255.255" ]; then
-return 32
- elif [ "$1" = "0.0.0.0" ]; then
-return 0
- elif [ $class -ge 224 ]; then
-return 4;
- elif [ $class -ge 192 ]; then
-return 24;
- elif [ $class -ge 128 ]; then
-return 16;
- else
-return 8;
- fi
-}
-
-# Delete IP address
-# args: $1 = interface
-#   $2 = address
-#   $3 = mask
-#   $4 = broadcast
-#   $5 = label
-#
-DelINETAddr () {
-  local masklen=32
-  local addrid=$1
-
-  LOG DelINETAddr $*
-
-  if [ "$5" ]; then
-addrid=$addrid:$5
-  fi
-  LOG ifconfig $addrid down
-  ifconfig $addrid down
-}
-
-# Add IP address
-# args: $1 = interface
-#   $2 = address
-#   $3 = mask
-#   $4 = broadcast
-#   $5 = label
-#
-AddINETAddr () {
-  local mask_arg
-  local brd_arg
-  local addrid=$1
-
-  LOG AddINETAddr $*
-
-  if [ "$5" ]; then
-addrid=$addrid:$5
-  fi
-  if [ "$3" ]; then
-mask_arg="netmask $3"
-  fi
-  if [ "$4" ]; then
-brd_arg="broadcast $4"
-  fi
-
-  LOG ifconfig $addrid $2 $mask_arg $brd_arg up
-  ifconfig $addrid $2 $mask_arg $brd_arg up
-}
-
-# Add default routes
-# args: $1 = routers list
-#
-AddDefaultRoutes() {
-local router
-
-if [ "$1" ]; then
-  LOG AddDefaultRoutes $*
-  for router in $1; do
-LOG route add default gw $router
-route add default gw $router
-  done ;
-fi
-}
-
-# Delete default routes
-# args: $1 = routers list
-#
-DelDefaultRoutes() {
-local router
-
-if [ "$1" ]; then
-  LOG DelDefaultRoutes $*
-
-  for router in $1; do
-LOG route del default gw $router
-route del default gw $router
-  done
-fi
-}
-
-# ping a host
-# args: $1 = dotquad address of the host
-#
-PingNode() {
-LOG PingNode $*
-if ping -q -c 1 -w 2 $1 ; then
-   return 0;
-fi
-return 1;
-}
-
-# Check (and add route, if alive) default routers
-# args: $1 = routers list
-# returns: 0 if at least one router is alive.
-#
-CheckRouterList() {
-local router
-local succeed=1
-
-LOG CheckRouterList $*
-
-for router in $1; do
-  if PingNode $router ; then
-   succeed=0
-route add default gw $router
-  fi
-done
-return $succeed
-}
-
-# Delete/create static routes.
-# args: $1 = operation (del/add)
-#   $2 = routes list in format "dst1 nexthop1 dst2 ..."
-#
-# BEWARE: this feature of DHCP is obsolete, because does not
-# support subnetting.
-#
-X-StaticRouteList() {
-local 

[PATCH iproute2 1/7] man: rtpr: Rename s/bash/shell/

2018-09-22 Thread Petr Vorel
ip/rtpr mentioned in man as bash script is actually posix shell script
(doesn't require to use bash).

Signed-off-by: Petr Vorel 
---
 man/man8/rtpr.8 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/man8/rtpr.8 b/man/man8/rtpr.8
index 1b04a821..87f291ab 100644
--- a/man/man8/rtpr.8
+++ b/man/man8/rtpr.8
@@ -5,7 +5,7 @@ rtpr \- replace backslashes with newlines.
 
 .SH DESCRIPTION
 .B rtpr
-is a trivial bash script which converts backslashes in standard input to 
newlines. It's sole purpose is to be fed with input from
+is a trivial shell script which converts backslashes in standard input to 
newlines. It's sole purpose is to be fed with input from
 .B ip
 when executed with it's
 .B --oneline
-- 
2.19.0.rc2



[PATCH iproute2 7/7] examples: Remove cbq.init-v0.7.3

2018-09-22 Thread Petr Vorel
This script is obsolete.

Signed-off-by: Petr Vorel 
---
 examples/cbq.init-v0.7.3 | 983 ---
 1 file changed, 983 deletions(-)
 delete mode 100644 examples/cbq.init-v0.7.3

diff --git a/examples/cbq.init-v0.7.3 b/examples/cbq.init-v0.7.3
deleted file mode 100644
index 66448d88..
--- a/examples/cbq.init-v0.7.3
+++ /dev/null
@@ -1,983 +0,0 @@
-#!/bin/bash
-#
-#cbq.init v0.7.3
-#Copyright (C) 1999  Pavel Golubev 
-#Copyright (C) 2001-2004  Lubomir Bulej 
-#
-#chkconfig:   2345 11 89
-#description: sets up CBQ-based traffic control
-#
-#This program is free software; you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; either version 2 of the License, or
-#(at your option) any later version.
-#
-#This program is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with this program; if not, see .
-#
-#To get the latest version, check on Freshmeat for actual location:
-#
-#  http://freshmeat.net/projects/cbq.init
-#
-#
-# VERSION HISTORY
-# ---
-# v0.7.3- Deepak Singhal 
-#- fix timecheck to not ignore regular TIME rules after
-#  encountering a TIME rule that spans over midnight
-#  - Nathan Shafer 
-#- allow symlinks to class files
-#  - Seth J. Blank 
-#- replace hardcoded ip/tc location with variables
-#  - Mark Davis 
-#- allow setting of PRIO_{MARK,RULE,REALM} in class file
-#  - Fernando Sanch 
-#- allow underscores in interface names
-# v0.7.2- Paulo Sedrez
-#- fix time2abs to allow hours with leading zero in TIME rules
-#  - Svetlin Simeonov 
-#- fix cbq_device_list to allow VLAN interfaces
-#  - Mark Davis 
-#- ignore *~ backup files when looking for classes
-#  - Mike Boyer 
-#- fix to allow arguments to be passed to "restart" command
-# v0.7.1- Lubomir Bulej 
-#- default value for PERTURB
-#- fixed small bug in RULE parser to correctly parse rules with
-#  identical source and destination fields
-#- faster initial scanning of DEVICE fields
-# v0.7 - Lubomir Bulej 
-#- lots of various cleanups and reorganizations; the parsing is now
-#  some 40% faster, but the class ID must be in range 0x0002-0x
-#  (again). Because of the number of internal changes and the above
-#  class ID restriction, I bumped the version to 0.7 to indicate
-#  something might have got broken :)
-#- changed PRIO_{U32,FW,ROUTE} to PRIO_{RULE,MARK,REALM}
-#  for consistency with filter keywords
-#- exposed "compile" command
-#  - Catalin Petrescu 
-#- support for port masks in RULE (u32) filter
-#  - Jordan Vrtanoski 
-#- support for week days in TIME rules
-# v0.6.4- Lubomir Bulej 
-#- added PRIO_* variables to allow easy control of filter priorities
-#- added caching to speed up CBQ start, the cache is invalidated
-#  whenever any of the configuration files changes
-#- updated the readme section + some cosmetic fixes
-# v0.6.3- Lubomir Bulej 
-#- removed setup of (unnecessary) class 1:1 - all classes
-#  now use qdisc's default class 1:0 as their parent
-#- minor fix in the timecheck branch - classes
-#  without leaf qdisc were not updated
-#- minor fix to avoid timecheck failure when run
-#  at time with minutes equal to 08 or 09
-#- respect CBQ_PATH setting in environment
-#- made PRIO=5 default, rendering it optional in configs
-#- added support for route filter, see notes about REALM keyword
-#- added support for fw filter, see notes about MARK keyword
-#- added filter display to "list" and "stats" commands
-#- readme section update + various cosmetic fixes
-# v0.6.2- Catalin Petrescu 
-#- added tunnels interface handling
-# v0.6.1- Pavel Golubev 
-#- added sch_prio module loading
-#  (thanks johan at iglo.virtual.or.id for reminding)
-#- resolved errors resulting from stricter syntax checking in bash2
-#  - Lubomir Bulej 
-#- various cosmetic fixes
-# v0.6 - Lubomir Bulej 
-#- attempt to limit number of spawned processes by utilizing
-#  more of sed power (use sed instead of grep+cut)
-#- simplified TIME parser, using bash builtins
-#- added initial support for SFQ as leaf qdisc
-#- reworked the documentation part a little
-#- incorporated pending patches and ideas submitted by
-#  

[PATCH iproute2 0/7] Minor shell code cleanup

2018-09-22 Thread Petr Vorel
Hi,

this patchset does minor cleanup in shell scripts:
* remove bashisms
* use /bin/sh shebang
* remove obsolete code from examples
* remove unused code

Kind regards,
Petr

Petr Vorel (7):
  man: rtpr: Rename s/bash/shell/
  tests: Use /bin/sh shebang
  configure: Remove unused function check_prog()
  configure: Remove non-posix shell expansion
  configure: Code cleanup
  examples: Remove dhcp-client-script
  examples: Remove cbq.init-v0.7.3

 configure|  76 +--
 examples/cbq.init-v0.7.3 | 983 ---
 examples/dhcp-client-script  | 446 --
 man/man8/rtpr.8  |   2 +-
 testsuite/tests/tc/cls-testbed.t |   4 +-
 testsuite/tests/tc/dsmark.t  |   2 +-
 6 files changed, 25 insertions(+), 1488 deletions(-)
 delete mode 100644 examples/cbq.init-v0.7.3
 delete mode 100644 examples/dhcp-client-script

-- 
2.19.0.rc2



[PATCH iproute2 3/7] configure: Remove unused function check_prog()

2018-09-22 Thread Petr Vorel
Signed-off-by: Petr Vorel 
---
 configure | 6 --
 1 file changed, 6 deletions(-)

diff --git a/configure b/configure
index 5ef5cd4c..34325f99 100755
--- a/configure
+++ b/configure
@@ -11,12 +11,6 @@ CONFIG=config.mk
 TMPDIR=$(mktemp -d config.XX)
 trap 'status=$?; rm -rf $TMPDIR; exit $status' EXIT HUP INT QUIT TERM
 
-check_prog()
-{
-echo -n "$2"
-command -v $1 >/dev/null 2>&1 && (echo "$3:=y" >> $CONFIG; echo "yes") || 
(echo "no"; return 1)
-}
-
 check_toolchain()
 {
 : ${PKG_CONFIG:=pkg-config}
-- 
2.19.0.rc2



Re: [PATCH net-next v2] net: phy: don't reschedule state machine when PHY is halted

2018-09-22 Thread Florian Fainelli



On September 20, 2018 1:34:25 PM PDT, Heiner Kallweit  
wrote:
>When being in state PHY_HALTED we don't have to reschedule the
>state machine, phy_start() will start it again.
>
>Signed-off-by: Heiner Kallweit 

Signed-off-by: Florian Fainelli 
-- 
Florian


Re: [PATCH] net: phy: phylink: fix SFP interface autodetection

2018-09-22 Thread Russell King - ARM Linux
On Sat, Sep 22, 2018 at 10:09:44PM +0300, Baruch Siach wrote:
> When connecting a PHY to phylink use the detected interface. Otherwise,
> the link fails to come up when the configured 'phy-mode' differs from
> the SFP detected mode.
> 
> This fixes 1GB SFP module link up on eth3 of the Macchiatobin board that
> is configured in the DT to "2500base-x" phy-mode.

What I actually meant is that a PHY attached from a SFP interface
should use link_config.interface.  A PHY attached as not part of
a SFP interface should continue using the DT-parsed link_interface.

What I envisaged seeing is phylink_connect_phy() being renamed to
__phylink_connect_phy(), and taking the phy interface,
phylink_sfp_connect_phy() calling __phylink_connect_phy() with
link_config.interface, and a replacement phylink_connect_phy() which
called __phylink_connect_phy() with link_interface.

Sorry I wasn't explicit enough last time around.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 13.8Mbps down 630kbps up
According to speedtest.net: 13Mbps down 490kbps up


[PATCH] net: phy: phylink: fix SFP interface autodetection

2018-09-22 Thread Baruch Siach
When connecting a PHY to phylink use the detected interface. Otherwise,
the link fails to come up when the configured 'phy-mode' differs from
the SFP detected mode.

This fixes 1GB SFP module link up on eth3 of the Macchiatobin board that
is configured in the DT to "2500base-x" phy-mode.

Fixes: 9525ae83959b6 ("phylink: add phylink infrastructure")
Suggested-by: Russell King 
Signed-off-by: Baruch Siach 
---
 drivers/net/phy/phylink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 3ba5cf2a8a5f..aa745decc81d 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -738,7 +738,7 @@ int phylink_connect_phy(struct phylink *pl, struct 
phy_device *phy)
 
if (WARN_ON(pl->link_an_mode == MLO_AN_FIXED ||
(pl->link_an_mode == MLO_AN_INBAND &&
-phy_interface_mode_is_8023z(pl->link_interface
+phy_interface_mode_is_8023z(pl->link_config.interface
return -EINVAL;
 
if (pl->phydev)
@@ -750,7 +750,7 @@ int phylink_connect_phy(struct phylink *pl, struct 
phy_device *phy)
pl->link_config.interface = pl->link_interface;
}
 
-   ret = phy_attach_direct(pl->netdev, phy, 0, pl->link_interface);
+   ret = phy_attach_direct(pl->netdev, phy, 0, pl->link_config.interface);
if (ret)
return ret;
 
-- 
2.19.0



Re: [PATCH net] net: phy: fix WoL handling when suspending the PHY

2018-09-22 Thread Heiner Kallweit
On 22.09.2018 18:44, Andrew Lunn wrote:
> On Sat, Sep 22, 2018 at 01:32:55AM +0200, Heiner Kallweit wrote:
>> Actually there's nothing wrong with the two changes, they just
>> revealed a problem which has been existing before.
> 
> Hi Heiner
> 
> This is missing a bit of context. Which two changes? I assume you mean
> the two Fixes:
> 
Right. I should have mentioned that the actual trigger were
reported problems with WoL.

>>
>> Core of the problem is that phy_suspend() suspends the PHY when it
>> should not because of WoL. phy_suspend() checks for WoL already, but
>> this works only if the PHY driver handles WoL (what is rarely the case).
>> Typically WoL is handled by the MAC driver.
>>
>> phylib knows about this and handles it in mdio_bus_phy_may_suspend(),
>> but that's used only when suspending the system, not in other cases
>> like shutdown.
>>
>> This patch basically moves the check for WoL having been activated
>> by the MAC driver into phy_suspend(). mdio_bus_phy_resume() now
>> resumes the PHY only if it's actually suspended. Also don't do
>> anything in phy_suspend() if the PHY is suspended already.
>>
>> Last but not least change phy_detach() to call phy_suspend() before
>> attached_dev is set to NULL. phy_suspend() accesses attached_dev
>> when checking whether the MAC driver activated WoL.
> 
> This sounds like it should be multiple patches, not one. Can it be
> split, or is there two much inter connectivity? Being able to bisect
> could be useful here.
> 
I could split it to two patches:
1. Add phy_may_suspend() and use it in phy_suspend()
2. Remove mdio_bus_phy_may_suspend() and change mdio_bus_phy_suspend()
   and mdio_bus_phy_resume()

Heiner

>   Thanks
>   Andrew
> 



[net-next:master 569/583] htmldocs: include/linux/skbuff.h:860: warning: Function parameter or member 'skb_mstamp_ns' not described in 'sk_buff'

2018-09-22 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 
master
head:   bd4d08daeb959234a9f8365037b0fefa6ae790c6
commit: d3edd06ea8ea9e03de6567fda80b8be57e21a537 [569/583] tcp: provide 
earliest departure time in skb->tstamp
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   include/net/cfg80211.h:4882: warning: Excess function parameter 'ptr' 
description in 'reg_query_regdb_wmm'
   include/net/cfg80211.h:4882: warning: Excess function parameter 'ptr' 
description in 'reg_query_regdb_wmm'
   include/net/cfg80211.h:4882: warning: Excess function parameter 'ptr' 
description in 'reg_query_regdb_wmm'
   include/net/cfg80211.h:4882: warning: Excess function parameter 'ptr' 
description in 'reg_query_regdb_wmm'
   include/net/cfg80211.h:4882: warning: Excess function parameter 'ptr' 
description in 'reg_query_regdb_wmm'
   include/net/mac80211.h:2367: warning: Function parameter or member 
'radiotap_timestamp.units_pos' not described in 'ieee80211_hw'
   include/net/mac80211.h:2367: warning: Function parameter or member 
'radiotap_timestamp.accuracy' not described in 'ieee80211_hw'
   include/net/mac80211.h:978: warning: Function parameter or member 
'control.rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'control.rts_cts_rate_idx' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'control.use_rts' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'control.use_cts_prot' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'control.short_preamble' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'control.skip_table' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'control.jiffies' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'control.vif' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'control.hw_key' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'control.flags' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'control.enqueue_time' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 'ack' not 
described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'ack.cookie' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'status.rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'status.ack_signal' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'status.ampdu_ack_len' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'status.ampdu_len' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'status.antenna' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'status.tx_time' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'status.is_valid_ack_signal' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'status.status_driver_data' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'driver_rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 'pad' not 
described in 'ieee80211_tx_info'
   include/net/mac80211.h:978: warning: Function parameter or member 
'rate_driver_data' not described in 'ieee80211_tx_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg.signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'rx_stats_avg.chain_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.filtered' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.retry_failed' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.retry_count' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 
'status_stats.lost_packets' not described 

Re: [PATCH rdma-next v1 0/7] Preparation to DevX extension series

2018-09-22 Thread Jason Gunthorpe
On Thu, Sep 20, 2018 at 09:35:19PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky 
> 
> Changelog v0->v1:
>  * Update commit messages
>  * Split DevX series to small sub-series.
>  * Change static initialization from {0} to be {}
> 
> 
> Set uid as part of various IB commands so that the firmware can manage
> the IB object in a secured way.
> 
> The firmware should mark this IB object with the given uid so that it
> can be used later on only by objects with the same uid.
> 
> Upon DEVX flows that use this objec, the pointed object must have
> the same uid as of the issuer uid command.
> 
> When a command is issued with uid=0 it means that the issuer of the
> command is trusted (i.e. kernel), in that case any pointed object
> can be used regardless of its uid.
> 
> Thanks
> 
> Leon Romanovsky (1):
>   net/mlx5: Update mlx5_ifc with DEVX UID bits
> 
> Yishai Hadas (6):
>   net/mlx5: Set uid as part of CQ commands
>   net/mlx5: Set uid as part of QP commands
>   net/mlx5: Set uid as part of RQ commands
>   net/mlx5: Set uid as part of SQ commands
>   net/mlx5: Set uid as part of SRQ commands
>   net/mlx5: Set uid as part of DCT commands

This and the next series look OK to me. Let me know when it is applied
to the mlx branch

Thanks,
Jason


Re: [PATCH net] net: phy: fix WoL handling when suspending the PHY

2018-09-22 Thread Andrew Lunn
On Sat, Sep 22, 2018 at 01:32:55AM +0200, Heiner Kallweit wrote:
> Actually there's nothing wrong with the two changes, they just
> revealed a problem which has been existing before.

Hi Heiner

This is missing a bit of context. Which two changes? I assume you mean
the two Fixes:

> 
> Core of the problem is that phy_suspend() suspends the PHY when it
> should not because of WoL. phy_suspend() checks for WoL already, but
> this works only if the PHY driver handles WoL (what is rarely the case).
> Typically WoL is handled by the MAC driver.
> 
> phylib knows about this and handles it in mdio_bus_phy_may_suspend(),
> but that's used only when suspending the system, not in other cases
> like shutdown.
> 
> This patch basically moves the check for WoL having been activated
> by the MAC driver into phy_suspend(). mdio_bus_phy_resume() now
> resumes the PHY only if it's actually suspended. Also don't do
> anything in phy_suspend() if the PHY is suspended already.
> 
> Last but not least change phy_detach() to call phy_suspend() before
> attached_dev is set to NULL. phy_suspend() accesses attached_dev
> when checking whether the MAC driver activated WoL.

This sounds like it should be multiple patches, not one. Can it be
split, or is there two much inter connectivity? Being able to bisect
could be useful here.

  Thanks
Andrew


[PATCH net] net: sched: act_ipt: check for underflow in __tcf_ipt_init()

2018-09-22 Thread Dan Carpenter
If "td->u.target_size" is larger than sizeof(struct xt_entry_target) we
return -EINVAL.  But we don't check whether it's smaller than
sizeof(struct xt_entry_target) and that could lead to an out of bounds
read.

Fixes: 7ba699c604ab ("[NET_SCHED]: Convert actions from rtnetlink to new 
netlink API")
Signed-off-by: Dan Carpenter 
---
I haven't tested this.  Please review carefully.

diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 1efbfb10b1fc..8af6c11d2482 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -135,7 +135,7 @@ static int __tcf_ipt_init(struct net *net, unsigned int id, 
struct nlattr *nla,
}
 
td = (struct xt_entry_target *)nla_data(tb[TCA_IPT_TARG]);
-   if (nla_len(tb[TCA_IPT_TARG]) < td->u.target_size) {
+   if (nla_len(tb[TCA_IPT_TARG]) != td->u.target_size) {
if (exists)
tcf_idr_release(*a, bind);
else


Re: [PATCH net 02/15] bonding: use netpoll_poll_dev() helper

2018-09-22 Thread Jay Vosburgh
Eric Dumazet  wrote:

>We want to allow NAPI drivers to no longer provide
>ndo_poll_controller() method, as it has been proven problematic.
>
>team driver must not look at its presence, but instead call
>netpoll_poll_dev() which factorize the needed actions.

This patch is for bonding, not team; otherwise LGTM.

Acked-by: Jay Vosburgh 

-J


>Signed-off-by: Eric Dumazet 
>Cc: Jay Vosburgh 
>Cc: Veaceslav Falico 
>Cc: Andy Gospodarek 
>---
> drivers/net/bonding/bond_main.c | 11 ++-
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 
>a764a83f99dabe54585dbad7dba40b6601177c03..0d87e11e7f1d84537fe43d95249b1bd3a2ce291d
> 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -971,16 +971,13 @@ static void bond_poll_controller(struct net_device 
>*bond_dev)
>   struct slave *slave = NULL;
>   struct list_head *iter;
>   struct ad_info ad_info;
>-  struct netpoll_info *ni;
>-  const struct net_device_ops *ops;
> 
>   if (BOND_MODE(bond) == BOND_MODE_8023AD)
>   if (bond_3ad_get_active_agg_info(bond, _info))
>   return;
> 
>   bond_for_each_slave_rcu(bond, slave, iter) {
>-  ops = slave->dev->netdev_ops;
>-  if (!bond_slave_is_up(slave) || !ops->ndo_poll_controller)
>+  if (!bond_slave_is_up(slave))
>   continue;
> 
>   if (BOND_MODE(bond) == BOND_MODE_8023AD) {
>@@ -992,11 +989,7 @@ static void bond_poll_controller(struct net_device 
>*bond_dev)
>   continue;
>   }
> 
>-  ni = rcu_dereference_bh(slave->dev->npinfo);
>-  if (down_trylock(>dev_lock))
>-  continue;
>-  ops->ndo_poll_controller(slave->dev);
>-  up(>dev_lock);
>+  netpoll_poll_dev(slave->dev);
>   }
> }
> 
>-- 
>2.19.0.444.g18242da7ef-goog
>


[PATCH] net-ethtool: ETHTOOL_GUFO did not and should not require CAP_NET_ADMIN

2018-09-22 Thread Maciej Żenczykowski
From: Maciej Żenczykowski 

So it should not fail with EPERM even though it is no longer implemented...

This is a fix for:
  (userns)$ egrep ^Cap /proc/self/status
  CapInh: 003f
  CapPrm: 003f
  CapEff: 003f
  CapBnd: 003f
  CapAmb: 003f

  (userns)$ tcpdump -i usb_rndis0
  tcpdump: WARNING: usb_rndis0: SIOCETHTOOL(ETHTOOL_GUFO) ioctl failed: 
Operation not permitted
  Warning: Kernel filter failed: Bad file descriptor
  tcpdump: can't remove kernel filter: Bad file descriptor

With this change it returns EOPNOTSUPP instead of EPERM.

See also https://github.com/the-tcpdump-group/libpcap/issues/689

Fixes: 08a00fea6de2 "net: Remove references to NETIF_F_UFO from ethtool."
Cc: David S. Miller 
Signed-off-by: Maciej Żenczykowski 
---
 net/core/ethtool.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 9d4e56d97080..96afc55aa61e 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -2536,6 +2536,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
case ETHTOOL_GPHYSTATS:
case ETHTOOL_GTSO:
case ETHTOOL_GPERMADDR:
+   case ETHTOOL_GUFO:
case ETHTOOL_GGSO:
case ETHTOOL_GGRO:
case ETHTOOL_GFLAGS:
-- 
2.19.0.444.g18242da7ef-goog



Re: [PATCH net] VSOCK: check sk state before receive

2018-09-22 Thread Hangbin Liu
On Fri, Sep 21, 2018 at 07:48:25AM +, Jorgen S. Hansen wrote:
> Hi Hangbin,
> 
> I finaly got to the bottom of this - the issue was indeed in the VMCI driver. 
> The patch is posted here:
> 
> https://lkml.org/lkml/2018/9/21/326
> 
> I used your reproduce.log to test the fix. Thanks for discovering this issue.

Hi Jorgen,

Thanks for your patch. I built a test kernel with your fix, run my
reproducer and syzkaller socket vnet test for a while. There is no such
error. So I think your patch fixed this issue.

BTW, with FAULT_INJECTION enabled. I got another call trace:

[  251.166377] FAULT_INJECTION: forcing a failure.
[  251.178736] CPU: 15 PID: 10448 Comm: syz-executor7 Not tainted 
4.19.0-rc4.syz.vnet+ #3
[  251.187577] Hardware name: Dell Inc. PowerEdge R730/0WCJNT, BIOS 2.1.5 
04/11/2016
[  251.187578] Call Trace:
[  251.187586]  dump_stack+0x8c/0xce
[  251.187594]  should_fail+0x5dd/0x6b0
[  251.199932]  ? fault_create_debugfs_attr+0x1d0/0x1d0
[  251.199937]  __should_failslab+0xe8/0x120
[  251.199945]  should_failslab+0xa/0x20
[  251.228430]  kmem_cache_alloc_trace+0x43/0x1f0
[  251.233392]  ? vhost_dev_set_owner+0x366/0x790 [vhost]
[  251.239129]  vhost_dev_set_owner+0x366/0x790 [vhost]
[  251.244672]  ? vhost_poll_wakeup+0xa0/0xa0 [vhost]
[  251.250018]  ? kasan_unpoison_shadow+0x30/0x40
[  251.254978]  ? vhost_worker+0x370/0x370 [vhost]
[  251.260035]  ? kasan_kmalloc_large+0x71/0xe0
[  251.264799]  ? kmalloc_order+0x54/0x60
[  251.268985]  vhost_net_ioctl+0xc2e/0x14c0 [vhost_net]
[  251.274635]  ? avc_ss_reset+0x150/0x150
[  251.278915]  ? kstrtouint_from_user+0xe5/0x140
[  251.283876]  ? handle_tx_kick+0x40/0x40 [vhost_net]
[  251.289320]  ? save_stack+0x89/0xb0
[  251.293213]  ? __kasan_slab_free+0x12e/0x180
[  251.297979]  ? kmem_cache_free+0x7a/0x210
[  251.302452]  ? putname+0xe2/0x120
[  251.306151]  ? get_pid_task+0x6e/0x90
[  251.310238]  ? proc_fail_nth_write+0x91/0x1c0
[  251.315100]  ? map_files_get_link+0x3c0/0x3c0
[  251.319963]  ? exit_robust_list+0x1c0/0x1c0
[  251.324633]  ? __vfs_write+0xf7/0x6a0
[  251.328711]  ? handle_tx_kick+0x40/0x40 [vhost_net]
[  251.334154]  do_vfs_ioctl+0x1a5/0xfb0
[  251.338241]  ? ioctl_preallocate+0x1c0/0x1c0
[  251.343009]  ? selinux_file_ioctl+0x382/0x560
[  251.347872]  ? selinux_capable+0x40/0x40
[  251.352250]  ? __fget+0x211/0x2e0
[  251.355949]  ? iterate_fd+0x1c0/0x1c0
[  251.360038]  ? syscall_trace_enter+0x285/0xaa0
[  251.365011]  ? security_file_ioctl+0x5d/0xb0
[  251.369776]  ? selinux_capable+0x40/0x40
[  251.374153]  ksys_ioctl+0x89/0xa0
[  251.377853]  __x64_sys_ioctl+0x74/0xb0
[  251.382036]  do_syscall_64+0xc3/0x390
[  251.386123]  ? syscall_return_slowpath+0x14c/0x230
[  251.391473]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[  251.397111] RIP: 0033:0x451b89
[  251.400519] Code: fc ff 48 81 c4 80 00 00 00 e9 f1 fe ff ff 0f 1f 00 48 89 
f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 
f0 ff ff 0f 83 0b 67 fc ff c3 66 2e 0f 1f 84 00 00 00 00
[  251.421476] RSP: 002b:7fc0d9673c48 EFLAGS: 0246 ORIG_RAX: 
0010
[  251.429927] RAX: ffda RBX: 7fc0d96746b4 RCX: 00451b89
[  251.437889] RDX:  RSI: af01 RDI: 0003
[  251.445852] RBP: 0073bf00 R08:  R09: 
[  251.453815] R10:  R11: 0246 R12: 0004
[  251.461778] R13: 6450 R14: 004d3090 R15: 7fc0d9674700

Thanks
Hangbin