diff options
| author | Vijay Anusuri <vanusuri@mvista.com> | 2024-02-23 09:25:28 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-03-07 08:32:54 -1000 |
| commit | 3542ad6716e785012a5443bc3b171736b4f79151 (patch) | |
| tree | d04fe5dd54302665923540605a31129ee3a0758a /meta/recipes-extended/less | |
| parent | b3e316e8486e5462c3c71a9c8248779a5c253385 (diff) | |
| download | poky-3542ad6716e785012a5443bc3b171736b4f79151.tar.gz | |
less: Fix for CVE-2022-48624
Upstream-Status: Backport [https://github.com/gwsw/less/commit/c6ac6de49698be84d264a0c4c0c40bb870b10144]
(From OE-Core rev: 8d91ab209398a8415009bc3093d407bf8871dafd)
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-extended/less')
| -rw-r--r-- | meta/recipes-extended/less/less/CVE-2022-48624.patch | 41 | ||||
| -rw-r--r-- | meta/recipes-extended/less/less_600.bb | 1 |
2 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-extended/less/less/CVE-2022-48624.patch b/meta/recipes-extended/less/less/CVE-2022-48624.patch new file mode 100644 index 0000000000..409730bd4f --- /dev/null +++ b/meta/recipes-extended/less/less/CVE-2022-48624.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | From c6ac6de49698be84d264a0c4c0c40bb870b10144 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mark Nudelman <markn@greenwoodsoftware.com> | ||
| 3 | Date: Sat, 25 Jun 2022 11:54:43 -0700 | ||
| 4 | Subject: [PATCH] Shell-quote filenames when invoking LESSCLOSE. | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://github.com/gwsw/less/commit/c6ac6de49698be84d264a0c4c0c40bb870b10144] | ||
| 7 | CVE: CVE-2022-48624 | ||
| 8 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 9 | --- | ||
| 10 | filename.c | 10 ++++++++-- | ||
| 11 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/filename.c b/filename.c | ||
| 14 | index 5824e385..dff20c08 100644 | ||
| 15 | --- a/filename.c | ||
| 16 | +++ b/filename.c | ||
| 17 | @@ -972,6 +972,8 @@ close_altfile(altfilename, filename) | ||
| 18 | { | ||
| 19 | #if HAVE_POPEN | ||
| 20 | char *lessclose; | ||
| 21 | + char *qfilename; | ||
| 22 | + char *qaltfilename; | ||
| 23 | FILE *fd; | ||
| 24 | char *cmd; | ||
| 25 | int len; | ||
| 26 | @@ -986,9 +988,13 @@ close_altfile(altfilename, filename) | ||
| 27 | error("LESSCLOSE ignored; must contain no more than 2 %%s", NULL_PARG); | ||
| 28 | return; | ||
| 29 | } | ||
| 30 | - len = (int) (strlen(lessclose) + strlen(filename) + strlen(altfilename) + 2); | ||
| 31 | + qfilename = shell_quote(filename); | ||
| 32 | + qaltfilename = shell_quote(altfilename); | ||
| 33 | + len = (int) (strlen(lessclose) + strlen(qfilename) + strlen(qaltfilename) + 2); | ||
| 34 | cmd = (char *) ecalloc(len, sizeof(char)); | ||
| 35 | - SNPRINTF2(cmd, len, lessclose, filename, altfilename); | ||
| 36 | + SNPRINTF2(cmd, len, lessclose, qfilename, qaltfilename); | ||
| 37 | + free(qaltfilename); | ||
| 38 | + free(qfilename); | ||
| 39 | fd = shellcmd(cmd); | ||
| 40 | free(cmd); | ||
| 41 | if (fd != NULL) | ||
diff --git a/meta/recipes-extended/less/less_600.bb b/meta/recipes-extended/less/less_600.bb index f68281ac93..f88127a9e3 100644 --- a/meta/recipes-extended/less/less_600.bb +++ b/meta/recipes-extended/less/less_600.bb | |||
| @@ -27,6 +27,7 @@ DEPENDS = "ncurses" | |||
| 27 | 27 | ||
| 28 | SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz \ | 28 | SRC_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 | " | 31 | " |
| 31 | 32 | ||
| 32 | SRC_URI[sha256sum] = "6633d6aa2b3cc717afb2c205778c7c42c4620f63b1d682f3d12c98af0be74d20" | 33 | SRC_URI[sha256sum] = "6633d6aa2b3cc717afb2c205778c7c42c4620f63b1d682f3d12c98af0be74d20" |
