* Re: [PATCH net-next] net/mlx5e: Make function mlx5e_change_rep_mtu() static
From: David Miller @ 2018-06-05 14:20 UTC (permalink / raw)
To: weiyongjun1; +Cc: saeedm, leon, adin, netdev, linux-rdma, kernel-janitors
In-Reply-To: <1528166565-54828-1-git-send-email-weiyongjun1@huawei.com>
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Tue, 5 Jun 2018 02:42:45 +0000
> Fixes the following sparse warning:
>
> drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:903:5: warning:
> symbol 'mlx5e_change_rep_mtu' was not declared. Should it be static?
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next v2] net: qualcomm: rmnet: Fix use after free while sending command ack
From: David Miller @ 2018-06-05 14:17 UTC (permalink / raw)
To: subashab; +Cc: netdev
In-Reply-To: <1528163018-16113-1-git-send-email-subashab@codeaurora.org>
From: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Date: Mon, 4 Jun 2018 19:43:38 -0600
> When sending an ack to a command packet, the skb is still referenced
> after it is sent to the real device. Since the real device could
> free the skb, the device pointer would be invalid.
> Also, remove an unnecessary variable.
>
> Fixes: ceed73a2cf4a ("drivers: net: ethernet: qualcomm: rmnet: Initial implementation")
> Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Applied.
^ permalink raw reply
* Re: [PATCH net-next v2] net: ipv6: Generate random IID for addresses on RAWIP devices
From: David Miller @ 2018-06-05 14:17 UTC (permalink / raw)
To: subashab; +Cc: netdev, yoshfuji, stranche
In-Reply-To: <1528161967-6382-1-git-send-email-subashab@codeaurora.org>
From: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Date: Mon, 4 Jun 2018 19:26:07 -0600
> RAWIP devices such as rmnet do not have a hardware address and
> instead require the kernel to generate a random IID for the
> IPv6 addresses.
>
> Signed-off-by: Sean Tranchetti <stranche@codeaurora.org>
> Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Applied.
^ permalink raw reply
* Re: [PATCH] r8169: Reinstate ALDPS and ASPM support
From: David Miller @ 2018-06-05 14:15 UTC (permalink / raw)
To: andrew
Cc: kai.heng.feng, hayeswang, hkallweit1, romieu, netdev,
linux-kernel, ryankao
In-Reply-To: <20180605141114.GC14873@lunn.ch>
From: Andrew Lunn <andrew@lunn.ch>
Date: Tue, 5 Jun 2018 16:11:14 +0200
> No module parameter please. Just turn it on by default. Assuming
> testing shows works.
Agreed.
^ permalink raw reply
* bpf-next is CLOSED
From: Daniel Borkmann @ 2018-06-05 14:14 UTC (permalink / raw)
To: netdev; +Cc: ast
Please only submit bug fixes at this time due to merge window, thank you.
^ permalink raw reply
* Re: [PATCH bpf-next v3 1/2] trace_helpers.c: Add helpers to poll multiple perf FDs for events
From: Daniel Borkmann @ 2018-06-05 14:13 UTC (permalink / raw)
To: Toke Høiland-Jørgensen, netdev
In-Reply-To: <152819729342.9696.4421334230852378808.stgit@alrua-kau>
Hi Toke,
On 06/05/2018 01:14 PM, Toke Høiland-Jørgensen wrote:
> Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Please no empty commit message. Not sure why from the previous patch
you removed it here.
> ---
> tools/testing/selftests/bpf/trace_helpers.c | 47 ++++++++++++++++++++++++++-
> tools/testing/selftests/bpf/trace_helpers.h | 4 ++
> 2 files changed, 49 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c
> index 3868dcb63420..1e62d89f34cf 100644
> --- a/tools/testing/selftests/bpf/trace_helpers.c
> +++ b/tools/testing/selftests/bpf/trace_helpers.c
> @@ -88,7 +88,7 @@ static int page_size;
> static int page_cnt = 8;
> static struct perf_event_mmap_page *header;
>
> -int perf_event_mmap(int fd)
> +int perf_event_mmap_header(int fd, struct perf_event_mmap_page **header)
> {
> void *base;
> int mmap_size;
> @@ -102,10 +102,15 @@ int perf_event_mmap(int fd)
> return -1;
> }
>
> - header = base;
> + *header = base;
> return 0;
> }
>
> +int perf_event_mmap(int fd)
> +{
> + return perf_event_mmap_header(fd, &header);
> +}
> +
> static int perf_event_poll(int fd)
> {
> struct pollfd pfd = { .fd = fd, .events = POLLIN };
> @@ -163,3 +168,41 @@ int perf_event_poller(int fd, perf_event_print_fn output_fn)
>
> return ret;
> }
> +
> +int perf_event_poller_multi(int *fds, struct perf_event_mmap_page **headers,
> + int num_fds, perf_event_print_fn output_fn)
> +{
> + enum bpf_perf_event_ret ret;
> + struct pollfd *pfds;
> + void *buf = NULL;
> + size_t len = 0;
> + int i;
> +
> + pfds = malloc(sizeof(*pfds) * num_fds);
> + if (!pfds)
> + return -1;
Also, just noticed here you mix -1 as return code with LIBBPF_* return
codes. Would be better not not overlap such usage.
> + memset(pfds, 0, sizeof(*pfds) * num_fds);
> + for (i = 0; i < num_fds; i++) {
> + pfds[i].fd = fds[i];
> + pfds[i].events = POLLIN;
> + }
> +
> + for (;;) {
> + poll(pfds, num_fds, 1000);
> + for (i = 0; i < num_fds; i++) {
> + if (pfds[i].revents) {
> + ret = bpf_perf_event_read_simple(headers[i], page_cnt * page_size,
> + page_size, &buf, &len,
> + bpf_perf_event_print,
> + output_fn);
> + if (ret != LIBBPF_PERF_EVENT_CONT)
> + break;
> + }
> + }
> + }
> + free(buf);
> + free(pfds);
> +
> + return ret;
Thanks,
Daniel
^ permalink raw reply
* Re: [PATCH] r8169: Reinstate ALDPS and ASPM support
From: Andrew Lunn @ 2018-06-05 14:11 UTC (permalink / raw)
To: Kai-Heng Feng
Cc: davem, hayeswang, hkallweit1, romieu, netdev, linux-kernel,
Ryankao
In-Reply-To: <20180605045812.17977-1-kai.heng.feng@canonical.com>
On Tue, Jun 05, 2018 at 12:58:12PM +0800, Kai-Heng Feng wrote:
> This patch reinstate ALDPS and ASPM support on r8169.
>
> On some Intel platforms, ASPM support on r8169 is the key factor to let
> Package C-State achieve PC8. Without ASPM support, the deepest Package
> C-State can hit is PC3. PC8 can save additional ~3W in comparison with
> PC3.
>
> This patch is from Realtek.
>
> Fixes: e0c075577965 ("r8169: enable ALDPS for power saving")
> Fixes: d64ec841517a ("r8169: enable internal ASPM and clock request settings")
>
> Cc: Ryankao <ryankao@realtek.com>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> drivers/net/ethernet/realtek/r8169.c | 190 +++++++++++++++++++++------
> 1 file changed, 151 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 75dfac0248f4..a28ef20be221 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -319,6 +319,8 @@ static const struct pci_device_id rtl8169_pci_tbl[] = {
>
> MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl);
>
> +static int enable_aspm = 1;
> +static int enable_aldps = 1;
> static int use_dac = -1;
> static struct {
> u32 msg_enable;
> @@ -817,6 +819,10 @@ struct rtl8169_private {
>
> MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
> MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
> +module_param(enable_aspm, int, 0);
> +MODULE_PARM_DESC(enable_aspm, "Enable ASPM");
> +module_param(enable_aldps, int, 0);
> +MODULE_PARM_DESC(enable_aldps, "Enable ALDPS");
Hi Kai
No module parameter please. Just turn it on by default. Assuming
testing shows works.
Andrew
^ permalink raw reply
* Re: AF_XDP. Was: [net-next 00/12][pull request] Intel Wired LAN Driver Updates 2018-06-04
From: Daniel Borkmann @ 2018-06-05 14:11 UTC (permalink / raw)
To: Björn Töpel, Alexander Duyck
Cc: Alexei Starovoitov, David Miller, Björn Töpel,
Karlsson, Magnus, ast, Daniel Borkmann, Or Gerlitz, Jeff Kirsher,
Netdev
In-Reply-To: <CAJ+HfNhBZvARUwrr838Dc6eZZZ0LjkWjaGtAHuO-5UjHXwfSMQ@mail.gmail.com>
On 06/05/2018 10:44 AM, Björn Töpel wrote:
> Den tis 5 juni 2018 kl 03:46 skrev Alexander Duyck <alexander.duyck@gmail.com>:
>> On Mon, Jun 4, 2018 at 4:32 PM, Alexei Starovoitov
>> <alexei.starovoitov@gmail.com> wrote:
>>> On Mon, Jun 04, 2018 at 03:02:31PM -0700, Alexander Duyck wrote:
>>>> On Mon, Jun 4, 2018 at 2:27 PM, David Miller <davem@davemloft.net> wrote:
>>>>> From: Or Gerlitz <gerlitz.or@gmail.com>
>>>>> Date: Tue, 5 Jun 2018 00:11:35 +0300
>>>>>
>>>>>> Just to make sure, is the AF_XDP ZC (Zero Copy) UAPI going to be
>>>>>> merged for this window -- AFAIU from [1], it's still under
>>>>>> examination/development/research for non Intel HWs, am I correct or
>>>>>> this is going to get in now?
>>>>>
>>>>> All of the pending AF_XDP changes will be merged this merge window.
>>>>>
>>>>> I think Intel folks need to review things as fast as possible because
>>>>> I pretty much refuse to revert the series or disable it in Kconfig at
>>>>> this point.
>>>>>
>>>>> Thank you.
>>>>
>>>> My understanding of things is that the current AF_XDP patches were
>>>> going to be updated to have more of a model agnostic API such that
>>>> they would work for either the "typewriter" mode or the descriptor
>>>> ring based approach. The current plan was to have the zero copy
>>>> patches be a follow-on after the vendor agnostic API bits in the
>>>> descriptors and such had been sorted out. I believe you guys have the
>>>> descriptor fixes already right?
>>>>
>>>> In my opinion the i40e code isn't mature enough yet to really go into
>>>> anything other than maybe net-next in a couple weeks. We are going to
>>>> need a while to get adequate testing in order to flush out all the
>>>> bugs and performance regressions we are likely to see coming out of
>>>> this change.
>>>
>>> I think the work everyone did in this release cycle increased my confidence
>>> that the way descriptors are defined and the rest of uapi are stable enough
>>> and i40e zero copy bits can land in the next release without uapi changes.
>>> In that sense even if we merge i40e parts now, the other nic vendors
>>> will be in the same situation and may find things that they would like
>>> to improve in uapi.
>>> So I propose we merge the first 7 patches of the last series now and
>>> let 3 remaining i40e patches go via intel trees for the next release.
>>> In the mean time other NIC vendors should start actively working
>>> on AF_XDP support as well.
>>> If somehow uapi would need tweaks, we can still do minor adjustments
>>> since 4.18 won't be released for ~10 weeks.
>>
>> That works for me. Actually I think patch 11 can probably be included
>> as well since that is just sample code and could probably be used by
>> whatever drivers end up implementing this.
>
> The approach suggested by Alexei and Alex sounds good to us. Alex's
> review items are very much valid, and require more time to address.
> Therefore addressing i40e in the next merge windows sounds like a
> great idea.
>
> As Alex suggests, including patch 11 together with the first seven makes sense.
Ok with it as well, and I've pushed just that, thanks everyone!
^ permalink raw reply
* Re: [PATCH net-next] tcp: refactor tcp_ecn_check_ce to remove sk type cast
From: David Miller @ 2018-06-05 14:10 UTC (permalink / raw)
To: ysseung; +Cc: netdev, ncardwell, ycheng, edumazet
In-Reply-To: <20180604222951.229735-1-ysseung@google.com>
From: Yousuk Seung <ysseung@google.com>
Date: Mon, 4 Jun 2018 15:29:51 -0700
> Refactor tcp_ecn_check_ce and __tcp_ecn_check_ce to accept struct sock*
> instead of tcp_sock* to clean up type casts. This is a pure refactor
> patch.
>
> Signed-off-by: Yousuk Seung <ysseung@google.com>
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Applied.
^ permalink raw reply
* Re: [PATCH 09/10] dpaa_eth: add support for hardware timestamping
From: Richard Cochran @ 2018-06-05 13:57 UTC (permalink / raw)
To: Y.b. Lu
Cc: netdev@vger.kernel.org, Madalin-cristian Bucur, Rob Herring,
Shawn Guo, David S . Miller, devicetree@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
In-Reply-To: <DB6PR0401MB2536376432EC481473A5B4A3F8660@DB6PR0401MB2536.eurprd04.prod.outlook.com>
On Tue, Jun 05, 2018 at 03:35:28AM +0000, Y.b. Lu wrote:
> [Y.b. Lu] Actually these timestamping codes affected DPAA networking performance in our previous performance test.
> That's why we used ifdef for it.
How much does time stamping hurt performance?
If the time stamping is compiled in but not enabled at run time, does
it still affect performace?
Thanks,
Richard
^ permalink raw reply
* Re: [PATCH net] net/ipv6: prevent use after free in ip6_route_mpath_notify
From: David Miller @ 2018-06-05 13:57 UTC (permalink / raw)
To: dsahern; +Cc: netdev, dsahern, edumazet
In-Reply-To: <20180604204142.8941-1-dsahern@kernel.org>
From: dsahern@kernel.org
Date: Mon, 4 Jun 2018 13:41:42 -0700
> From: David Ahern <dsahern@gmail.com>
>
> syzbot reported a use-after-free:
...
> The problem is that rt_last can point to a deleted route if the insert
> fails.
>
> One reproducer is to insert a route and then add a multipath route that
> has a duplicate nexthop.e.g,:
> $ ip -6 ro add vrf red 2001:db8:101::/64 nexthop via 2001:db8:1::2
> $ ip -6 ro append vrf red 2001:db8:101::/64 nexthop via 2001:db8:1::4 nexthop via 2001:db8:1::2
>
> Fix by not setting rt_last until the it is verified the insert succeeded.
>
> Fixes: 3b1137fe7482 ("net: ipv6: Change notifications for multipath add to RTA_MULTIPATH")
> Cc: Eric Dumazet <edumazet@google.com>
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Applied and queued up for -stable, thanks David.
^ permalink raw reply
* Re: INFO: task hung in ip6gre_exit_batch_net
From: Kirill Tkhai @ 2018-06-05 13:55 UTC (permalink / raw)
To: Dmitry Vyukov
Cc: syzbot, Christian Brauner, David Miller, David Ahern,
Florian Westphal, Jiri Benc, LKML, Xin Long, mschiffer, netdev,
syzkaller-bugs, Vladislav Yasevich
In-Reply-To: <CACT4Y+bPrdK7xSeUk=pgVVyaseDZUAvArBA4bEWPsUi7CE3EVw@mail.gmail.com>
On 05.06.2018 12:36, Dmitry Vyukov wrote:
> On Tue, Jun 5, 2018 at 11:03 AM, Kirill Tkhai <ktkhai@virtuozzo.com> wrote:
>> Hi, Dmirty!
>>
>> On 04.06.2018 18:22, Dmitry Vyukov wrote:
>>> On Mon, Jun 4, 2018 at 5:03 PM, syzbot
>>> <syzbot+bf78a74f82c1cf19069e@syzkaller.appspotmail.com> wrote:
>>>> Hello,
>>>>
>>>> syzbot found the following crash on:
>>>>
>>>> HEAD commit: bc2dbc5420e8 Merge branch 'akpm' (patches from Andrew)
>>>> git tree: upstream
>>>> console output: https://syzkaller.appspot.com/x/log.txt?x=164e42b7800000
>>>> kernel config: https://syzkaller.appspot.com/x/.config?x=982e2df1b9e60b02
>>>> dashboard link: https://syzkaller.appspot.com/bug?extid=bf78a74f82c1cf19069e
>>>> compiler: gcc (GCC) 8.0.1 20180413 (experimental)
>>>>
>>>> Unfortunately, I don't have any reproducer for this crash yet.
>>>>
>>>> IMPORTANT: if you fix the bug, please add the following tag to the commit:
>>>> Reported-by: syzbot+bf78a74f82c1cf19069e@syzkaller.appspotmail.com
>>>
>>> Another hang on rtnl lock:
>>>
>>> #syz dup: INFO: task hung in netdev_run_todo
>>>
>>> May be related to "unregister_netdevice: waiting for DEV to become free":
>>> https://syzkaller.appspot.com/bug?id=1a97a5bd119fd97995f752819fd87840ab9479a9
>
> netdev_wait_allrefs does not hold rtnl lock during waiting, so it must
> be something different.
>
>
>>> Any other explanations for massive hangs on rtnl lock for minutes?
>>
>> To exclude the situation, when a task exists with rtnl_mutex held:
>>
>> would the pr_warn() from print_held_locks_bug() be included in the console output
>> if they appear?
>
> Yes, everything containing "WARNING:" is detected as bug.
OK, then dead task not releasing the lock is excluded.
One more assumption: someone corrupted memory around rtnl_mutex and it looks like locked.
(I track lockdep "(rtnl_mutex){+.+.}" prints in initial message as "nobody owns rtnl_mutex").
There may help a crash dump of the VM.
Also, there may be a locking code BUG, but this seems the least probable for me.
Kirill
^ permalink raw reply
* Re: [PATCH net-next] net: phy: broadcom: Enable 125 MHz clock on LED4 pin for BCM54612E by default.
From: David Miller @ 2018-06-05 13:43 UTC (permalink / raw)
To: kunyi
Cc: netdev, Avi.Fishman, tali.perry, tomer.maimon, benjaminfair,
rlippert, f.fainelli
In-Reply-To: <20180604201704.238472-1-kunyi@google.com>
From: Kun Yi <kunyi@google.com>
Date: Mon, 4 Jun 2018 13:17:04 -0700
> BCM54612E have 4 multi-functional LED pins that can be configured
> through register setting; the LED4 pin can be configured to a 125MHz
> reference clock output by setting the spare register. Since the dedicated
> CLK125 reference clock pin is not brought out on the 48-Pin MLP, the LED4
> pin is the only pin to provide such function in this package, and therefore
> it is beneficial to just enable the reference clock by default.
>
> Signed-off-by: Kun Yi <kunyi@google.com>
Applied, thank you.
^ permalink raw reply
* Re: [Patch net-next] netdev-FAQ: clarify DaveM's position for stable backports
From: David Miller @ 2018-06-05 13:43 UTC (permalink / raw)
To: xiyou.wangcong; +Cc: netdev, stable, gregkh
In-Reply-To: <20180604180719.6053-1-xiyou.wangcong@gmail.com>
From: Cong Wang <xiyou.wangcong@gmail.com>
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 last
> + 3 stable releases.
As Greg stated, I only do 2 not 3.
^ permalink raw reply
* Re: [PATCH net] l2tp: fix refcount leakage on PPPoL2TP sockets
From: David Miller @ 2018-06-05 13:41 UTC (permalink / raw)
To: g.nault; +Cc: netdev, jchapman
In-Reply-To: <6021bb159fc069256f8947622e4b180d234fea0a.1528129907.git.g.nault@alphalink.fr>
From: Guillaume Nault <g.nault@alphalink.fr>
Date: Mon, 4 Jun 2018 18:52:19 +0200
> Commit d02ba2a6110c ("l2tp: fix race in pppol2tp_release with session
> object destroy") tried to fix a race condition where a PPPoL2TP socket
> would disappear while the L2TP session was still using it. However, it
> missed the root issue which is that an L2TP session may accept to be
> reconnected if its associated socket has entered the release process.
>
> The tentative fix makes the session hold the socket it is connected to.
> That saves the kernel from crashing, but introduces refcount leakage,
> preventing the socket from completing the release process. Once stalled,
> everything the socket depends on can't be released anymore, including
> the L2TP session and the l2tp_ppp module.
...
> So it all boils down to pppol2tp_connect() failing to realise that the
> session has already been connected. This patch drops the unneeded extra
> reference counting (mostly reverting d02ba2a6110c) and checks that
> neither ->sk nor ->__sk is set before allowing a session to be
> connected.
>
> Fixes: d02ba2a6110c ("l2tp: fix race in pppol2tp_release with session object destroy")
> Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
So much fidgeting around in this area over the past year or two :-)
Applied and queued up for -stable, thanks for fixing this.
^ permalink raw reply
* Re: [PATCH v2 04/21] cxgb4: use match_string() helper
From: Andy Shevchenko @ 2018-06-05 13:19 UTC (permalink / raw)
To: Yisheng Xie; +Cc: Linux Kernel Mailing List, Ganesh Goudar, netdev
In-Reply-To: <1527765086-19873-5-git-send-email-xieyisheng1@huawei.com>
On Thu, May 31, 2018 at 2:11 PM, Yisheng Xie <xieyisheng1@huawei.com> wrote:
> match_string() returns the index of an array for a matching string,
> which can be used instead of open coded variant.
>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: Ganesh Goudar <ganeshgr@chelsio.com>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
> ---
> v2:
> - no change from v1.
>
> drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
> index 9da6f57..bd61610 100644
> --- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
> +++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
> @@ -782,17 +782,11 @@ static int cudbg_get_mem_region(struct adapter *padap,
> if (rc)
> return rc;
>
> - for (i = 0; i < ARRAY_SIZE(cudbg_region); i++) {
> - if (!strcmp(cudbg_region[i], region_name)) {
> - found = 1;
> - idx = i;
> - break;
> - }
> - }
> - if (!found)
> - return -EINVAL;
> + rc = match_string(cudbg_region, ARRAY_SIZE(cudbg_region), region_name);
> + if (rc < 0)
> + return rc;
>
> - found = 0;
> + idx = rc;
> for (i = 0; i < meminfo->mem_c; i++) {
> if (meminfo->mem[i].idx >= ARRAY_SIZE(cudbg_region))
> continue; /* Skip holes */
> --
> 1.7.12.4
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH v2 06/21] iwlwifi: mvm: use match_string() helper
From: Andy Shevchenko @ 2018-06-05 13:19 UTC (permalink / raw)
To: Yisheng Xie
Cc: Linux Kernel Mailing List, Kalle Valo, Intel Linux Wireless,
Johannes Berg, Emmanuel Grumbach, open list:TI WILINK WIRELES...,
netdev
In-Reply-To: <1527765086-19873-7-git-send-email-xieyisheng1@huawei.com>
On Thu, May 31, 2018 at 2:11 PM, Yisheng Xie <xieyisheng1@huawei.com> wrote:
> match_string() returns the index of an array for a matching string,
> which can be used instead of open coded variant.
>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: Intel Linux Wireless <linuxwifi@intel.com>
> Cc: Johannes Berg <johannes.berg@intel.com>
> Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Cc: linux-wireless@vger.kernel.org
> Cc: netdev@vger.kernel.org
> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
> ---
> v2:
> - let ret get return value of match_string - per Andy
>
> drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
> index 0e6401c..d7ac511 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
> @@ -671,16 +671,11 @@ static ssize_t iwl_dbgfs_bt_cmd_read(struct file *file, char __user *user_buf,
> };
> int ret, bt_force_ant_mode;
>
> - for (bt_force_ant_mode = 0;
> - bt_force_ant_mode < ARRAY_SIZE(modes_str);
> - bt_force_ant_mode++) {
> - if (!strcmp(buf, modes_str[bt_force_ant_mode]))
> - break;
> - }
> -
> - if (bt_force_ant_mode >= ARRAY_SIZE(modes_str))
> - return -EINVAL;
> + ret = match_string(modes_str, ARRAY_SIZE(modes_str), buf);
> + if (ret < 0)
> + return ret;
>
> + bt_force_ant_mode = ret;
> ret = 0;
> mutex_lock(&mvm->mutex);
> if (mvm->bt_force_ant_mode == bt_force_ant_mode)
> --
> 1.7.12.4
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH net-next] selftests: forwarding: Fix importing dependent libraries
From: Petr Machata @ 2018-06-05 13:15 UTC (permalink / raw)
To: netdev; +Cc: linux-kselftest, davem, shuah, idosch
In-Reply-To: <1ee588d3867b411485be29e45ebbda050920544c.1528203928.git.petrm@mellanox.com>
Petr Machata <petrm@mellanox.com> writes:
> When libraries are sourced from elsewhere from the tree, such as the
> testing/selftests/drivers/net/mlxsw subdirectory, sourcing their own
Sorry, I didn't realize the mirror_bridge.sh is not upstream yet. This
patch is thus immaterial, it will be sent together with the test when it
becomes relevant.
Please ignore.
Thanks,
Petr
^ permalink raw reply
* [PATCH iproute2 v2 1/2] ip: display netns name instead of nsid
From: Nicolas Dichtel @ 2018-06-05 13:08 UTC (permalink / raw)
To: stephen; +Cc: netdev, Nicolas Dichtel
In-Reply-To: <20180605130831.8175-1-nicolas.dichtel@6wind.com>
When iproute2 has a name for the nsid, let's display it. It's more
user friendly than a number.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
ip/ip_common.h | 1 +
ip/ipaddress.c | 20 +++++++++++++++-----
ip/ipnetns.c | 14 ++++++++++++++
3 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/ip/ip_common.h b/ip/ip_common.h
index 49eb7d7bed40..794478c546cd 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -60,6 +60,7 @@ void netns_map_init(void);
void netns_nsid_socket_init(void);
int print_nsid(const struct sockaddr_nl *who,
struct nlmsghdr *n, void *arg);
+char *get_name_from_nsid(int nsid);
int do_ipaddr(int argc, char **argv);
int do_ipaddrlabel(int argc, char **argv);
int do_iproute(int argc, char **argv);
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index c7c7e7df4e81..e4a1b985e4e9 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -955,10 +955,16 @@ int print_linkinfo(const struct sockaddr_nl *who,
if (is_json_context()) {
print_int(PRINT_JSON, "link_netnsid", NULL, id);
} else {
- if (id >= 0)
- print_int(PRINT_FP, NULL,
- " link-netnsid %d", id);
- else
+ if (id >= 0) {
+ char *name = get_name_from_nsid(id);
+
+ if (name)
+ print_string(PRINT_FP, NULL,
+ " link-netns %s", name);
+ else
+ print_int(PRINT_FP, NULL,
+ " link-netnsid %d", id);
+ } else
print_string(PRINT_FP, NULL,
" link-netnsid %s", "unknown");
}
@@ -966,8 +972,12 @@ int print_linkinfo(const struct sockaddr_nl *who,
if (tb[IFLA_NEW_NETNSID]) {
int id = rta_getattr_u32(tb[IFLA_NEW_NETNSID]);
+ char *name = get_name_from_nsid(id);
- print_int(PRINT_FP, NULL, " new-nsid %d", id);
+ if (name)
+ print_string(PRINT_FP, NULL, " new-netns %s", name);
+ else
+ print_int(PRINT_FP, NULL, " new-netnsid %d", id);
}
if (tb[IFLA_NEW_IFINDEX]) {
int id = rta_getattr_u32(tb[IFLA_NEW_IFINDEX]);
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index e06100f4ad2d..30af9319f39e 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -169,6 +169,20 @@ static struct nsid_cache *netns_map_get_by_nsid(int nsid)
return NULL;
}
+char *get_name_from_nsid(int nsid)
+{
+ struct nsid_cache *c;
+
+ netns_nsid_socket_init();
+ netns_map_init();
+
+ c = netns_map_get_by_nsid(nsid);
+ if (c)
+ return c->name;
+
+ return NULL;
+}
+
static int netns_map_add(int nsid, const char *name)
{
struct nsid_cache *c;
--
2.15.1
^ permalink raw reply related
* [PATCH iproute2 v2 0/2] display netns name instead of nsid
From: Nicolas Dichtel @ 2018-06-05 13:08 UTC (permalink / raw)
To: stephen; +Cc: netdev
In-Reply-To: <20180604141215.0669f05f@xeon-e3>
After these patches, the iproute2 name of netns is displayed instead of
the nsid. It's easier to read/understand.
v1 -> v2:
- open netns socket and init netns map only when needed
ip/ip_common.h | 3 +++
ip/ipaddress.c | 20 +++++++++++++++-----
ip/iplink.c | 18 ++++++++++++++++--
ip/ipnetns.c | 22 ++++++++++++++++++++--
4 files changed, 54 insertions(+), 9 deletions(-)
Comments are welcomed,
Regards,
Nicolas
^ permalink raw reply
* [PATCH iproute2 v2 2/2] iplink: enable to specify a name for the link-netns
From: Nicolas Dichtel @ 2018-06-05 13:08 UTC (permalink / raw)
To: stephen; +Cc: netdev, Nicolas Dichtel
In-Reply-To: <20180605130831.8175-1-nicolas.dichtel@6wind.com>
The 'link-netnsid' argument needs a number. Add 'link-netns' when the user
wants to use the iproute2 netns name instead of the nsid.
Example:
ip link add ipip1 link-netns foo type ipip remote 10.16.0.121 local 10.16.0.249
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
ip/ip_common.h | 2 ++
ip/iplink.c | 18 ++++++++++++++++--
ip/ipnetns.c | 8 ++++++--
3 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/ip/ip_common.h b/ip/ip_common.h
index 794478c546cd..4d3227cbc389 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -61,6 +61,8 @@ void netns_nsid_socket_init(void);
int print_nsid(const struct sockaddr_nl *who,
struct nlmsghdr *n, void *arg);
char *get_name_from_nsid(int nsid);
+int get_netnsid_from_name(const char *name);
+int set_netnsid_from_name(const char *name, int nsid);
int do_ipaddr(int argc, char **argv);
int do_ipaddrlabel(int argc, char **argv);
int do_iproute(int argc, char **argv);
diff --git a/ip/iplink.c b/ip/iplink.c
index 9ff5f692a1d4..e4d4da96aedb 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -85,7 +85,7 @@ void iplink_usage(void)
" [ broadcast LLADDR ]\n"
" [ mtu MTU ]\n"
" [ netns { PID | NAME } ]\n"
- " [ link-netnsid ID ]\n"
+ " [ link-netns NAME | link-netnsid ID ]\n"
" [ alias NAME ]\n"
" [ vf NUM [ mac LLADDR ]\n"
" [ vlan VLANID [ qos VLAN-QOS ] [ proto VLAN-PROTO ] ]\n"
@@ -865,10 +865,24 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, char **type)
IFLA_INET6_ADDR_GEN_MODE, mode);
addattr_nest_end(&req->n, afs6);
addattr_nest_end(&req->n, afs);
+ } else if (matches(*argv, "link-netns") == 0) {
+ NEXT_ARG();
+ if (link_netnsid != -1)
+ duparg("link-netns/link-netnsid", *argv);
+ link_netnsid = get_netnsid_from_name(*argv);
+ /* No nsid? Try to assign one. */
+ if (link_netnsid < 0)
+ set_netnsid_from_name(*argv, -1);
+ link_netnsid = get_netnsid_from_name(*argv);
+ if (link_netnsid < 0)
+ invarg("Invalid \"link-netns\" value\n",
+ *argv);
+ addattr32(&req->n, sizeof(*req), IFLA_LINK_NETNSID,
+ link_netnsid);
} else if (matches(*argv, "link-netnsid") == 0) {
NEXT_ARG();
if (link_netnsid != -1)
- duparg("link-netnsid", *argv);
+ duparg("link-netns/link-netnsid", *argv);
if (get_integer(&link_netnsid, *argv, 0))
invarg("Invalid \"link-netnsid\" value\n",
*argv);
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 30af9319f39e..368be0cbc0a4 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -91,7 +91,7 @@ static int ipnetns_have_nsid(void)
return have_rtnl_getnsid;
}
-static int get_netnsid_from_name(const char *name)
+int get_netnsid_from_name(const char *name)
{
struct {
struct nlmsghdr n;
@@ -108,6 +108,8 @@ static int get_netnsid_from_name(const char *name)
struct rtgenmsg *rthdr;
int len, fd;
+ netns_nsid_socket_init();
+
fd = netns_get_fd(name);
if (fd < 0)
return fd;
@@ -705,7 +707,7 @@ out_delete:
return -1;
}
-static int set_netnsid_from_name(const char *name, int nsid)
+int set_netnsid_from_name(const char *name, int nsid)
{
struct {
struct nlmsghdr n;
@@ -719,6 +721,8 @@ static int set_netnsid_from_name(const char *name, int nsid)
};
int fd, err = 0;
+ netns_nsid_socket_init();
+
fd = netns_get_fd(name);
if (fd < 0)
return fd;
--
2.15.1
^ permalink raw reply related
* Re: [PATCH net-next] net: fddi: fix a possible null-ptr-deref
From: YueHaibing @ 2018-06-05 13:08 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel
In-Reply-To: <20180605100627.16184-1-yuehaibing@huawei.com>
On 2018/6/5 18:06, YueHaibing wrote:
> bp->SharedMemAddr is set to NULL while bp->SharedMemSize less than 0,
> then memset will trigger null-ptr-deref.
>
> Fix it use pci_zalloc_consistent when bp->SharedMemSize is greater than 0.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> drivers/net/fddi/skfp/skfddi.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/fddi/skfp/skfddi.c b/drivers/net/fddi/skfp/skfddi.c
> index 2414f1d..90164e0 100644
> --- a/drivers/net/fddi/skfp/skfddi.c
> +++ b/drivers/net/fddi/skfp/skfddi.c
> @@ -407,23 +407,21 @@ static int skfp_driver_init(struct net_device *dev)
> if (bp->SharedMemSize > 0) {
> bp->SharedMemSize += 16; // for descriptor alignment
>
> - bp->SharedMemAddr = pci_alloc_consistent(&bp->pdev,
> - bp->SharedMemSize,
> - &bp->SharedMemDMA);
> + bp->SharedMemAddr = pci_zalloc_consistent(&bp->pdev,
> + bp->SharedMemSize,
> + &bp->SharedMemDMA);
This also need move from pci_dma* to dma_*, will send v2
> if (!bp->SharedMemAddr) {
> printk("could not allocate mem for ");
> printk("hardware module: %ld byte\n",
> bp->SharedMemSize);
> goto fail;
> }
> - bp->SharedMemHeap = 0; // Nothing used yet.
>
> } else {
> bp->SharedMemAddr = NULL;
> - bp->SharedMemHeap = 0;
> } // SharedMemSize > 0
>
> - memset(bp->SharedMemAddr, 0, bp->SharedMemSize);
> + bp->SharedMemHeap = 0;
>
> card_stop(smc); // Reset adapter.
>
>
^ permalink raw reply
* Re: [PATCH bpf-next 10/11] i40e: implement AF_XDP zero-copy support for Tx
From: Björn Töpel @ 2018-06-05 13:07 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: Karlsson, Magnus, Magnus Karlsson, Duyck, Alexander H,
Alexander Duyck, Alexei Starovoitov, Daniel Borkmann, Netdev,
MykytaI Iziumtsev, John Fastabend, Willem de Bruijn,
Michael S. Tsirkin, michael.lundkvist, Brandeburg, Jesse,
Singhai, Anjali, Zhang, Qi Z, Francois Ozog, Ilias Apalodimas,
Brian Brooks <brian.brook
In-Reply-To: <20180605144347.34351ecc@redhat.com>
Den tis 5 juni 2018 kl 14:44 skrev Jesper Dangaard Brouer <brouer@redhat.com>:
>
> On Mon, 4 Jun 2018 14:06:00 +0200
> Björn Töpel <bjorn.topel@gmail.com> wrote:
>
> > Here, ndo_xsk_async_xmit is implemented. As a shortcut, the existing
> > XDP Tx rings are used for zero-copy. This will result in other devices
> > doing XDP_REDIRECT to an AF_XDP enabled queue will have its packets
> > dropped.
>
> This behavior is problematic, because XDP Tx rings are smp_processor_id
> based, and several RX queues can (via proc smp_affinity settings) be
> assigned to the same CPU. Thus, other RX-queues (than the AF_XDP
> enabled queue) can experience packet drops. And other devices doing
> redirect through i40e, which happen to run on a CPU which XDP Tx queue
> is "hijacked" will see dropped packets.
>
> Any plans to allocate/create a dedicated TX ring per AF_XDP socket?
>
Yes -- again this was a shortcut, and must be addressed (for all the
reasons above).
Björn
> --
> Best regards,
> Jesper Dangaard Brouer
> MSc.CS, Principal Kernel Engineer at Red Hat
> LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* [PATCH net-next] selftests: forwarding: Fix importing dependent libraries
From: Petr Machata @ 2018-06-05 13:07 UTC (permalink / raw)
To: netdev, linux-kselftest; +Cc: davem, shuah, idosch
When libraries are sourced from elsewhere from the tree, such as the
testing/selftests/drivers/net/mlxsw subdirectory, sourcing their own
dependencies directly by name doesn't work. Thus running mirror_gre.sh
from that subdirectory results in the following cascade of errors:
./../../../net/forwarding/mirror_gre_lib.sh: line 3: mirror_lib.sh: No such file or directory
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 36: mirror_topo_lib.sh: No such file or directory
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 80: mirror_topo_h1_create: command not found
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 81: mirror_topo_h2_create: command not found
./../../../net/forwarding/mirror_gre_topo_lib.sh: line 40: mirror_topo_h3_create: command not found
[...]
Fix by relying on $relative_path, set up by lib.sh, which should be
imported by the test in question anyway, and source the file using
relative path appropriate for the subdirectory.
Fixes: d5ea2bfc806a ("selftests: forwarding: mirror_gre_lib: Extract generic functions")
Fixes: 74ed089d48a4 ("selftests: forwarding: Split mirror_gre_topo_lib.sh")
Signed-off-by: Petr Machata <petrm@mellanox.com>
---
tools/testing/selftests/net/forwarding/mirror_gre_lib.sh | 2 +-
tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
index 619b469..1388845 100644
--- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
-source mirror_lib.sh
+source "$relative_path/mirror_lib.sh"
quick_test_span_gre_dir_ips()
{
diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh
index 2534195..39c03e2 100644
--- a/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh
@@ -33,7 +33,7 @@
# | |
# +-------------------------------------------------------------------------+
-source mirror_topo_lib.sh
+source "$relative_path/mirror_topo_lib.sh"
mirror_gre_topo_h3_create()
{
--
2.4.11
^ permalink raw reply related
* [PATCH v2 net-next] net: metrics: add proper netlink validation
From: Eric Dumazet @ 2018-06-05 13:06 UTC (permalink / raw)
To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet, David Ahern
Before using nla_get_u32(), better make sure the attribute
is of the proper size.
Code recently was changed, but bug has been there from beginning
of git.
BUG: KMSAN: uninit-value in rtnetlink_put_metrics+0x553/0x960 net/core/rtnetlink.c:746
CPU: 1 PID: 14139 Comm: syz-executor6 Not tainted 4.17.0-rc5+ #103
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x185/0x1d0 lib/dump_stack.c:113
kmsan_report+0x149/0x260 mm/kmsan/kmsan.c:1084
__msan_warning_32+0x6e/0xc0 mm/kmsan/kmsan_instr.c:686
rtnetlink_put_metrics+0x553/0x960 net/core/rtnetlink.c:746
fib_dump_info+0xc42/0x2190 net/ipv4/fib_semantics.c:1361
rtmsg_fib+0x65f/0x8c0 net/ipv4/fib_semantics.c:419
fib_table_insert+0x2314/0x2b50 net/ipv4/fib_trie.c:1287
inet_rtm_newroute+0x210/0x340 net/ipv4/fib_frontend.c:779
rtnetlink_rcv_msg+0xa32/0x1560 net/core/rtnetlink.c:4646
netlink_rcv_skb+0x378/0x600 net/netlink/af_netlink.c:2448
rtnetlink_rcv+0x50/0x60 net/core/rtnetlink.c:4664
netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
netlink_unicast+0x1678/0x1750 net/netlink/af_netlink.c:1336
netlink_sendmsg+0x104f/0x1350 net/netlink/af_netlink.c:1901
sock_sendmsg_nosec net/socket.c:629 [inline]
sock_sendmsg net/socket.c:639 [inline]
___sys_sendmsg+0xec0/0x1310 net/socket.c:2117
__sys_sendmsg net/socket.c:2155 [inline]
__do_sys_sendmsg net/socket.c:2164 [inline]
__se_sys_sendmsg net/socket.c:2162 [inline]
__x64_sys_sendmsg+0x331/0x460 net/socket.c:2162
do_syscall_64+0x152/0x230 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x455a09
RSP: 002b:00007faae5fd8c68 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007faae5fd96d4 RCX: 0000000000455a09
RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000013
RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000005d0 R14: 00000000006fdc20 R15: 0000000000000000
Uninit was stored to memory at:
kmsan_save_stack_with_flags mm/kmsan/kmsan.c:279 [inline]
kmsan_save_stack mm/kmsan/kmsan.c:294 [inline]
kmsan_internal_chain_origin+0x12b/0x210 mm/kmsan/kmsan.c:685
__msan_chain_origin+0x69/0xc0 mm/kmsan/kmsan_instr.c:529
fib_convert_metrics net/ipv4/fib_semantics.c:1056 [inline]
fib_create_info+0x2d46/0x9dc0 net/ipv4/fib_semantics.c:1150
fib_table_insert+0x3e4/0x2b50 net/ipv4/fib_trie.c:1146
inet_rtm_newroute+0x210/0x340 net/ipv4/fib_frontend.c:779
rtnetlink_rcv_msg+0xa32/0x1560 net/core/rtnetlink.c:4646
netlink_rcv_skb+0x378/0x600 net/netlink/af_netlink.c:2448
rtnetlink_rcv+0x50/0x60 net/core/rtnetlink.c:4664
netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
netlink_unicast+0x1678/0x1750 net/netlink/af_netlink.c:1336
netlink_sendmsg+0x104f/0x1350 net/netlink/af_netlink.c:1901
sock_sendmsg_nosec net/socket.c:629 [inline]
sock_sendmsg net/socket.c:639 [inline]
___sys_sendmsg+0xec0/0x1310 net/socket.c:2117
__sys_sendmsg net/socket.c:2155 [inline]
__do_sys_sendmsg net/socket.c:2164 [inline]
__se_sys_sendmsg net/socket.c:2162 [inline]
__x64_sys_sendmsg+0x331/0x460 net/socket.c:2162
do_syscall_64+0x152/0x230 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Uninit was created at:
kmsan_save_stack_with_flags mm/kmsan/kmsan.c:279 [inline]
kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:189
kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:315
kmsan_slab_alloc+0x10/0x20 mm/kmsan/kmsan.c:322
slab_post_alloc_hook mm/slab.h:446 [inline]
slab_alloc_node mm/slub.c:2753 [inline]
__kmalloc_node_track_caller+0xb32/0x11b0 mm/slub.c:4395
__kmalloc_reserve net/core/skbuff.c:138 [inline]
__alloc_skb+0x2cb/0x9e0 net/core/skbuff.c:206
alloc_skb include/linux/skbuff.h:988 [inline]
netlink_alloc_large_skb net/netlink/af_netlink.c:1182 [inline]
netlink_sendmsg+0x76e/0x1350 net/netlink/af_netlink.c:1876
sock_sendmsg_nosec net/socket.c:629 [inline]
sock_sendmsg net/socket.c:639 [inline]
___sys_sendmsg+0xec0/0x1310 net/socket.c:2117
__sys_sendmsg net/socket.c:2155 [inline]
__do_sys_sendmsg net/socket.c:2164 [inline]
__se_sys_sendmsg net/socket.c:2162 [inline]
__x64_sys_sendmsg+0x331/0x460 net/socket.c:2162
do_syscall_64+0x152/0x230 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Fixes: a919525ad832 ("net: Move fib_convert_metrics to metrics file")
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: David Ahern <dsahern@gmail.com>
---
v2: fixed a typo.
net/ipv4/fib_semantics.c | 2 ++
net/ipv4/metrics.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 6608db23f54b6afdac0455650b47d64b1b22b255..f3c89ccf14c5b8f67048a9cf7ebd4ba19327941e 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -717,6 +717,8 @@ bool fib_metrics_match(struct fib_config *cfg, struct fib_info *fi)
nla_strlcpy(tmp, nla, sizeof(tmp));
val = tcp_ca_get_key_by_name(fi->fib_net, tmp, &ecn_ca);
} else {
+ if (nla_len(nla) != sizeof(u32))
+ return false;
val = nla_get_u32(nla);
}
diff --git a/net/ipv4/metrics.c b/net/ipv4/metrics.c
index 5121c6475e6b0e9a9a158d4cee473f52cd4d8efe..04311f7067e2e9e3dafb89aa4f8e30dab0fde854 100644
--- a/net/ipv4/metrics.c
+++ b/net/ipv4/metrics.c
@@ -32,6 +32,8 @@ int ip_metrics_convert(struct net *net, struct nlattr *fc_mx, int fc_mx_len,
if (val == TCP_CA_UNSPEC)
return -EINVAL;
} else {
+ if (nla_len(nla) != sizeof(u32))
+ return -EINVAL;
val = nla_get_u32(nla);
}
if (type == RTAX_ADVMSS && val > 65535 - 40)
--
2.17.1.1185.g55be947832-goog
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox