bugGNU dbm - Bugs: bug #506, Usage of undefined behaviour

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #506: Usage of undefined behaviour

Submitted by:  Lionel Debroux <debrouxl>
Submitted on:  Fri Apr 9 09:01:55 2021  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: Sergey Poznyakoff <gray>
Open/Closed: Closed

Fri Apr 23 10:20:01 2021, comment #3:

Hi Lionel,

Thanks for the reply. The tarball has been extremely helpful. I have installed the following patch:

https://git.gnu.org.ua/gdbm.git/commit/?id=72af65ca06eeec98266fce0c474d5bfbc3d91951

Please, give it a try.

Regarding missing notification: I have checked the logs and indeed it turned out the mail failed to pass through the mail gateway. This is partly due to the urgent maintenance done on the latter. I fixed the misconfiguration, so hopefully no more mails will be lost. Sorry for the inconvenience caused.

Sergey Poznyakoff <gray>
Project AdministratorIn charge of this item.
Thu Apr 22 16:14:34 2021, comment #2:

Oh. I didn't get a notification about your reply (I've just double-checked my inbox, trash bin and spam folders), so I missed it... and therefore, I missed the fact that this issue doesn't contain the tarball I had created before posting !
The most likely reason is probably that I forgot to upload it, though I seldom do that, but I'm going to stealthily pretend that the upload failed or that a pro-virus deleted the file - hopefully nobody notices my poor attempt at covering up :)

Sorry, anyhow :(

(file #403)

Lionel Debroux <debrouxl>
Fri Apr 9 14:17:25 2021, comment #1:

Thanks for reporting. Can you post a couple of db files that trigger such errors?

Sergey Poznyakoff <gray>
Project AdministratorIn charge of this item.
Fri Apr 9 09:01:55 2021, original submission:

Like most code bases, gdbm unwittingly uses undefined behaviour, as evidenced by e.g. building the project with AFL++ afl-clang-fast with AFL_USE_UBSAN=1 environment variable and fuzzing gdbmtool with afl-fuzz.
For debugging the issues, building with gcc or clang -fsanitize=undefined should do the job, no need to involve AFL++ or Honggfuzz :)

The set of commands is the same as some of my recent bug reports:
avail
cache
count
dir
header
current
first
next
status
recover
reorganize
fetch 1
delete 1
store 1 1
delete 1
bucket 1
quit

Fixing every kind of reported usage of undefined behaviour might arguably be lower priority than fixing memory errors reported by ASAN and MSAN instrumentation, hence the Normal severity.
I used a fuzzer instance running the MSAN-instrumented binary and an instance running the UBSAN-instrumented binary concurrently and cooperatively; MSAN instrumentation didn't find any UMRs in 6+h and 200+K execs, which is partially good news: at least the UMRs aren't easy to find, but the coverage is still very insufficient.

Lionel Debroux <debrouxl>

 

Attached Files
file #403:  gdbm_ubsan_crashes_20210408.tar.gz added by debrouxl (27kB - application/gzip - A bunch of DB files which trigger the usage of UB in gdbm)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gray (Posted a comment)
  • -unavailable- added by debrouxl (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    5 latest changes follow.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Sep 4 05:50:58 2021grayOpen/ClosedOpen=>Closed
    Fri Apr 23 10:20:01 2021grayStatusNeed Info=>Fixed
    Thu Apr 22 16:14:34 2021debrouxlAttached File-=>Added gdbm_ubsan_crashes_20210408.tar.gz, #403
    Fri Apr 9 14:17:25 2021grayStatusNone=>Need Info
      Assigned toNone=>gray
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray