ethtool - "vmalloc: allocation failure: 0 bytes" message

Bug #1703944 reported by Eric Desrochers
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Undecided
Unassigned
Xenial
Won't Fix
Medium
Eric Desrochers

Bug Description

If ->get_regs_len() callback return 0, we allocate 0 bytes of memory, what print the following warning in kern.log :

vmalloc: allocation failure: 0 bytes
ethtool: page allocation failure: order:0, mode:0x24080c2
CPU: 21 PID: 7668 Comm: ethtool Tainted: G 4.4.0-62-generic #83-Ubuntu
Hardware name:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0000000000000286 000000005949f325 ffff8801fddcfba8 ffffffff813f7c63
00000000024080c2 ffffffff81ccfe30 ffff8801fddcfc38 ffffffff8119498a
ffffffff81ccfe30 ffff8801fddcfbc8 0000000000000018 ffff8801fddcfc48
Call Trace:
[<ffffffff813f7c63>] dump_stack+0x63/0x90
[<ffffffff8119498a>] warn_alloc_failed+0xfa/0x150
[<ffffffff811d1082>] __vmalloc_node_range+0x202/0x290
[<ffffffff8183812e>] ? _raw_spin_unlock_bh+0x1e/0x20
[<ffffffff811d1214>] vzalloc+0x54/0x60
[<ffffffff81733c57>] ? dev_ethtool+0xfc7/0x1ef0
[<ffffffff81733c57>] dev_ethtool+0xfc7/0x1ef0
[<ffffffff81746362>] dev_ioctl+0x182/0x580
[<ffffffff8170d4a2>] sock_do_ioctl+0x42/0x50
[<ffffffff8170d9a2>] sock_ioctl+0x1d2/0x290
[<ffffffff812227af>] do_vfs_ioctl+0x29f/0x490
[<ffffffff8106b514>] ? __do_page_fault+0x1b4/0x400
[<ffffffff81222a19>] SyS_ioctl+0x79/0x90
[<ffffffff818385f2>] entry_SYSCALL_64_fastpath+0x16/0x71

break-fix: - 3808d34838184fd29088d6b3a364ba2f1c018fb6

Tags: patch sts xenial
Revision history for this message
Eric Desrochers (slashd) wrote :

An upstream fix is found upstream preventing the warning in ethtool code

* Reference :
https://patchwork.ozlabs.org/patch/722971/

* Commit :
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3808d34838184fd29088d6b3a364ba2f1c018fb6

--
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 236a21e..d92de0a 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1405,9 +1405,12 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
        if (regs.len > reglen)
                regs.len = reglen;

- regbuf = vzalloc(reglen);
- if (reglen && !regbuf)
- return -ENOMEM;
+ regbuf = NULL;
+ if (reglen) {
+ regbuf = vzalloc(reglen);
+ if (!regbuf)
+ return -ENOMEM;
+ }

        ops->get_regs(dev, &regs, regbuf);
--

description: updated
description: updated
summary: - ethtool vmalloc: allocation failure: 0 bytes WARNING
+ ethtool - vmalloc: allocation failure: 0 bytes message
summary: - ethtool - vmalloc: allocation failure: 0 bytes message
+ ethtool - "vmalloc: allocation failure: 0 bytes" message
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1703944

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: xenial
Eric Desrochers (slashd)
Changed in linux (Ubuntu Xenial):
importance: Undecided → Medium
assignee: nobody → Eric Desrochers (slashd)
Changed in linux (Ubuntu Zesty):
importance: Undecided → Medium
assignee: nobody → Eric Desrochers (slashd)
Changed in linux (Ubuntu Xenial):
status: New → In Progress
Changed in linux (Ubuntu Zesty):
status: New → In Progress
Eric Desrochers (slashd)
no longer affects: linux (Ubuntu Zesty)
Revision history for this message
Eric Desrochers (slashd) wrote :

PATCH submitted to Ubuntu kernel-team for approval.

Revision history for this message
Eric Desrochers (slashd) wrote :

This is the patch I have sent to kernel-team ML.

Eric Desrochers (slashd)
tags: added: sts
tags: added: patch
Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :

Patch was already applied as part of Xenial update to 4.4.73 stable release (LP #1698817).

description: updated
Changed in linux (Ubuntu Xenial):
status: In Progress → Fix Committed
Eric Desrochers (slashd)
Changed in linux (Ubuntu Xenial):
status: Fix Committed → Won't Fix
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.