diff options
| author | Thiruvadi Rajaraman <trajaraman@mvista.com> | 2017-09-21 19:06:01 +0530 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-07 17:10:08 +0000 |
| commit | b5093a5c875f50e716ed35f2a65f1ae21c603e4f (patch) | |
| tree | ffcdf2c06b9cfa507381c7fd72dfd7fe89b7973f | |
| parent | 321f980a1e35d34dbad5a28b29aa4ef951d08ddb (diff) | |
| download | poky-b5093a5c875f50e716ed35f2a65f1ae21c603e4f.tar.gz | |
binutils: CVE-2017-9749
Source: binutils-gdb.git
MR: 74010
Type: Security Fix
Disposition: Backport from binutils-2_29
ChangeID: 5b89fbcab899af53585b61bd40724a38bff831d3
Description:
Prevent invalid array accesses when disassembling a corrupt bfin binary.
PR binutils/21586
* bfin-dis.c (gregs): Clip index to prevent overflow.
(regs): Likewise.
(regs_lo): Likewise.
(regs_hi): Likewise.
Affects: <= 2.28
Author: Nick Clifton <nickc@redhat.com>
(From OE-Core rev: 3306cbace5069e58bb62f31ec91ca805410bd949)
Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com>
Reviewed-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils-2.27.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils/CVE-2017-9749.patch | 75 |
2 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.27.inc b/meta/recipes-devtools/binutils/binutils-2.27.inc index 5c3d3ca223..5e1e0be393 100644 --- a/meta/recipes-devtools/binutils/binutils-2.27.inc +++ b/meta/recipes-devtools/binutils/binutils-2.27.inc | |||
| @@ -79,6 +79,7 @@ SRC_URI = "\ | |||
| 79 | file://CVE-2017-7299_1.patch \ | 79 | file://CVE-2017-7299_1.patch \ |
| 80 | file://CVE-2017-7299_2.patch \ | 80 | file://CVE-2017-7299_2.patch \ |
| 81 | file://CVE-2017-9751.patch \ | 81 | file://CVE-2017-9751.patch \ |
| 82 | file://CVE-2017-9749.patch \ | ||
| 82 | " | 83 | " |
| 83 | S = "${WORKDIR}/git" | 84 | S = "${WORKDIR}/git" |
| 84 | 85 | ||
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-9749.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-9749.patch new file mode 100644 index 0000000000..a033d3dce6 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-9749.patch | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | commit 08c7881b814c546efc3996fd1decdf0877f7a779 | ||
| 2 | Author: Nick Clifton <nickc@redhat.com> | ||
| 3 | Date: Thu Jun 15 11:52:02 2017 +0100 | ||
| 4 | |||
| 5 | Prevent invalid array accesses when disassembling a corrupt bfin binary. | ||
| 6 | |||
| 7 | PR binutils/21586 | ||
| 8 | * bfin-dis.c (gregs): Clip index to prevent overflow. | ||
| 9 | (regs): Likewise. | ||
| 10 | (regs_lo): Likewise. | ||
| 11 | (regs_hi): Likewise. | ||
| 12 | |||
| 13 | Upstream-Status: Backport | ||
| 14 | |||
| 15 | CVE: CVE-2017-9749 | ||
| 16 | Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com> | ||
| 17 | |||
| 18 | Index: git/opcodes/bfin-dis.c | ||
| 19 | =================================================================== | ||
| 20 | --- git.orig/opcodes/bfin-dis.c 2017-09-21 13:53:52.667168259 +0530 | ||
| 21 | +++ git/opcodes/bfin-dis.c 2017-09-21 13:54:00.603231339 +0530 | ||
| 22 | @@ -350,7 +350,7 @@ | ||
| 23 | REG_P0, REG_P1, REG_P2, REG_P3, REG_P4, REG_P5, REG_SP, REG_FP, | ||
| 24 | }; | ||
| 25 | |||
| 26 | -#define gregs(x, i) REGNAME (decode_gregs[((i) << 3) | (x)]) | ||
| 27 | +#define gregs(x, i) REGNAME (decode_gregs[(((i) << 3) | (x)) & 15]) | ||
| 28 | |||
| 29 | /* [dregs pregs (iregs mregs) (bregs lregs)]. */ | ||
| 30 | static const enum machine_registers decode_regs[] = | ||
| 31 | @@ -361,7 +361,7 @@ | ||
| 32 | REG_B0, REG_B1, REG_B2, REG_B3, REG_L0, REG_L1, REG_L2, REG_L3, | ||
| 33 | }; | ||
| 34 | |||
| 35 | -#define regs(x, i) REGNAME (decode_regs[((i) << 3) | (x)]) | ||
| 36 | +#define regs(x, i) REGNAME (decode_regs[(((i) << 3) | (x)) & 31]) | ||
| 37 | |||
| 38 | /* [dregs pregs (iregs mregs) (bregs lregs) Low Half]. */ | ||
| 39 | static const enum machine_registers decode_regs_lo[] = | ||
| 40 | @@ -372,7 +372,7 @@ | ||
| 41 | REG_BL0, REG_BL1, REG_BL2, REG_BL3, REG_LL0, REG_LL1, REG_LL2, REG_LL3, | ||
| 42 | }; | ||
| 43 | |||
| 44 | -#define regs_lo(x, i) REGNAME (decode_regs_lo[((i) << 3) | (x)]) | ||
| 45 | +#define regs_lo(x, i) REGNAME (decode_regs_lo[(((i) << 3) | (x)) & 31]) | ||
| 46 | |||
| 47 | /* [dregs pregs (iregs mregs) (bregs lregs) High Half]. */ | ||
| 48 | static const enum machine_registers decode_regs_hi[] = | ||
| 49 | @@ -383,7 +383,7 @@ | ||
| 50 | REG_BH0, REG_BH1, REG_BH2, REG_BH3, REG_LH0, REG_LH1, REG_LH2, REG_LH3, | ||
| 51 | }; | ||
| 52 | |||
| 53 | -#define regs_hi(x, i) REGNAME (decode_regs_hi[((i) << 3) | (x)]) | ||
| 54 | +#define regs_hi(x, i) REGNAME (decode_regs_hi[(((i) << 3) | (x)) & 31]) | ||
| 55 | |||
| 56 | static const enum machine_registers decode_statbits[] = | ||
| 57 | { | ||
| 58 | Index: git/opcodes/ChangeLog | ||
| 59 | =================================================================== | ||
| 60 | --- git.orig/opcodes/ChangeLog 2017-09-21 13:54:00.543230862 +0530 | ||
| 61 | +++ git/opcodes/ChangeLog 2017-09-21 14:06:03.772928105 +0530 | ||
| 62 | @@ -1,5 +1,13 @@ | ||
| 63 | 2017-06-15 Nick Clifton <nickc@redhat.com> | ||
| 64 | |||
| 65 | + PR binutils/21586 | ||
| 66 | + * bfin-dis.c (gregs): Clip index to prevent overflow. | ||
| 67 | + (regs): Likewise. | ||
| 68 | + (regs_lo): Likewise. | ||
| 69 | + (regs_hi): Likewise. | ||
| 70 | + | ||
| 71 | +2017-06-15 Nick Clifton <nickc@redhat.com> | ||
| 72 | + | ||
| 73 | PR binutils/21588 | ||
| 74 | * rl78-decode.opc (OP_BUF_LEN): Define. | ||
| 75 | (GETBYTE): Check for the index exceeding OP_BUF_LEN. | ||
