* [Buildroot] [PATCH v2,1/1] package/libraw: fix CVE-2023-1729
@ 2023-09-17 11:51 Fabrice Fontaine
2023-09-17 12:48 ` Yann E. MORIN
2023-09-24 21:34 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2023-09-17 11:51 UTC (permalink / raw)
To: buildroot; +Cc: Fabrice Fontaine
A flaw was found in LibRaw. A heap-buffer-overflow in raw2image_ex()
caused by a maliciously crafted file may lead to an application crash.
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2:
- Fix title typo
...shrink-flag-for-3-4-component-images.patch | 24 +++++++++++++++++++
package/libraw/libraw.mk | 3 +++
2 files changed, 27 insertions(+)
create mode 100644 package/libraw/0001-do-not-set-shrink-flag-for-3-4-component-images.patch
diff --git a/package/libraw/0001-do-not-set-shrink-flag-for-3-4-component-images.patch b/package/libraw/0001-do-not-set-shrink-flag-for-3-4-component-images.patch
new file mode 100644
index 0000000000..ef93e0901b
--- /dev/null
+++ b/package/libraw/0001-do-not-set-shrink-flag-for-3-4-component-images.patch
@@ -0,0 +1,24 @@
+From 477e0719ffc07190c89b4f3d12d51b1292e75828 Mon Sep 17 00:00:00 2001
+From: Alex Tutubalin <lexa@lexa.ru>
+Date: Sat, 14 Jan 2023 18:32:59 +0300
+Subject: [PATCH] do not set shrink flag for 3/4 component images
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/LibRaw/LibRaw/commit/477e0719ffc07190c89b4f3d12d51b1292e75828
+---
+ src/preprocessing/raw2image.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/preprocessing/raw2image.cpp b/src/preprocessing/raw2image.cpp
+index e65e2ad7..702cf290 100644
+--- a/src/preprocessing/raw2image.cpp
++++ b/src/preprocessing/raw2image.cpp
+@@ -43,6 +43,8 @@ void LibRaw::raw2image_start()
+
+ // adjust for half mode!
+ IO.shrink =
++ !imgdata.rawdata.color4_image && !imgdata.rawdata.color3_image &&
++ !imgdata.rawdata.float4_image && !imgdata.rawdata.float3_image &&
+ P1.filters &&
+ (O.half_size || ((O.threshold || O.aber[0] != 1 || O.aber[2] != 1)));
+
diff --git a/package/libraw/libraw.mk b/package/libraw/libraw.mk
index b6616f0c10..cbd509cfea 100644
--- a/package/libraw/libraw.mk
+++ b/package/libraw/libraw.mk
@@ -18,6 +18,9 @@ LIBRAW_DEPENDENCIES = host-pkgconf
LIBRAW_CXXFLAGS = $(TARGET_CXXFLAGS)
LIBRAW_CONF_ENV = CXXFLAGS="$(LIBRAW_CXXFLAGS)"
+# 0001-do-not-set-shrink-flag-for-3-4-component-images.patch
+LIBRAW_IGNORE_CVES += 0001-do-not-set-shrink-flag-for-3-4-component-images.patch
+
ifeq ($(BR2_PACKAGE_JASPER),y)
LIBRAW_CONF_OPTS += --enable-jasper
LIBRAW_DEPENDENCIES += jasper
--
2.40.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH v2,1/1] package/libraw: fix CVE-2023-1729
2023-09-17 11:51 [Buildroot] [PATCH v2,1/1] package/libraw: fix CVE-2023-1729 Fabrice Fontaine
@ 2023-09-17 12:48 ` Yann E. MORIN
2023-09-24 21:34 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2023-09-17 12:48 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: buildroot
Fabrice, All,
On 2023-09-17 13:51 +0200, Fabrice Fontaine spake thusly:
> A flaw was found in LibRaw. A heap-buffer-overflow in raw2image_ex()
> caused by a maliciously crafted file may lead to an application crash.
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v1 -> v2:
> - Fix title typo
*This one* is the patch I applied! ;-)
Regards,
Yann E. MORIN.
> ...shrink-flag-for-3-4-component-images.patch | 24 +++++++++++++++++++
> package/libraw/libraw.mk | 3 +++
> 2 files changed, 27 insertions(+)
> create mode 100644 package/libraw/0001-do-not-set-shrink-flag-for-3-4-component-images.patch
>
> diff --git a/package/libraw/0001-do-not-set-shrink-flag-for-3-4-component-images.patch b/package/libraw/0001-do-not-set-shrink-flag-for-3-4-component-images.patch
> new file mode 100644
> index 0000000000..ef93e0901b
> --- /dev/null
> +++ b/package/libraw/0001-do-not-set-shrink-flag-for-3-4-component-images.patch
> @@ -0,0 +1,24 @@
> +From 477e0719ffc07190c89b4f3d12d51b1292e75828 Mon Sep 17 00:00:00 2001
> +From: Alex Tutubalin <lexa@lexa.ru>
> +Date: Sat, 14 Jan 2023 18:32:59 +0300
> +Subject: [PATCH] do not set shrink flag for 3/4 component images
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Upstream: https://github.com/LibRaw/LibRaw/commit/477e0719ffc07190c89b4f3d12d51b1292e75828
> +---
> + src/preprocessing/raw2image.cpp | 2 ++
> + 1 file changed, 2 insertions(+)
> +
> +diff --git a/src/preprocessing/raw2image.cpp b/src/preprocessing/raw2image.cpp
> +index e65e2ad7..702cf290 100644
> +--- a/src/preprocessing/raw2image.cpp
> ++++ b/src/preprocessing/raw2image.cpp
> +@@ -43,6 +43,8 @@ void LibRaw::raw2image_start()
> +
> + // adjust for half mode!
> + IO.shrink =
> ++ !imgdata.rawdata.color4_image && !imgdata.rawdata.color3_image &&
> ++ !imgdata.rawdata.float4_image && !imgdata.rawdata.float3_image &&
> + P1.filters &&
> + (O.half_size || ((O.threshold || O.aber[0] != 1 || O.aber[2] != 1)));
> +
> diff --git a/package/libraw/libraw.mk b/package/libraw/libraw.mk
> index b6616f0c10..cbd509cfea 100644
> --- a/package/libraw/libraw.mk
> +++ b/package/libraw/libraw.mk
> @@ -18,6 +18,9 @@ LIBRAW_DEPENDENCIES = host-pkgconf
> LIBRAW_CXXFLAGS = $(TARGET_CXXFLAGS)
> LIBRAW_CONF_ENV = CXXFLAGS="$(LIBRAW_CXXFLAGS)"
>
> +# 0001-do-not-set-shrink-flag-for-3-4-component-images.patch
> +LIBRAW_IGNORE_CVES += 0001-do-not-set-shrink-flag-for-3-4-component-images.patch
> +
> ifeq ($(BR2_PACKAGE_JASPER),y)
> LIBRAW_CONF_OPTS += --enable-jasper
> LIBRAW_DEPENDENCIES += jasper
> --
> 2.40.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH v2,1/1] package/libraw: fix CVE-2023-1729
2023-09-17 11:51 [Buildroot] [PATCH v2,1/1] package/libraw: fix CVE-2023-1729 Fabrice Fontaine
2023-09-17 12:48 ` Yann E. MORIN
@ 2023-09-24 21:34 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2023-09-24 21:34 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: buildroot
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
> A flaw was found in LibRaw. A heap-buffer-overflow in raw2image_ex()
> caused by a maliciously crafted file may lead to an application crash.
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v1 -> v2:
> - Fix title typo
Committed to 2023.02.x, 2023.05.x and 2023.08.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-24 21:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-17 11:51 [Buildroot] [PATCH v2,1/1] package/libraw: fix CVE-2023-1729 Fabrice Fontaine
2023-09-17 12:48 ` Yann E. MORIN
2023-09-24 21:34 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox