diff options
| author | Vijay Anusuri <vanusuri@mvista.com> | 2025-11-11 14:11:02 +0530 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2025-11-19 18:27:19 -0500 |
| commit | d75faad37ae3cbbfe31dffaa6432553fc5450838 (patch) | |
| tree | 0469537aa4bbd84635a979ba6f52776ebcc9f27a | |
| parent | 2d2d799ee27b0a2291a9014b5950f15f5ab7855a (diff) | |
| download | meta-virtualization-d75faad37ae3cbbfe31dffaa6432553fc5450838.tar.gz | |
cloud-init: Fix CVE-2024-11584
import patch from debian to fix
CVE-2024-11584
Upstream-Status: Backport [import from debian 22.4.2-1+deb12u3
Upstream commit
https://github.com/canonical/cloud-init/commit/8b45006c4765fd75f20ce244571b563dbc49d4f2]
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | recipes-extended/cloud-init/cloud-init/CVE-2024-11584.patch | 104 | ||||
| -rw-r--r-- | recipes-extended/cloud-init/cloud-init_git.bb | 1 |
2 files changed, 105 insertions, 0 deletions
diff --git a/recipes-extended/cloud-init/cloud-init/CVE-2024-11584.patch b/recipes-extended/cloud-init/cloud-init/CVE-2024-11584.patch new file mode 100644 index 00000000..fa94ff53 --- /dev/null +++ b/recipes-extended/cloud-init/cloud-init/CVE-2024-11584.patch | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | From 8b45006c4765fd75f20ce244571b563dbc49d4f2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: James Falcon <therealfalcon@gmail.com> | ||
| 3 | Date: Wed, 11 Jun 2025 16:22:32 -0500 | ||
| 4 | Subject: [PATCH] fix: Make hotplug socket writable only by root (#25) | ||
| 5 | |||
| 6 | The 'hook-hotplug-cmd' was writable by all users, allowing any user | ||
| 7 | to trigger the hotplug hook script. This script should only be run | ||
| 8 | by root via a udev trigger. | ||
| 9 | |||
| 10 | Also move socket into 'share' directory and update references | ||
| 11 | accordingly. Since the 'share' directory is only readable by root, | ||
| 12 | this adds another layer of security while also being in a consistent | ||
| 13 | location with the other sockets used by cloud-init. | ||
| 14 | |||
| 15 | CVE-2024-11584 | ||
| 16 | |||
| 17 | Upstream-Status: Backport [import from debain 22.4.2-1+deb12u3 | ||
| 18 | Upstream commit https://github.com/canonical/cloud-init/commit/8b45006c4765fd75f20ce244571b563dbc49d4f2] | ||
| 19 | CVE: CVE-2024-11584 | ||
| 20 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 21 | --- | ||
| 22 | cloudinit/cmd/devel/logs.py | 4 +--- | ||
| 23 | systemd/cloud-init-hotplugd.service | 2 +- | ||
| 24 | systemd/cloud-init-hotplugd.socket | 5 +++-- | ||
| 25 | tools/cloud-init-hotplugd | 2 +- | ||
| 26 | tools/hook-hotplug | 2 +- | ||
| 27 | 5 files changed, 7 insertions(+), 8 deletions(-) | ||
| 28 | |||
| 29 | diff --git a/cloudinit/cmd/devel/logs.py b/cloudinit/cmd/devel/logs.py | ||
| 30 | index 83f574c10..f59e8047c 100755 | ||
| 31 | --- a/cloudinit/cmd/devel/logs.py | ||
| 32 | +++ b/cloudinit/cmd/devel/logs.py | ||
| 33 | @@ -139,9 +139,7 @@ def get_parser(parser=None): | ||
| 34 | |||
| 35 | def _copytree_rundir_ignore_files(curdir, files): | ||
| 36 | """Return a list of files to ignore for /run/cloud-init directory""" | ||
| 37 | - ignored_files = [ | ||
| 38 | - "hook-hotplug-cmd", # named pipe for hotplug | ||
| 39 | - ] | ||
| 40 | + ignored_files = [] | ||
| 41 | if os.getuid() != 0: | ||
| 42 | # Ignore root-permissioned files | ||
| 43 | ignored_files.append(Paths({}).lookups["instance_data_sensitive"]) | ||
| 44 | diff --git a/systemd/cloud-init-hotplugd.service b/systemd/cloud-init-hotplugd.service | ||
| 45 | index 0aeeeaff5..e3a5a74d9 100644 | ||
| 46 | --- a/systemd/cloud-init-hotplugd.service | ||
| 47 | +++ b/systemd/cloud-init-hotplugd.service | ||
| 48 | @@ -1,5 +1,5 @@ | ||
| 49 | # Paired with cloud-init-hotplugd.socket to read from the FIFO | ||
| 50 | -# /run/cloud-init/hook-hotplug-cmd which is created during a udev network | ||
| 51 | +# hook-hotplug-cmd which is created during a udev network | ||
| 52 | # add or remove event as processed by 90-cloud-init-hook-hotplug.rules. | ||
| 53 | |||
| 54 | # On start, read args from the FIFO, process and provide structured arguments | ||
| 55 | diff --git a/systemd/cloud-init-hotplugd.socket b/systemd/cloud-init-hotplugd.socket | ||
| 56 | index acf53f12c..00ad5dead 100644 | ||
| 57 | --- a/systemd/cloud-init-hotplugd.socket | ||
| 58 | +++ b/systemd/cloud-init-hotplugd.socket | ||
| 59 | @@ -1,5 +1,5 @@ | ||
| 60 | # cloud-init-hotplugd.socket listens on the FIFO file | ||
| 61 | -# /run/cloud-init/hook-hotplug-cmd which is created during a udev network | ||
| 62 | +# hook-hotplug-cmd which is created during a udev network | ||
| 63 | # add or remove event as processed by 90-cloud-init-hook-hotplug.rules. | ||
| 64 | |||
| 65 | # Known bug with an enforcing SELinux policy: LP: #1936229 | ||
| 66 | @@ -7,7 +7,8 @@ | ||
| 67 | Description=cloud-init hotplug hook socket | ||
| 68 | |||
| 69 | [Socket] | ||
| 70 | -ListenFIFO=/run/cloud-init/hook-hotplug-cmd | ||
| 71 | +ListenFIFO=/run/cloud-init/share/hook-hotplug-cmd | ||
| 72 | +SocketMode=0600 | ||
| 73 | |||
| 74 | [Install] | ||
| 75 | WantedBy=cloud-init.target | ||
| 76 | diff --git a/tools/cloud-init-hotplugd b/tools/cloud-init-hotplugd | ||
| 77 | index 70977d48e..3d56fffa7 100755 | ||
| 78 | --- a/tools/cloud-init-hotplugd | ||
| 79 | +++ b/tools/cloud-init-hotplugd | ||
| 80 | @@ -9,7 +9,7 @@ | ||
| 81 | # upon a network device event). Anything received via the pipe is then | ||
| 82 | # passed on via the "cloud-init devel hotplug-hook handle" command. | ||
| 83 | |||
| 84 | -PIPE="/run/cloud-init/hook-hotplug-cmd" | ||
| 85 | +PIPE="/run/cloud-init/share/hook-hotplug-cmd" | ||
| 86 | |||
| 87 | mkfifo -m700 $PIPE | ||
| 88 | |||
| 89 | diff --git a/tools/hook-hotplug b/tools/hook-hotplug | ||
| 90 | index 3085ba86d..f7d530d1c 100755 | ||
| 91 | --- a/tools/hook-hotplug | ||
| 92 | +++ b/tools/hook-hotplug | ||
| 93 | @@ -10,7 +10,7 @@ is_finished() { | ||
| 94 | |||
| 95 | if is_finished; then | ||
| 96 | # open cloud-init's hotplug-hook fifo rw | ||
| 97 | - exec 3<>/run/cloud-init/hook-hotplug-cmd | ||
| 98 | + exec 3<>/run/cloud-init/share/hook-hotplug-cmd | ||
| 99 | env_params=" \ | ||
| 100 | --subsystem=${SUBSYSTEM} \ | ||
| 101 | handle \ | ||
| 102 | -- | ||
| 103 | 2.43.0 | ||
| 104 | |||
diff --git a/recipes-extended/cloud-init/cloud-init_git.bb b/recipes-extended/cloud-init/cloud-init_git.bb index 4cf74efd..66462a51 100644 --- a/recipes-extended/cloud-init/cloud-init_git.bb +++ b/recipes-extended/cloud-init/cloud-init_git.bb | |||
| @@ -12,6 +12,7 @@ SRC_URI = "git://github.com/canonical/cloud-init;branch=24.1.x;protocol=https \ | |||
| 12 | file://cloud-init-source-local-lsb-functions.patch \ | 12 | file://cloud-init-source-local-lsb-functions.patch \ |
| 13 | file://0001-setup.py-check-for-install-anywhere-in-args.patch \ | 13 | file://0001-setup.py-check-for-install-anywhere-in-args.patch \ |
| 14 | file://CVE-2024-6174.patch \ | 14 | file://CVE-2024-6174.patch \ |
| 15 | file://CVE-2024-11584.patch \ | ||
| 15 | " | 16 | " |
| 16 | 17 | ||
| 17 | PV = "v23.4.1+git" | 18 | PV = "v23.4.1+git" |
