Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloud-init: checking cmdline for ip= is too broad #3857

Closed
ubuntu-server-builder opened this issue May 12, 2023 · 3 comments
Closed

cloud-init: checking cmdline for ip= is too broad #3857

ubuntu-server-builder opened this issue May 12, 2023 · 3 comments
Labels
launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1919188

Launchpad details
affected_projects = []
assignee = falcojr
assignee_name = James Falcon
date_closed = 2021-05-05T20:34:44.891811+00:00
date_created = 2021-03-15T18:50:05.357633+00:00
date_fix_committed = 2021-03-29T15:26:11.578400+00:00
date_fix_released = 2021-05-05T20:34:44.891811+00:00
id = 1919188
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1919188
milestone = None
owner = falcojr
owner_name = James Falcon
private = False
status = fix_released
submitter = falcojr
submitter_name = James Falcon
tags = []
duplicates = []

Launchpad user James Falcon(falcojr) wrote on 2021-03-15T18:50:05.357633+00:00

klibc initramfs in debian (and I think Ubunutu as well) allows the 'iscsi_target_ip=' cmdline parameter to specify an iscsi device attachment. The cloud-init code to check "whether this system has klibc initramfs network config or not" checks if the 'ip=' string is present in the cmdline. The python code to do this (https://github.com/canonical/cloud-init/blob/master/cloudinit/net/cmdline.py#L75) will match any parameter in the cmdline that contains 'ip='. For iSCSI volumes, the code still works (by accident?) because the next line checks for an open-iscsi interface file, which should exist if we are using iSCSI.

However, it raises the possibility that there are other commandline parameters being used out in the wild that contain 'ip=' that may erroneously be marked by cloud-init as specifying an initramfs network config option. An example fix would be using a regular expression to check that either whitespace or beginning of the line precedes 'ip'.

@ubuntu-server-builder ubuntu-server-builder added the launchpad Migrated from Launchpad label May 12, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user James Falcon(falcojr) wrote on 2021-03-15T18:57:22.736888+00:00

#844

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Dan Watkins(oddbloke) wrote on 2021-03-29T15:26:21.052738+00:00

A fix for this landed in 3b7e2e8

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user James Falcon(falcojr) wrote on 2021-05-05T20:34:46.110800+00:00

This bug is believed to be fixed in cloud-init in version 21.2. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant