summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
authorVijay Anusuri <vanusuri@mvista.com>2024-05-07 10:52:57 +0530
committerSteve Sakoman <steve@sakoman.com>2024-05-15 09:44:14 -0700
commit197002083abfec7b91d54a05b7cb8559c8297c5e (patch)
tree31077d62df10db229f409f8c4ba2f84e9924732e /meta/recipes-extended
parent049e890f7aaeb4b5d7854e162f6db6e9c3cc2979 (diff)
downloadpoky-197002083abfec7b91d54a05b7cb8559c8297c5e.tar.gz
less: backport Debian patch for CVE-2024-32487
import patch from ubuntu to fix CVE-2024-32487 Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/less/tree/debian/patches?h=ubuntu/jammy-security Upstream commit https://github.com/gwsw/less/commit/007521ac3c95bc76e3d59c6dbfe75d06c8075c33] (From OE-Core rev: 1456b309963d3121e5ab2bc9de02b19663ee3a43) Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/less/less/CVE-2024-32487.patch69
-rw-r--r--meta/recipes-extended/less/less_600.bb1
2 files changed, 70 insertions, 0 deletions
diff --git a/meta/recipes-extended/less/less/CVE-2024-32487.patch b/meta/recipes-extended/less/less/CVE-2024-32487.patch
new file mode 100644
index 0000000000..d5c8b9ce31
--- /dev/null
+++ b/meta/recipes-extended/less/less/CVE-2024-32487.patch
@@ -0,0 +1,69 @@
1From 007521ac3c95bc76e3d59c6dbfe75d06c8075c33 Mon Sep 17 00:00:00 2001
2From: Mark Nudelman <markn@greenwoodsoftware.com>
3Date: Thu, 11 Apr 2024 17:49:48 -0700
4Subject: [PATCH] Fix bug when viewing a file whose name contains a newline.
5
6Upstream-Status: Backport [import from ubuntu https://git.launchpad.net/ubuntu/+source/less/tree/debian/patches/CVE-2024-32487.patch?h=ubuntu/jammy-security
7Upstream commit https://github.com/gwsw/less/commit/007521ac3c95bc76e3d59c6dbfe75d06c8075c33]
8CVE: CVE-2024-32487
9Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
10---
11 filename.c | 31 +++++++++++++++++++++++++------
12 1 file changed, 25 insertions(+), 6 deletions(-)
13
14--- a/filename.c
15+++ b/filename.c
16@@ -136,6 +136,15 @@ metachar(c)
17 }
18
19 /*
20+ * Must use quotes rather than escape char for this metachar?
21+ */
22+static int must_quote(char c)
23+{
24+ /* {{ Maybe the set of must_quote chars should be configurable? }} */
25+ return (c == '\n');
26+}
27+
28+/*
29 * Insert a backslash before each metacharacter in a string.
30 */
31 public char *
32@@ -168,6 +177,9 @@ shell_quote(s)
33 * doesn't support escape chars. Use quotes.
34 */
35 use_quotes = 1;
36+ } else if (must_quote(*p))
37+ {
38+ len += 3; /* open quote + char + close quote */
39 } else
40 {
41 /*
42@@ -197,15 +209,22 @@ shell_quote(s)
43 {
44 while (*s != '\0')
45 {
46- if (metachar(*s))
47+ if (!metachar(*s))
48 {
49- /*
50- * Add the escape char.
51- */
52+ *p++ = *s++;
53+ } else if (must_quote(*s))
54+ {
55+ /* Surround the char with quotes. */
56+ *p++ = openquote;
57+ *p++ = *s++;
58+ *p++ = closequote;
59+ } else
60+ {
61+ /* Insert an escape char before the char. */
62 strcpy(p, esc);
63 p += esclen;
64+ *p++ = *s++;
65 }
66- *p++ = *s++;
67 }
68 *p = '\0';
69 }
diff --git a/meta/recipes-extended/less/less_600.bb b/meta/recipes-extended/less/less_600.bb
index f88127a9e3..01fed7c065 100644
--- a/meta/recipes-extended/less/less_600.bb
+++ b/meta/recipes-extended/less/less_600.bb
@@ -28,6 +28,7 @@ DEPENDS = "ncurses"
28SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz \ 28SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz \
29 file://CVE-2022-46663.patch \ 29 file://CVE-2022-46663.patch \
30 file://CVE-2022-48624.patch \ 30 file://CVE-2022-48624.patch \
31 file://CVE-2024-32487.patch \
31 " 32 "
32 33
33SRC_URI[sha256sum] = "6633d6aa2b3cc717afb2c205778c7c42c4620f63b1d682f3d12c98af0be74d20" 34SRC_URI[sha256sum] = "6633d6aa2b3cc717afb2c205778c7c42c4620f63b1d682f3d12c98af0be74d20"