diff options
Diffstat (limited to 'meta/recipes-devtools/rsync/files/CVE-2024-12087-0001.patch')
-rw-r--r-- | meta/recipes-devtools/rsync/files/CVE-2024-12087-0001.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rsync/files/CVE-2024-12087-0001.patch b/meta/recipes-devtools/rsync/files/CVE-2024-12087-0001.patch new file mode 100644 index 0000000000..67abc64a62 --- /dev/null +++ b/meta/recipes-devtools/rsync/files/CVE-2024-12087-0001.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 688f5c379a433038bde36897a156d589be373a98 Mon Sep 17 00:00:00 2001 | ||
2 | From: Wayne Davison <wayne@opencoder.net> | ||
3 | Date: Thu, 14 Nov 2024 15:46:50 -0800 | ||
4 | Subject: [PATCH] Refuse a duplicate dirlist. | ||
5 | |||
6 | CVE: CVE-2024-12087 | ||
7 | |||
8 | Upstream-Status: Backport [https://git.samba.org/?p=rsync.git;a=commit;h=688f5c379a433038bde36897a156d589be373a98] | ||
9 | |||
10 | Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> | ||
11 | --- | ||
12 | flist.c | 9 +++++++++ | ||
13 | rsync.h | 1 + | ||
14 | 2 files changed, 10 insertions(+) | ||
15 | |||
16 | diff --git a/flist.c b/flist.c | ||
17 | index 464d556e..847b1054 100644 | ||
18 | --- a/flist.c | ||
19 | +++ b/flist.c | ||
20 | @@ -2584,6 +2584,15 @@ struct file_list *recv_file_list(int f, int dir_ndx) | ||
21 | init_hard_links(); | ||
22 | #endif | ||
23 | |||
24 | + if (inc_recurse && dir_ndx >= 0) { | ||
25 | + struct file_struct *file = dir_flist->files[dir_ndx]; | ||
26 | + if (file->flags & FLAG_GOT_DIR_FLIST) { | ||
27 | + rprintf(FERROR_XFER, "rsync: refusing malicious duplicate flist for dir %d\n", dir_ndx); | ||
28 | + exit_cleanup(RERR_PROTOCOL); | ||
29 | + } | ||
30 | + file->flags |= FLAG_GOT_DIR_FLIST; | ||
31 | + } | ||
32 | + | ||
33 | flist = flist_new(0, "recv_file_list"); | ||
34 | flist_expand(flist, FLIST_START_LARGE); | ||
35 | |||
36 | diff --git a/rsync.h b/rsync.h | ||
37 | index 0f9e277f..b9a7101a 100644 | ||
38 | --- a/rsync.h | ||
39 | +++ b/rsync.h | ||
40 | @@ -84,6 +84,7 @@ | ||
41 | #define FLAG_DUPLICATE (1<<4) /* sender */ | ||
42 | #define FLAG_MISSING_DIR (1<<4) /* generator */ | ||
43 | #define FLAG_HLINKED (1<<5) /* receiver/generator (checked on all types) */ | ||
44 | +#define FLAG_GOT_DIR_FLIST (1<<5)/* sender/receiver/generator - dir_flist only */ | ||
45 | #define FLAG_HLINK_FIRST (1<<6) /* receiver/generator (w/FLAG_HLINKED) */ | ||
46 | #define FLAG_IMPLIED_DIR (1<<6) /* sender/receiver/generator (dirs only) */ | ||
47 | #define FLAG_HLINK_LAST (1<<7) /* receiver/generator */ | ||
48 | -- | ||
49 | 2.40.0 | ||