Project

General

Profile

Actions

Bug #11951

closed

smatch sometimes flags problems with ipmp_snap_take()

Added by Jason King over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

While building the fix for #11946, my build died with the following error:

/ws/illumos-gate/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/ipmp_query.c:1109 ipmp_snap_take() error: double free of 'snap'
/ws/illumos-gate/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/ipmp_query.c:1112 ipmp_snap_take() error: dereferencing freed memory 'snap'

Initalizing snap and osnap to NULL (despite it only mentioning 'snap', it required initializing both values to make the error disappear).

There are some known uninitialized bugs with smatch, and initializing the values to NULL is harmless, so that seems a reasonable workaround.


Related issues

Related to illumos gate - Bug #11956: smatch check_free false positiveNew

Actions
Actions #1

Updated by Jason King over 1 year ago

  • Related to Bug #11956: smatch check_free false positive added
Actions #2

Updated by Electric Monk over 1 year ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit ad234cdc80febfeac2ea24977ab7cf9a7cc466ba

commit  ad234cdc80febfeac2ea24977ab7cf9a7cc466ba
Author: Jason King <jason.king@joyent.com>
Date:   2019-11-11T19:03:09.000Z

    11951 smatch sometimes flags problems with ipmp_snap_take()
    Reviewed by: Andrew Stormont <astormont@racktopsystems.com>
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF