[Hyper-V] Netmask value is not parsed by hv_set_ifconfig - IP injection

Bug #1540586 reported by Chris Valean
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
High
Andy Whitcroft
Trusty
Fix Released
Medium
Andy Whitcroft
Wily
Fix Released
Medium
Andy Whitcroft
Xenial
Fix Released
High
Andy Whitcroft

Bug Description

This bug is a continuation to bug ID 1506521 - the refreshed hv_set_ifconfig script in Python3.

On a Wily system with the new script, doing an IP injection does change the IP on the VM, however the netmask value is not parsed and gets ignored.
It gets set to a default of 255.0.0.0.

Kernel: 4.2.0-23-generic

Attaching generated ifcfg-eth0 file that is used by this script.

syslog doesn't record any related events to the netmask, and also manually executing hv_set_ifconfig against the generated ifcfg works with no errors.

The interfaces files gets modified to this:
iface eth0 inet static
        address 10.123.120.199
        gateway 10.123.119.1
        dns-nameservers anything_changed

#End of hv_set_ifconfig stanzas

CVE References

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1540586

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
Revision history for this message
Chris Valean (cvalean) wrote : Re: Hyper-V] Netmask value is not parsed by hv_set_ifconfig - IP injection

Parsed ifcg-eth0 file that is going to be converted to a network interface config on the guest

description: updated
description: updated
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Chris Valean (cvalean)
summary: - Hyper-V] Netmask value is not parsed by hv_set_ifconfig - IP injection
+ [Hyper-V] Netmask value is not parsed by hv_set_ifconfig - IP injection
Tim Gardner (timg-tpi)
Changed in linux (Ubuntu Xenial):
milestone: none → ubuntu-16.04
Changed in linux (Ubuntu Wily):
status: New → Confirmed
importance: Undecided → Medium
Changed in linux (Ubuntu Xenial):
importance: Undecided → Medium
tags: added: kernel-da-key
Revision history for this message
Andy Whitcroft (apw) wrote :

@Chris -- it appears that the format of the intermediate file is somewhat inconsistent, IPADDR and NETMASK have suffixes for 0, but GATEWAY does not. As we handle these consistently we are clearly broken. I will review all of these relative to the spec.

Revision history for this message
Andy Whitcroft (apw) wrote :

@Chris -- ok this script is basic broken in just about every possible way. I am attaching a majorly reworked version which attempts to fix this mess up. Could you test this one and let me know how you fair with it.

Revision history for this message
Chris Valean (cvalean) wrote :

This version looks good, all 3 values - ipaddr, netmask and gateway are showing up as parsed from the host.
Verified it on Trusty and Vivid.
Thank you!

Revision history for this message
Chris Valean (cvalean) wrote :

Typo correction: Verified it on Trusty and Wily (not Vivid).

Revision history for this message
Andy Whitcroft (apw) wrote :

Note that this bug was spawned out of Bug #1506521 and the fix for this should be released with that.

Changed in linux (Ubuntu Trusty):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Andy Whitcroft (apw)
Changed in linux (Ubuntu Wily):
assignee: nobody → Andy Whitcroft (apw)
Changed in linux (Ubuntu Xenial):
assignee: nobody → Andy Whitcroft (apw)
importance: Medium → High
Changed in linux (Ubuntu Wily):
status: Confirmed → In Progress
Changed in linux (Ubuntu Xenial):
status: Confirmed → Fix Committed
Brad Figg (brad-figg)
Changed in linux (Ubuntu Trusty):
status: In Progress → Fix Committed
Brad Figg (brad-figg)
Changed in linux (Ubuntu Wily):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.5 KiB)

This bug was fixed in the package linux - 4.4.0-7.22

---------------
linux (4.4.0-7.22) xenial; urgency=low

  [ Tim Gardner ]

  * Release Tracking Bug
    - LP: #1547205

  * need arm64 acpi parking protocol support in xenial (LP: #1547047)
    - [Config] Enabled ARM64_ACPI_PARKING_PROTOCOL
    - arm64: kernel: implement ACPI parking protocol

  * Please pull cgroup namespaces (LP: #1546775)
    - SAUCE: (noup) kernfs: Add API to generate relative kernfs path
    - SAUCE: (noup) sched: new clone flag CLONE_NEWCGROUP for cgroup namespace
    - SAUCE: (noup) cgroup: introduce cgroup namespaces
    - SAUCE: (noup) cgroup: cgroup namespace setns support
    - SAUCE: (noup) kernfs: define kernfs_node_dentry
    - SAUCE: (noup) cgroup: mount cgroupns-root when inside non-init cgroupns
    - SAUCE: (noup) Add FS_USERNS_FLAG to cgroup fs
    - SAUCE: (noup) cgroup: Add documentation for cgroup namespaces

  * [Feature]Pulse-Width Modulation enabling on Broxton-P (LP: #1520436)
    - [Config] CONFIG_PWM_OMAP_DMTIMER=m
    - pwm: lpss: Remove ->free() callback
    - pwm: bcm2835: Calculate scaler in ->config()
    - pwm: bcm2835: Prevent division by zero
    - pwm: bcm2835: Fix email address specification
    - pwm: lpss: Update PWM setting for Broxton
    - pwm: lpss: Select core part automatically
    - pwm: lpss: Rework the sequence of programming PWM_SW_UPDATE
    - pwm: fsl-ftm: Fix clock enable/disable when using PM
    - pwm: lpc32xx: correct number of PWM channels from 2 to 1
    - pwm: lpc32xx: make device usable with common clock framework
    - pwm: lpc32xx: fix and simplify duty cycle and period calculations
    - pwm: lpc32xx: return ERANGE, if requested period is not supported
    - pwm: rcar: Improve accuracy of frequency division setting
    - pwm: Add PWM driver for OMAP using dual-mode timers
    - pwm: add HAS_IOMEM dependency to PWM_FSL_FTM
    - pwm: omap-dmtimer: Potential NULL dereference on error
    - pwm: Mark all devices as "might sleep"

  * [Hyper-V] Netmask value is not parsed by hv_set_ifconfig - IP injection (LP: #1540586)
    - [Debian] hv: hv_set_ifconfig -- switch to approved indentation
    - [Debian] hv: hv_set_ifconfig -- fix numerous parameter handling issues

  * Update megaraid driver to MR6.10 (LP: #1544679)
    - megaraid_sas: Do not allow PCI access during OCR
    - megaraid_sas: MFI IO timeout handling
    - megaraid_sas: Syncing request flags macro names with firmware
    - megaraid_sas: Task management support
    - megaraid_sas: Update device queue depth based on interface type
    - megaraid_sas: Fastpath region lock bypass
    - megaraid_sas: Reply Descriptor Post Queue (RDPQ) support
    - megaraid_sas: Code optimization build_and_issue_cmd return-type
    - megaraid_sas: Dual queue depth support
    - megaraid_sas: IO throttling support
    - megaraid_sas: Make adprecovery variable atomic
    - megaraid_sas: MFI adapter OCR changes
    - megaraid_sas: Introduce module parameter for SCSI command timeout
    - megaraid_sas: SPERC OCR changes
    - megaraid_sas: driver version upgrade
    - megaraid: fix null pointer check in megasas_detach_one().
    - megaraid_sas: Fix for IO failing post OCR in SRI...

Read more...

Changed in linux (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-trusty' to 'verification-done-trusty'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-trusty
tags: added: verification-needed-wily
Revision history for this message
Brad Figg (brad-figg) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-wily' to 'verification-done-wily'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

Revision history for this message
Adrian Suhov (asuhov) wrote :

Hi!
I tested this issue on Trusty with 3.13.0-81-generic kernel and it is solved, ip injection works as expected.
It also works as expected on Wily with 4.2.0-32-generic kernel.

Chris Valean (cvalean)
tags: added: verification-done-trusty verification-done-wily
removed: verification-needed-trusty verification-needed-wily
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (7.7 KiB)

This bug was fixed in the package linux - 4.2.0-34.39

---------------
linux (4.2.0-34.39) wily; urgency=low

  [ Brad Figg ]

  * Release Tracking Bug
    - LP: #1555821

  [ Florian Westphal ]

  * SAUCE: [nf] netfilter: x_tables: check for size overflow
    - LP: #1555353
  * SAUCE: [nf,v2] netfilter: x_tables: don't rely on well-behaving
    userspace
    - LP: #1555338

linux (4.2.0-33.38) wily; urgency=low

  [ Brad Figg ]

  * Release Tracking Bug
    - LP: #1554649

  [ Upstream Kernel Changes ]

  * Revert "drm/radeon: call hpd_irq_event on resume"
    - LP: #1554608
  * cxl: Fix PSL timebase synchronization detection
    - LP: #1532914

linux (4.2.0-32.37) wily; urgency=low

  [ Kamal Mostafa ]

  * Release Tracking Bug
    - LP: #1550045

  [ Kamal Mostafa ]

  * Merged back Ubuntu-4.2.0-31.36

linux (4.2.0-31.36) wily; urgency=low

  [ Brad Figg ]

  * Release Tracking Bug
    - LP: #1548579

  [ Andy Whitcroft ]

  * [Debian] hv: hv_set_ifconfig -- convert to python3
    - LP: #1506521
  * [Debian] hv: hv_set_ifconfig -- switch to approved indentation
    - LP: #1540586
  * [Debian] hv: hv_set_ifconfig -- fix numerous parameter handling issues
    - LP: #1540586

  [ Carol L Soto ]

  * SAUCE: IB/IPoIB: Do not set skb truesize since using one linearskb
    - LP: #1541326

  [ Dan Streetman ]

  * SAUCE: nbd: ratelimit error msgs after socket close
    - LP: #1505564

  [ Tim Gardner ]

  * Revert "SAUCE: (noup) cxlflash: Fix to avoid virtual LUN failover
    failure"
    - LP: #1541635
  * Revert "SAUCE: (noup) cxlflash: Fix to escalate LINK_RESET also on port
    1"
    - LP: #1541635
  * [Config] ARMV8_DEPRECATED=y
    - LP: #1545542

  [ Upstream Kernel Changes ]

  * x86/xen/p2m: hint at the last populated P2M entry
    - LP: #1542941
  * mm: add dma_pool_zalloc() call to DMA API
    - LP: #1543737
  * sctp: Prevent soft lockup when sctp_accept() is called during a timeout
    event
    - LP: #1543737
  * xen-netback: respect user provided max_queues
    - LP: #1543737
  * xen-netfront: respect user provided max_queues
    - LP: #1543737
  * xen-netfront: update num_queues to real created
    - LP: #1543737
  * iio: adis_buffer: Fix out-of-bounds memory access
    - LP: #1543737
  * KVM: PPC: Fix emulation of H_SET_DABR/X on POWER8
    - LP: #1543737
  * KVM: PPC: Fix ONE_REG AltiVec support
    - LP: #1543737
  * x86/irq: Call chip->irq_set_affinity in proper context
    - LP: #1543737
  * drm/amdgpu: fix tonga smu resume
    - LP: #1543737
  * perf kvm record/report: 'unprocessable sample' error while
    recording/reporting guest data
    - LP: #1543737
  * hrtimer: Handle remaining time proper for TIME_LOW_RES
    - LP: #1543737
  * timerfd: Handle relative timers with CONFIG_TIME_LOW_RES proper
    - LP: #1543737
  * posix-timers: Handle relative timers with CONFIG_TIME_LOW_RES proper
    - LP: #1543737
  * itimers: Handle relative timers with CONFIG_TIME_LOW_RES proper
    - LP: #1543737
  * drm/amdgpu: Use drm_calloc_large for VM page_tables array
    - LP: #1543737
  * drm/amdgpu: fix amdgpu_bo_pin_restricted VRAM placing v2
    - LP: #1543737
  * drm/radeon: properly byte swap vce firmware setup
    - LP: #1543737
  ...

Read more...

Changed in linux (Ubuntu Wily):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (14.5 KiB)

This bug was fixed in the package linux - 3.13.0-83.127

---------------
linux (3.13.0-83.127) trusty; urgency=low

  [ Brad Figg ]

  * Release Tracking Bug
    - LP: #1555839

  [ Florian Westphal ]

  * SAUCE: [nf,v2] netfilter: x_tables: don't rely on well-behaving
    userspace
    - LP: #1555338

linux (3.13.0-82.126) trusty; urgency=low

  [ Brad Figg ]

  * Release Tracking Bug
    - LP: #1554732

  [ Upstream Kernel Changes ]

  * Revert "drm/radeon: call hpd_irq_event on resume"
    - LP: #1554608
  * net: generic dev_disable_lro() stacked device handling
    - LP: #1547680

linux (3.13.0-81.125) trusty; urgency=low

  [ Luis Henriques ]

  * Release Tracking Bug
    - LP: #1552316

  [ Upstream Kernel Changes ]

  * Revert "firmware: dmi_scan: Fix UUID endianness for SMBIOS >= 2.6"
    - LP: #1551419
  * bcache: Fix a lockdep splat in an error path
    - LP: #1551327

linux (3.13.0-80.124) trusty; urgency=low

  [ Brad Figg ]

  * Release Tracking Bug
    - LP: #1548519

  [ Andy Whitcroft ]

  * [Debian] hv: hv_set_ifconfig -- convert to python3
    - LP: #1506521
  * [Debian] hv: hv_set_ifconfig -- switch to approved indentation
    - LP: #1540586
  * [Debian] hv: hv_set_ifconfig -- fix numerous parameter handling issues
    - LP: #1540586

  [ Dan Streetman ]

  * SAUCE: nbd: ratelimit error msgs after socket close
    - LP: #1505564

  [ Upstream Kernel Changes ]

  * Revert "workqueue: make sure delayed work run in local cpu"
    - LP: #1546320
  * [media] gspca: ov534/topro: prevent a division by 0
    - LP: #1542497
  * [media] media: dvb-core: Don't force CAN_INVERSION_AUTO in oneshot mode
    - LP: #1542497
  * tools lib traceevent: Fix output of %llu for 64 bit values read on 32
    bit machines
    - LP: #1542497
  * KVM: x86: correctly print #AC in traces
    - LP: #1542497
  * drm/radeon: call hpd_irq_event on resume
    - LP: #1542497
  * xhci: refuse loading if nousb is used
    - LP: #1542497
  * arm64: Clear out any singlestep state on a ptrace detach operation
    - LP: #1542497
  * time: Avoid signed overflow in timekeeping_get_ns()
    - LP: #1542497
  * rtlwifi: fix memory leak for USB device
    - LP: #1542497
  * wlcore/wl12xx: spi: fix oops on firmware load
    - LP: #1542497
  * EDAC, mc_sysfs: Fix freeing bus' name
    - LP: #1542497
  * EDAC: Don't try to cancel workqueue when it's never setup
    - LP: #1542497
  * EDAC: Robustify workqueues destruction
    - LP: #1542497
  * powerpc: Make value-returning atomics fully ordered
    - LP: #1542497
  * powerpc: Make {cmp}xchg* and their atomic_ versions fully ordered
    - LP: #1542497
  * dm space map metadata: remove unused variable in brb_pop()
    - LP: #1542497
  * dm thin: fix race condition when destroying thin pool workqueue
    - LP: #1542497
  * futex: Drop refcount if requeue_pi() acquired the rtmutex
    - LP: #1542497
  * drm/radeon: clean up fujitsu quirks
    - LP: #1542497
  * mmc: sdio: Fix invalid vdd in voltage switch power cycle
    - LP: #1542497
  * mmc: sdhci: Fix sdhci_runtime_pm_bus_on/off()
    - LP: #1542497
  * udf: limit the maximum number of indirect extents in a row
    - LP: #1542497
  * nfs: Fix race in __update_open_stateid...

Changed in linux (Ubuntu Trusty):
status: Fix Committed → Fix Released
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.