diff options
| author | Soumya Sambu <soumya.sambu@windriver.com> | 2025-11-07 17:04:28 +0530 |
|---|---|---|
| committer | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-11-07 12:41:54 +0100 |
| commit | 7c7ab8ad4e2269d73fa6a572a7222aca3fdee27d (patch) | |
| tree | 3bd9d6b88361abf90ccb3d0a0ee1d669a6ccd609 /meta-python | |
| parent | b0d98aae8c41f43684b0d2afb7ee9a02ad4bd9c7 (diff) | |
| download | meta-openembedded-7c7ab8ad4e2269d73fa6a572a7222aca3fdee27d.tar.gz | |
python3-pillow: Fix CVE-2024-28219
In _imagingcms.c in Pillow before 10.3.0, a buffer overflow exists because
strcpy is used instead of strncpy.
References:
https://nvd.nist.gov/vuln/detail/CVE-2024-28219
https://security-tracker.debian.org/tracker/CVE-2024-28219
Upstream patch:
https://github.com/python-pillow/Pillow/commit/2a93aba5cfcf6e241ab4f9392c13e3b74032c061
Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com>
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-python')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-pillow/CVE-2024-28219.patch | 43 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-pillow_9.4.0.bb | 1 |
2 files changed, 44 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-pillow/CVE-2024-28219.patch b/meta-python/recipes-devtools/python/python3-pillow/CVE-2024-28219.patch new file mode 100644 index 0000000000..3509b108eb --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pillow/CVE-2024-28219.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From 2a93aba5cfcf6e241ab4f9392c13e3b74032c061 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andrew Murray <radarhere@users.noreply.github.com> | ||
| 3 | Date: Thu, 22 Feb 2024 18:56:26 +1100 | ||
| 4 | Subject: [PATCH] Use strncpy to avoid buffer overflow | ||
| 5 | |||
| 6 | CVE: CVE-2024-28219 | ||
| 7 | |||
| 8 | Upstream-Status: Backport [https://github.com/python-pillow/Pillow/commit/2a93aba5cfcf6e241ab4f9392c13e3b74032c061] | ||
| 9 | |||
| 10 | Signed-off-by: Soumya Sambu <soumya.sambu@windriver.com> | ||
| 11 | --- | ||
| 12 | src/_imagingcms.c | 8 ++++---- | ||
| 13 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/src/_imagingcms.c b/src/_imagingcms.c | ||
| 16 | index 9b5a121d7..b839f09f0 100644 | ||
| 17 | --- a/src/_imagingcms.c | ||
| 18 | +++ b/src/_imagingcms.c | ||
| 19 | @@ -201,8 +201,8 @@ cms_transform_new(cmsHTRANSFORM transform, char *mode_in, char *mode_out) { | ||
| 20 | |||
| 21 | self->transform = transform; | ||
| 22 | |||
| 23 | - strcpy(self->mode_in, mode_in); | ||
| 24 | - strcpy(self->mode_out, mode_out); | ||
| 25 | + strncpy(self->mode_in, mode_in, 8); | ||
| 26 | + strncpy(self->mode_out, mode_out, 8); | ||
| 27 | |||
| 28 | return (PyObject *)self; | ||
| 29 | } | ||
| 30 | @@ -244,8 +244,8 @@ findLCMStype(char *PILmode) { | ||
| 31 | } | ||
| 32 | |||
| 33 | else { | ||
| 34 | - /* take a wild guess... but you probably should fail instead. */ | ||
| 35 | - return TYPE_GRAY_8; /* so there's no buffer overrun... */ | ||
| 36 | + /* take a wild guess... */ | ||
| 37 | + return TYPE_GRAY_8; | ||
| 38 | } | ||
| 39 | } | ||
| 40 | |||
| 41 | -- | ||
| 42 | 2.40.0 | ||
| 43 | |||
diff --git a/meta-python/recipes-devtools/python/python3-pillow_9.4.0.bb b/meta-python/recipes-devtools/python/python3-pillow_9.4.0.bb index e42e58be80..ffc2c00fb1 100644 --- a/meta-python/recipes-devtools/python/python3-pillow_9.4.0.bb +++ b/meta-python/recipes-devtools/python/python3-pillow_9.4.0.bb | |||
| @@ -14,6 +14,7 @@ SRC_URI = "git://github.com/python-pillow/Pillow.git;branch=main;protocol=https | |||
| 14 | file://CVE-2023-50447-2.patch \ | 14 | file://CVE-2023-50447-2.patch \ |
| 15 | file://CVE-2023-50447-3.patch \ | 15 | file://CVE-2023-50447-3.patch \ |
| 16 | file://CVE-2023-50447-4.patch \ | 16 | file://CVE-2023-50447-4.patch \ |
| 17 | file://CVE-2024-28219.patch \ | ||
| 17 | " | 18 | " |
| 18 | SRCREV ?= "82541b6dec8452cb612067fcebba1c5a1a2bfdc8" | 19 | SRCREV ?= "82541b6dec8452cb612067fcebba1c5a1a2bfdc8" |
| 19 | 20 | ||
