Source: nasm
Version: 2.13.02-0.1
Severity: important
Tags: security upstream
Forwarded: https://bugzilla.nasm.us/show_bug.cgi?id=3392445

Hi,

The following vulnerability was published for nasm:

CVE-2018-8882[0]:
| Netwide Assembler (NASM) 2.13.02rc2 has a stack-based buffer under-read
| in the function ieee_shr in asm/float.c via a large shift value.

The issue is verifiable with an ASAN build of nasm.

----cut---------cut---------cut---------cut---------cut---------cut-----
$ nasm -felf64  411616
411616:16: error: comma, colon, decorator or end of line expected after operand
411616:21: error: parser: instruction expected
411616:30: error: label or instruction expected at start of line
411616:33: error: comma, colon, decorator or end of line expected after operand
411616:34: error: comma, colon, decorator or end of line expected after operand
411616:39: error: comma, colon, decorator or end of line expected after operand
=================================================================
==5602==ERROR: AddressSanitizer: stack-buffer-overflow on address 
0x7ffdc0250564 at pc 0x559c536f0418 bp 0x7ffdc0250420 sp 0x7ffdc0250418
READ of size 4 at 0x7ffdc0250564 thread T0
    #0 0x559c536f0417  (/usr/bin/nasm+0x330417)
    #1 0x559c536f3fbc  (/usr/bin/nasm+0x333fbc)
    #2 0x559c53624394  (/usr/bin/nasm+0x264394)
    #3 0x559c535f0c43  (/usr/bin/nasm+0x230c43)
    #4 0x559c535e9bbe  (/usr/bin/nasm+0x229bbe)
    #5 0x7f37551a3a86 in __libc_start_main 
(/lib/x86_64-linux-gnu/libc.so.6+0x21a86)
    #6 0x559c535eba39  (/usr/bin/nasm+0x22ba39)

Address 0x7ffdc0250564 is located in stack of thread T0 at offset 84 in frame
    #0 0x559c536f2ecf  (/usr/bin/nasm+0x332ecf)

  This frame has 2 object(s):
    [32, 36) 'exponent'
    [96, 120) 'mant' <== Memory access at offset 84 underflows this variable
HINT: this may be a false positive if your program uses some custom stack 
unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow (/usr/bin/nasm+0x330417)
Shadow bytes around the buggy address:
  0x100038042050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100038042060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100038042070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100038042080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100038042090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x1000380420a0: 00 00 f1 f1 f1 f1 04 f2 f2 f2 f2 f2[f2]f2 00 00
  0x1000380420b0: 00 f2 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000380420c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000380420d0: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
  0x1000380420e0: 02 f2 f2 f2 f2 f2 f2 f2 00 00 f2 f2 f2 f2 f2 f2
  0x1000380420f0: f8 f8 f8 f8 f2 f2 f2 f2 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==5602==ABORTING
----cut---------cut---------cut---------cut---------cut---------cut-----

If you fix the vulnerability please also make sure to include the
CVE (Common Vulnerabilities & Exposures) id in your changelog entry.

For further information see:

[0] https://security-tracker.debian.org/tracker/CVE-2018-8882
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-8882
[1] https://bugzilla.nasm.us/show_bug.cgi?id=3392445

Please adjust the affected versions in the BTS as needed.

Regards,
Salvatore

Reply via email to