diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-core/dropbear/dropbear.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-core/dropbear/dropbear/CVE-2023-36328.patch | 144 |
2 files changed, 145 insertions, 0 deletions
diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc index f3f085b616..e61930f7db 100644 --- a/meta/recipes-core/dropbear/dropbear.inc +++ b/meta/recipes-core/dropbear/dropbear.inc | |||
| @@ -29,6 +29,7 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \ | |||
| 29 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ | 29 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ |
| 30 | ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} \ | 30 | ${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} \ |
| 31 | file://CVE-2021-36369.patch \ | 31 | file://CVE-2021-36369.patch \ |
| 32 | file://CVE-2023-36328.patch \ | ||
| 32 | " | 33 | " |
| 33 | 34 | ||
| 34 | PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ | 35 | PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ |
diff --git a/meta/recipes-core/dropbear/dropbear/CVE-2023-36328.patch b/meta/recipes-core/dropbear/dropbear/CVE-2023-36328.patch new file mode 100644 index 0000000000..4d8c40f70b --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/CVE-2023-36328.patch | |||
| @@ -0,0 +1,144 @@ | |||
| 1 | From beba892bc0d4e4ded4d667ab1d2a94f4d75109a9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: czurnieden <czurnieden@gmx.de> | ||
| 3 | Date: Wed, 6 Sep 2023 10:48:58 +0000 | ||
| 4 | Subject: [PATCH] Fix possible integer overflow | ||
| 5 | |||
| 6 | CVE: CVE-2023-36328 | ||
| 7 | |||
| 8 | Upstream-Status: Backport [https://github.com/libtom/libtommath/commit/beba892bc0d4e4ded4d667ab1d2a94f4d75109a9] | ||
| 9 | |||
| 10 | Signed-off-by: Yogita Urade <yogita.urade@windriver.com> | ||
| 11 | --- | ||
| 12 | libtommath/bn_mp_2expt.c | 4 ++++ | ||
| 13 | libtommath/bn_mp_grow.c | 4 ++++ | ||
| 14 | libtommath/bn_mp_init_size.c | 5 +++++ | ||
| 15 | libtommath/bn_mp_mul_2d.c | 4 ++++ | ||
| 16 | libtommath/bn_s_mp_mul_digs.c | 4 ++++ | ||
| 17 | libtommath/bn_s_mp_mul_digs_fast.c | 4 ++++ | ||
| 18 | libtommath/bn_s_mp_mul_high_digs.c | 4 ++++ | ||
| 19 | libtommath/bn_s_mp_mul_high_digs_fast.c | 4 ++++ | ||
| 20 | 8 files changed, 33 insertions(+) | ||
| 21 | |||
| 22 | diff --git a/libtommath/bn_mp_2expt.c b/libtommath/bn_mp_2expt.c | ||
| 23 | index 0ae3df1..7d4d884 100644 | ||
| 24 | --- a/libtommath/bn_mp_2expt.c | ||
| 25 | +++ b/libtommath/bn_mp_2expt.c | ||
| 26 | @@ -12,6 +12,10 @@ mp_err mp_2expt(mp_int *a, int b) | ||
| 27 | { | ||
| 28 | mp_err err; | ||
| 29 | |||
| 30 | + if (b < 0) { | ||
| 31 | + return MP_VAL; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | /* zero a as per default */ | ||
| 35 | mp_zero(a); | ||
| 36 | |||
| 37 | diff --git a/libtommath/bn_mp_grow.c b/libtommath/bn_mp_grow.c | ||
| 38 | index 9e904c5..e7b186c 100644 | ||
| 39 | --- a/libtommath/bn_mp_grow.c | ||
| 40 | +++ b/libtommath/bn_mp_grow.c | ||
| 41 | @@ -9,6 +9,10 @@ mp_err mp_grow(mp_int *a, int size) | ||
| 42 | int i; | ||
| 43 | mp_digit *tmp; | ||
| 44 | |||
| 45 | + if (size < 0) { | ||
| 46 | + return MP_VAL; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | /* if the alloc size is smaller alloc more ram */ | ||
| 50 | if (a->alloc < size) { | ||
| 51 | /* reallocate the array a->dp | ||
| 52 | diff --git a/libtommath/bn_mp_init_size.c b/libtommath/bn_mp_init_size.c | ||
| 53 | index d622687..5fefa96 100644 | ||
| 54 | --- a/libtommath/bn_mp_init_size.c | ||
| 55 | +++ b/libtommath/bn_mp_init_size.c | ||
| 56 | @@ -6,6 +6,11 @@ | ||
| 57 | /* init an mp_init for a given size */ | ||
| 58 | mp_err mp_init_size(mp_int *a, int size) | ||
| 59 | { | ||
| 60 | + | ||
| 61 | + if (size < 0) { | ||
| 62 | + return MP_VAL; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | size = MP_MAX(MP_MIN_PREC, size); | ||
| 66 | |||
| 67 | /* alloc mem */ | ||
| 68 | diff --git a/libtommath/bn_mp_mul_2d.c b/libtommath/bn_mp_mul_2d.c | ||
| 69 | index 87354de..2744163 100644 | ||
| 70 | --- a/libtommath/bn_mp_mul_2d.c | ||
| 71 | +++ b/libtommath/bn_mp_mul_2d.c | ||
| 72 | @@ -9,6 +9,10 @@ mp_err mp_mul_2d(const mp_int *a, int b, mp_int *c) | ||
| 73 | mp_digit d; | ||
| 74 | mp_err err; | ||
| 75 | |||
| 76 | + if (b < 0) { | ||
| 77 | + return MP_VAL; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | /* copy */ | ||
| 81 | if (a != c) { | ||
| 82 | if ((err = mp_copy(a, c)) != MP_OKAY) { | ||
| 83 | diff --git a/libtommath/bn_s_mp_mul_digs.c b/libtommath/bn_s_mp_mul_digs.c | ||
| 84 | index 64509d4..2d2f5b0 100644 | ||
| 85 | --- a/libtommath/bn_s_mp_mul_digs.c | ||
| 86 | +++ b/libtommath/bn_s_mp_mul_digs.c | ||
| 87 | @@ -16,6 +16,10 @@ mp_err s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) | ||
| 88 | mp_word r; | ||
| 89 | mp_digit tmpx, *tmpt, *tmpy; | ||
| 90 | |||
| 91 | + if (digs < 0) { | ||
| 92 | + return MP_VAL; | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | /* can we use the fast multiplier? */ | ||
| 96 | if ((digs < MP_WARRAY) && | ||
| 97 | (MP_MIN(a->used, b->used) < MP_MAXFAST)) { | ||
| 98 | diff --git a/libtommath/bn_s_mp_mul_digs_fast.c b/libtommath/bn_s_mp_mul_digs_fast.c | ||
| 99 | index b2a287b..d6dd3cc 100644 | ||
| 100 | --- a/libtommath/bn_s_mp_mul_digs_fast.c | ||
| 101 | +++ b/libtommath/bn_s_mp_mul_digs_fast.c | ||
| 102 | @@ -26,6 +26,10 @@ mp_err s_mp_mul_digs_fast(const mp_int *a, const mp_int *b, mp_int *c, int digs) | ||
| 103 | mp_digit W[MP_WARRAY]; | ||
| 104 | mp_word _W; | ||
| 105 | |||
| 106 | + if (digs < 0) { | ||
| 107 | + return MP_VAL; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | /* grow the destination as required */ | ||
| 111 | if (c->alloc < digs) { | ||
| 112 | if ((err = mp_grow(c, digs)) != MP_OKAY) { | ||
| 113 | diff --git a/libtommath/bn_s_mp_mul_high_digs.c b/libtommath/bn_s_mp_mul_high_digs.c | ||
| 114 | index 2bb2a50..c9dd355 100644 | ||
| 115 | --- a/libtommath/bn_s_mp_mul_high_digs.c | ||
| 116 | +++ b/libtommath/bn_s_mp_mul_high_digs.c | ||
| 117 | @@ -15,6 +15,10 @@ mp_err s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) | ||
| 118 | mp_word r; | ||
| 119 | mp_digit tmpx, *tmpt, *tmpy; | ||
| 120 | |||
| 121 | + if (digs < 0) { | ||
| 122 | + return MP_VAL; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | /* can we use the fast multiplier? */ | ||
| 126 | if (MP_HAS(S_MP_MUL_HIGH_DIGS_FAST) | ||
| 127 | && ((a->used + b->used + 1) < MP_WARRAY) | ||
| 128 | diff --git a/libtommath/bn_s_mp_mul_high_digs_fast.c b/libtommath/bn_s_mp_mul_high_digs_fast.c | ||
| 129 | index a2c4fb6..4ce7f59 100644 | ||
| 130 | --- a/libtommath/bn_s_mp_mul_high_digs_fast.c | ||
| 131 | +++ b/libtommath/bn_s_mp_mul_high_digs_fast.c | ||
| 132 | @@ -19,6 +19,10 @@ mp_err s_mp_mul_high_digs_fast(const mp_int *a, const mp_int *b, mp_int *c, int | ||
| 133 | mp_digit W[MP_WARRAY]; | ||
| 134 | mp_word _W; | ||
| 135 | |||
| 136 | + if (digs < 0) { | ||
| 137 | + return MP_VAL; | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | /* grow the destination as required */ | ||
| 141 | pa = a->used + b->used; | ||
| 142 | if (c->alloc < pa) { | ||
| 143 | -- | ||
| 144 | 2.35.5 | ||
