diff options
Diffstat (limited to 'meta/recipes-devtools/rpm/files/CVE-2021-3521-03.patch')
-rw-r--r-- | meta/recipes-devtools/rpm/files/CVE-2021-3521-03.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/files/CVE-2021-3521-03.patch b/meta/recipes-devtools/rpm/files/CVE-2021-3521-03.patch new file mode 100644 index 0000000000..fd31f11beb --- /dev/null +++ b/meta/recipes-devtools/rpm/files/CVE-2021-3521-03.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 5ff86764b17f31535cb247543a90dd739076ec38 Mon Sep 17 00:00:00 2001 | ||
2 | From: Demi Marie Obenour <demi@invisiblethingslab.com> | ||
3 | Date: Thu, 6 May 2021 18:34:45 -0400 | ||
4 | Subject: [PATCH] Do not allow extra packets to follow a signature | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | According to RFC 4880 § 11.4, a detached signature is “simply a | ||
10 | Signature packet”. Therefore, extra packets following a detached | ||
11 | signature are not allowed. | ||
12 | |||
13 | Dependent patch: | ||
14 | CVE: CVE-2021-3521 | ||
15 | Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/5ff86764b17f31535cb247543a90dd739076ec38] | ||
16 | Signed-off-by: Riyaz Khan <Riyaz.Khan@kpit.com> | ||
17 | |||
18 | --- | ||
19 | rpmio/rpmpgp.c | 2 ++ | ||
20 | 1 file changed, 2 insertions(+) | ||
21 | |||
22 | diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c | ||
23 | index f1a99e7169..5b346a8253 100644 | ||
24 | --- a/rpmio/rpmpgp.c | ||
25 | +++ b/rpmio/rpmpgp.c | ||
26 | @@ -1068,6 +1068,8 @@ int pgpPrtParams(const uint8_t * pkts, size_t pktlen, unsigned int pkttype, | ||
27 | break; | ||
28 | |||
29 | p += (pkt.body - pkt.head) + pkt.blen; | ||
30 | + if (pkttype == PGPTAG_SIGNATURE) | ||
31 | + break; | ||
32 | } | ||
33 | |||
34 | rc = (digp && (p == pend)) ? 0 : -1; | ||