From d7bf8c17eca8f8c89898a7794462c773c449e983 Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Sun, 25 Feb 2018 22:55:05 -0500 Subject: Yocto 2.4 Move OpenBMC to Yocto 2.4(rocko) Tested: Built and verified Witherspoon and Palmetto images Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67 Signed-off-by: Brad Bishop --- .../shadow/files/0001-shadow-CVE-2017-12424 | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-12424 (limited to 'import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-12424') diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-12424 b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-12424 new file mode 100644 index 000000000..4d3e1e016 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-12424 @@ -0,0 +1,46 @@ +From 954e3d2e7113e9ac06632aee3c69b8d818cc8952 Mon Sep 17 00:00:00 2001 +From: Tomas Mraz +Date: Fri, 31 Mar 2017 16:25:06 +0200 +Subject: [PATCH] Fix buffer overflow if NULL line is present in db. + +If ptr->line == NULL for an entry, the first cycle will exit, +but the second one will happily write past entries buffer. +We actually do not want to exit the first cycle prematurely +on ptr->line == NULL. +Signed-off-by: Tomas Mraz + +CVE: CVE-2017-12424 +Upstream-Status: Backport +Signed-off-by: Chen Qi +--- + lib/commonio.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/lib/commonio.c b/lib/commonio.c +index b10da06..31edbaa 100644 +--- a/lib/commonio.c ++++ b/lib/commonio.c +@@ -751,16 +751,16 @@ commonio_sort (struct commonio_db *db, int (*cmp) (const void *, const void *)) + for (ptr = db->head; + (NULL != ptr) + #if KEEP_NIS_AT_END +- && (NULL != ptr->line) +- && ( ('+' != ptr->line[0]) +- && ('-' != ptr->line[0])) ++ && ((NULL == ptr->line) ++ || (('+' != ptr->line[0]) ++ && ('-' != ptr->line[0]))) + #endif + ; + ptr = ptr->next) { + n++; + } + #if KEEP_NIS_AT_END +- if ((NULL != ptr) && (NULL != ptr->line)) { ++ if (NULL != ptr) { + nis = ptr; + } + #endif +-- +2.1.0 + -- cgit v1.2.1