Bug 1117001 - (CVE-2018-19416) VUL-1: CVE-2018-19416: sysstat: the remap_struct function in sa_common.c has an out-of-bounds read during a memmove call
(CVE-2018-19416)
VUL-1: CVE-2018-19416: sysstat: the remap_struct function in sa_common.c has ...
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P4 - Low : Minor
: ---
Assigned To: Security Team bot
Security Team bot
https://smash.suse.de/issue/219557/
CVSSv3:RedHat:CVE-2018-19416:4.7:(AV:...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-11-22 09:08 UTC by Robert Frohl
Modified: 2019-10-28 07:52 UTC (History)
2 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
QA Reproducer (492 bytes, application/octet-stream)
2018-11-22 09:59 UTC, Robert Frohl
Details
Backported patch for version 12.0.2 (11.24 KB, patch)
2018-11-27 12:25 UTC, Pedro Monreal Gonzalez
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Frohl 2018-11-22 09:08:19 UTC
CVE-2018-19416

An issue was discovered in sysstat 12.1.1. The remap_struct function in
sa_common.c has an out-of-bounds read during a memmove call, as demonstrated by
sadf.

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19416
http://www.cvedetails.com/cve/CVE-2018-19416/
https://github.com/sysstat/sysstat/issues/196
Comment 1 Robert Frohl 2018-11-22 09:57:08 UTC
Hi Pedro,
my investigation suggests that the problematic function is present since version 11.7.1. Which would mean that these codesttreams are affected:
- SUSE:SLE-15:Update/sysstat
- SUSE:SLE-12:Update/sysstat

As there is currently no patch it is hard to be a 100% correct.
Comment 2 Robert Frohl 2018-11-22 09:59:27 UTC
Created attachment 790570 [details]
QA Reproducer

$ sadf stack_oob
Segmentation fault (core dumped)

$ md5sum stack_oob
d79f6e724a12aef1fb372e789c5f8b7b  stack_oob
Comment 3 Pedro Monreal Gonzalez 2018-11-22 16:34:22 UTC
Thanks, Robert. This is one of those cases that doesn't crash in gdb, a heisenbug. It looks like a memory mismatch between source and destination in memmove. Here is the output from Valgrind:

==27103== Invalid read of size 8
==27103==    at 0x4037050: memmove (vg_replace_strmem.c:1258)
==27103==    by 0x1411E6: UnknownInlinedFun (string_fortified.h:40)
==27103==    by 0x1411E6: remap_struct (sa_common.c:1297)
==27103==    by 0x141375: read_record_hdr (sa_common.c:1415)
==27103==    by 0x10D3B5: read_next_sample (sadf.c:234)
==27103==    by 0x10EC8D: logic2_display_loop (sadf.c:1163)
==27103==    by 0x10F5CC: read_stats_from_file (sadf.c:1422)
==27103==    by 0x10C670: main (sadf.c:1789)
==27103==  Address 0x20feffeef0 is not stack'd, malloc'd or (recently) free'd
Segmentation fault (core dumped)
Comment 4 Pedro Monreal Gonzalez 2018-11-26 14:56:05 UTC
Seems to be fixed in: https://github.com/sysstat/sysstat/commit/fbc691eaaa10d0bcea6741d5a223dc3906106548
Comment 5 Pedro Monreal Gonzalez 2018-11-27 12:25:16 UTC
Created attachment 790988 [details]
Backported patch for version 12.0.2

Same patch for SLE-15 and SLE-12. The rest of the codestreams are not affected.
Comment 6 Pedro Monreal Gonzalez 2018-11-27 12:28:49 UTC
Tested in polio:

Before:
Segmentation fault (core dumped)

After:
End of system activity file unexpected
Comment 9 Swamp Workflow Management 2019-03-29 17:11:45 UTC
SUSE-SU-2019:0806-1: An update that fixes two vulnerabilities is now available.

Category: security (low)
Bug References: 1117001,1117260
CVE References: CVE-2018-19416,CVE-2018-19517
Sources used:
SUSE Linux Enterprise Module for Server Applications 15 (src):    sysstat-12.0.2-3.6.12
SUSE Linux Enterprise Module for Basesystem 15 (src):    sysstat-12.0.2-3.6.12

*** NOTE: This information is not intended to be used for external
    communication, because this may only be a partial fix.
    If you have questions please reach out to maintenance coordination.
Comment 10 Swamp Workflow Management 2019-04-08 13:09:51 UTC
openSUSE-SU-2019:1176-1: An update that fixes two vulnerabilities is now available.

Category: security (low)
Bug References: 1117001,1117260
CVE References: CVE-2018-19416,CVE-2018-19517
Sources used:
openSUSE Leap 15.0 (src):    sysstat-12.0.2-lp150.7.1

*** NOTE: This information is not intended to be used for external
    communication, because this may only be a partial fix.
    If you have questions please reach out to maintenance coordination.
Comment 11 Swamp Workflow Management 2019-05-23 22:11:02 UTC
SUSE-SU-2019:1326-1: An update that fixes two vulnerabilities is now available.

Category: security (low)
Bug References: 1117001,1117260
CVE References: CVE-2018-19416,CVE-2018-19517
Sources used:
SUSE Linux Enterprise Server 12-SP4 (src):    sysstat-12.0.2-10.18.1
SUSE Linux Enterprise Server 12-SP3 (src):    sysstat-12.0.2-10.18.1
SUSE Linux Enterprise Desktop 12-SP4 (src):    sysstat-12.0.2-10.18.1
SUSE Linux Enterprise Desktop 12-SP3 (src):    sysstat-12.0.2-10.18.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 13 Marcus Meissner 2019-10-28 07:52:15 UTC
released