bugPSPP - Bugs: bug #58598, Use after free in read in...

 
 

bug #58598: Use after free in read in dict_get_encoding

Submitter:  Andrea Fioraldi <andreafioraldi>
Submitted:  Wed 17 Jun 2020 08:46:52 AM UTC
   
 
Category:  Syntax Parser Severity:  5 - Average
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  None
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 17 Jun 2020 08:46:52 AM UTC, original submission:  

./pspp -O format=txt -o /dev/null -b uaf3


=================================================================
==121469==ERROR: AddressSanitizer: heap-use-after-free on address 0x612000000420 at pc 0x0000009dc963 bp 0x7fffffffd620 sp 0x7fffffffd618
READ of size 8 at 0x612000000420 thread T0
    #0 0x9dc962 in dict_get_encoding /home/andreaf/real/pspp/src/data/dictionary.c:101:13
    #1 0x53a303 in parse_fixed /home/andreaf/real/pspp/src/language/data-io/data-parser.c:521:33
    #2 0x53a303 in data_parser_parse /home/andreaf/real/pspp/src/language/data-io/data-parser.c:396:14
    #3 0x53efeb in data_parser_casereader_read /home/andreaf/real/pspp/src/language/data-io/data-parser.c:808:7
    #4 0x9a3a5b in casereader_read /home/andreaf/real/pspp/src/data/casereader.c:71:11
    #5 0xc860cd in buffer_case /home/andreaf/real/pspp/src/data/casereader-shim.c:88:9
    #6 0xc860cd in casereader_shim_read /home/andreaf/real/pspp/src/data/casereader-shim.c:111:10
    #7 0x9a837f in random_reader_read /home/andreaf/real/pspp/src/data/casereader.c:513:21
    #8 0x9a3a5b in casereader_read /home/andreaf/real/pspp/src/data/casereader.c:71:11
    #9 0x9da9e5 in proc_casereader_read /home/andreaf/real/pspp/src/data/dataset.c:522:11
    #10 0x9a3a5b in casereader_read /home/andreaf/real/pspp/src/data/casereader.c:71:11
    #11 0xc860cd in buffer_case /home/andreaf/real/pspp/src/data/casereader-shim.c:88:9
    #12 0xc860cd in casereader_shim_read /home/andreaf/real/pspp/src/data/casereader-shim.c:111:10
    #13 0x9a4fed in casereader_peek /home/andreaf/real/pspp/src/data/casereader.c:157:11
    #14 0x9a4fed in casereader_is_empty /home/andreaf/real/pspp/src/data/casereader.c:180:25
    #15 0x99238a in casegrouper_get_next_group /home/andreaf/real/pspp/src/data/casegrouper.c:115:16
    #16 0x6400ea in list_execute /home/andreaf/real/pspp/src/language/data-io/list.c:86:10
    #17 0x6400ea in cmd_list /home/andreaf/real/pspp/src/language/data-io/list.c:253:10
    #18 0x4d048b in do_parse_command /home/andreaf/real/pspp/src/language/command.c:233:16
    #19 0x4d048b in cmd_parse_in_state /home/andreaf/real/pspp/src/language/command.c:148:12
    #20 0x4c9df6 in main /home/andreaf/real/pspp/src/ui/terminal/main.c:138:20
    #21 0x7ffff61a5b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
    #22 0x421499 in _start (/home/andreaf/real/pspp/pspp_afl+0x421499)

0x612000000420 is located 224 bytes inside of 264-byte region [0x612000000340,0x612000000448)
freed by thread T0 here:
    #0 0x49995d in free (/home/andreaf/real/pspp/pspp_afl+0x49995d)
    #1 0x9e6331 in _dict_destroy /home/andreaf/real/pspp/src/data/dictionary.c:313:3
    #2 0x9e6331 in dict_unref /home/andreaf/real/pspp/src/data/dictionary.c:324:5

previously allocated by thread T0 here:
    #0 0x499bdd in malloc (/home/andreaf/real/pspp/pspp_afl+0x499bdd)
    #1 0xc8427b in xmalloc /home/andreaf/real/pspp/gl/xmalloc.c:41:13
    #2 0xc8427b in xzalloc /home/andreaf/real/pspp/gl/xmalloc.c:86:18
    #3 0x4d048b in do_parse_command /home/andreaf/real/pspp/src/language/command.c:233:16
    #4 0x4d048b in cmd_parse_in_state /home/andreaf/real/pspp/src/language/command.c:148:12
    #5 0x4c9df6 in main /home/andreaf/real/pspp/src/ui/terminal/main.c:138:20
    #6 0x7ffff61a5b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310

SUMMARY: AddressSanitizer: heap-use-after-free /home/andreaf/real/pspp/src/data/dictionary.c:101:13 in dict_get_encoding
Shadow bytes around the buggy address:
  0x0c247fff8030: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c247fff8040: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c247fff8050: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c247fff8060: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c247fff8070: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c247fff8080: fd fd fd fd[fd]fd fd fd fd fa fa fa fa fa fa fa
  0x0c247fff8090: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c247fff80a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c247fff80b0: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa
  0x0c247fff80c0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c247fff80d0: 00 00 00 00 00 00 00 00 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
  Shadow gap:              cc
==121469==ABORTING


Andrea Fioraldi <andreafioraldi>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #49293:  uaf3 added by andreafioraldi (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jmd (Updated the item)
  • -email is unavailable- added by andreafioraldi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-20 jmd StatusNone Fixed
        Open/ClosedOpen Closed
    2020-06-17 andreafioraldi Attached File- Added uaf3, #49293

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code