Kernel 4.4 NBD size overflow with image size exceeding 1TB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Invalid
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Joseph Salisbury |
Bug Description
== SRU Justification ==
With the Xenial kernel, the bug reporter states there is an NBD size
overflow with image size exceeding 1TB.
There's an issue in kernel's NBD module which prevents some larger images to be
correctly "connected" , largely described here:
https:/
This is a regression from Trusty and was fixed in mainline as of v4.10-rc1.
== Fix ==
ef77b515243b ("nbd: use loff_t for blocksize and nbd_set_size args")
== Regression Potential ==
Medium. A backport was needed. However, it was due to some context
diffs and the way debugfs_create_u32 was used in Xenial and how
debugfs_create_u64 was used in the patch.
== Test Case ==
A test kernel was built with this patch and tested by the original bug reporter.
The bug reporter states the test kernel resolved the bug.
== Original Bug Report ==
Release 16.04, kernel 4.4.0-124-generic
There's an issue in kernel's NBD module which prevents some larger images to be
correctly "connected" , largely described here:
https:/
There is a small patch here that was accepted into mainline 4.10:
https:/
This is a regression from the previous LTS 3.13 kernel.
----
Here is a small example of the faulty behaviour:
# qemu-img create -f qcow2 test.img 1100G
Formatting 'test.img', fmt=qcow2 size=1181116006400 cluster_size=65536 lazy_refcounts=off refcount_bits=16
# qemu-nbd -c /dev/nbd0 test.img
# blockdev --getsize64 /dev/nbd0
184467430558023
The correct response would be 1181116006400; this breaks most tools and makes the image unusable, e.g.
# fdisk -l /dev/nbd0
fdisk: cannot open /dev/nbd0: Invalid argument
---
AlsaDevices:
total 0
crw-rw---- 1 root audio 116, 1 May 21 12:51 seq
crw-rw---- 1 root audio 116, 33 May 21 12:51 timer
AplayDevices: Error: [Errno 2] No such file or directory
ApportVersion: 2.20.1-0ubuntu2.17
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
DistroRelease: Ubuntu 16.04
HibernationDevice: RESUME=
IwConfig: Error: [Errno 2] No such file or directory
MachineType: Supermicro SYS-1028R-WTR
Package: linux (not installed)
PciMultimedia:
ProcEnviron:
LANGUAGE=en_AU:
TERM=xterm
PATH=(custom, no user)
LANG=en_AU
SHELL=/bin/bash
ProcFB: 0 VESA VGA
ProcKernelCmdLine: BOOT_IMAGE=
ProcVersionSign
RelatedPackageV
linux-
linux-
linux-firmware 1.157.18
RfKill: Error: [Errno 2] No such file or directory
Tags: xenial xenial
Uname: Linux 4.4.0-124-generic x86_64
UnreportableReason: The report belongs to a package that is not installed.
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:
_MarkForUpload: False
dmi.bios.date: 02/08/2018
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 3.0a
dmi.board.
dmi.board.name: X10DRW-i
dmi.board.vendor: Supermicro
dmi.board.version: 1.10
dmi.chassis.
dmi.chassis.type: 1
dmi.chassis.vendor: Supermicro
dmi.chassis.
dmi.modalias: dmi:bvnAmerican
dmi.product.name: SYS-1028R-WTR
dmi.product.
dmi.sys.vendor: Supermicro
Changed in linux (Ubuntu): | |
importance: | Undecided → Medium |
status: | Confirmed → Triaged |
Changed in linux (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in linux (Ubuntu): | |
status: | Triaged → Invalid |
Changed in linux (Ubuntu Xenial): | |
importance: | Undecided → Medium |
assignee: | nobody → Joseph Salisbury (jsalisbury) |
Changed in linux (Ubuntu Xenial): | |
status: | In Progress → Fix Committed |
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 1772575
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.