libosmocore.git branch neels/sanitize created. 0.10.2-23-gaa0b97fa

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-commitlog@lists.osmocom.org/.

gitosis at osmocom.org gitosis at osmocom.org
Thu Nov 16 23:23:11 UTC 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "An utility library for Open Source Mobile Communications".

The branch, neels/sanitize has been created
        at  aa0b97fa090730e73d2b39630ca7103380078077 (commit)

- Log -----------------------------------------------------------------
http://cgit.osmocom.org/libosmocore/commit/?id=aa0b97fa090730e73d2b39630ca7103380078077

commit aa0b97fa090730e73d2b39630ca7103380078077
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Fri Nov 17 00:15:44 2017 +0100

    sercomm_test: sanitizer: fix msgb mem leak
    
    This should fix the last current remaining sanitizer build failure in
    libosmocore regression tests.
    
    Change-Id: I4d6dd7f4348675bc77d4df5a7a0ce41f12d4a043

http://cgit.osmocom.org/libosmocore/commit/?id=f3f44735ad0efc05b7128d8dac8ba3d28c2cf77e

commit f3f44735ad0efc05b7128d8dac8ba3d28c2cf77e
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 23:34:33 2017 +0100

    sanitizer: tlv_put: guard against NULL val and 0 len
    
    For example encode_auth_info() from gsup.c calls
      msgb_tlv_put(msg, iei, 0, NULL)
    to put a tag and len with content data following later.
    
    However, this would cause a memcpy() from a NULL pointer, in tlv_put(). Allow
    passing NULL and len = 0 for cases like the above:
    
    If val is NULL, use memset(0) instead of memcpy().
    If len is zero, do not copy nor memset anything.
    
    Hence make tlv_put() behave in a well-defined and valid way for any and all
    input args; no negative fallout is possible from this patch.
    
    Add proper API doc comment.
    
    Fixes a sanitizer build failure in gsup_test:
    
      ../../../../src/libosmocore/include/osmocom/gsm/tlv.h:99:2: runtime error: null pointer passed as argument 2, which is declared to never be null
    
    Change-Id: I13dce9cd1228817890d3e81edeeb660c893c1d64

http://cgit.osmocom.org/libosmocore/commit/?id=167b3bcd7bcbc2f0d228b55068b71a2f11699bd8

commit 167b3bcd7bcbc2f0d228b55068b71a2f11699bd8
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 22:31:57 2017 +0100

    bssgp_fc_test: fix sanitizer build: free fc struct when done
    
    Change-Id: I0ef95ee8185a4789f0732b9420243dda5104d181

http://cgit.osmocom.org/libosmocore/commit/?id=51bdbc4b9a2d27755d2ecd0eaabdd65e8d1ca36d

commit 51bdbc4b9a2d27755d2ecd0eaabdd65e8d1ca36d
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 22:32:36 2017 +0100

    gprs_bssgp: bssgp_fc_in(): fix mem leak on queue overflow
    
    All successful and all error code paths of bssgp_fc_in() free the msgb, except
    the code path calling fc_enqueue() when the msg is dropped (due to queue being
    full, or failure to allocate).
    
    Callers could theoretically catch the -ENOSPC return value and discard the
    msgb. However, in other code paths, a callback's return value is returned,
    which is expected to free the msgb, so such callback would have to never return
    -ENOSPC when it freed the msgb. Much simpler semantics would be to free the
    msgb in every code path, no matter which kind of error occurred.
    
    Who is currently calling bssgp_fc_in and how do they handle the return value?
    - bssgp_fc_test.c ignores the return value (and hits a mem leak aka sanitizer
      build failure if the queue is full).
    - fc_timer_cb() ignores the return value.
    - bssgp_tx_dl_ud() returns the bssgp_fc_in() rc.
      - which is returned by a cascade of functions leading up to being returned,
        for example, by gprs_llgmm_reset(), which is usually called with ignored
        return code.
    At this point it is already fairly clear that bssgp_fc_in() should always free
    the msgb, since the callers don't seem to distinguish even between error or
    success, let alone between -ENOSPC or other errors.
    
    bssgp_fc_test: assert that no msgbs remain unfreed after the tests.
    Adjust expected results.
    
    Helps to fix the sanitizer build of bssgp_fc_test by eliminating the mem leak.
    
    Change-Id: I00c62a104baeaad6a85883c380259c469aebf0df

http://cgit.osmocom.org/libosmocore/commit/?id=67f1e6e6e63c249009fb2a1173cb9e3d3f57e5d4

commit 67f1e6e6e63c249009fb2a1173cb9e3d3f57e5d4
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 22:32:36 2017 +0100

    bssgp_fc_test: partly fix sanitizer build: free msgb context when done
    
    Print remaining msgbs when done, then free the entire tall_msgb_context. To be
    able to do that, call msgb_talloc_ctx_init() and use its return value.
    
    A subsequent patch will fix a known mem leak and add assertions for 0b in 1
    blocks remaining in the tall_msgb_context.
    
    Change-Id: I67d347ab2642b0bfc27b21b44231a7f3146ff641

http://cgit.osmocom.org/libosmocore/commit/?id=77aa9ca1e211e6d9f20dd068af963b43c5f523b0

commit 77aa9ca1e211e6d9f20dd068af963b43c5f523b0
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 22:55:02 2017 +0100

    bssgp_fc_test: clarify by outputting ok / failure messages
    
    The test fills up the queue / sends too large PDUs on purpose. Make that
    obvious by outputting returned errors in the expected output.
    
    Cosmetic:
    - fc_in()'s return value is ignored, hence don't return anything.
    - add comment.
    
    Change-Id: I57d6fce2515a65f6dd037e75af5397079215cb46

http://cgit.osmocom.org/libosmocore/commit/?id=ee1e3f4892d9b483faf75a88c15c2c8ce64924ca

commit ee1e3f4892d9b483faf75a88c15c2c8ce64924ca
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 22:29:38 2017 +0100

    bssgp_fc_test: remove rounding to deciseconds
    
    Ever since this test was changed to use osmo_gettimeofday_override, the times
    it sees are exact every time and don't need rounding to pass the expected
    output.
    
    Change-Id: I4a9a5d31fc02eb55caf7ba9c141426d8115bb740

http://cgit.osmocom.org/libosmocore/commit/?id=ee0676a258ccc46cad6b9601e5e1f119791a8d2d

commit ee0676a258ccc46cad6b9601e5e1f119791a8d2d
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 18:31:57 2017 +0100

    rate_ctr_group_alloc: use ctx; adjust stats_test
    
    Using the NULL context creates mem leaks that bother sanitizer builds.
    Allocating from the rate counter context allows cleaning up at the end of
    stats_test.
    
    Remove the comment concerning osmo-msc: one way to fix if the talloc becomes
    unexpected from this patch is to adjust the talloc expectations, another
    (preferred) way is to have no invalid rate counter names in osmo-msc.
    
    Change-Id: Ief9abfeb78b7706200bcc6aaa5dcb04fbeaa9b5b

http://cgit.osmocom.org/libosmocore/commit/?id=0d012e5e2b244d15e320af708ca9da01e60baddf

commit 0d012e5e2b244d15e320af708ca9da01e60baddf
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 18:26:21 2017 +0100

    stats_test: clarify talloc contexts
    
    Change-Id: I0eda27cd3e322fb43a825382b37185048ebcd509

http://cgit.osmocom.org/libosmocore/commit/?id=7edacb93eb16c328dc200bb2306087b2ab9d0594

commit 7edacb93eb16c328dc200bb2306087b2ab9d0594
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 18:23:52 2017 +0100

    rate_ctr: doc: explain intentional "mem leak" for mangled group names
    
    Change-Id: I35363c4c1fa0d62fd7fed40fe689487244248a3f

http://cgit.osmocom.org/libosmocore/commit/?id=58ba554283093cfaa44135927008a8bab526264c

commit 58ba554283093cfaa44135927008a8bab526264c
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 17:34:07 2017 +0100

    gsm0808_test: fix memleak
    
    Change-Id: I0097d63bbb4e7ee20eb4a8474f4fef32d39e625f

http://cgit.osmocom.org/libosmocore/commit/?id=997403ea6ba40b1f5c32e19a9d1ed84d2a981b14

commit 997403ea6ba40b1f5c32e19a9d1ed84d2a981b14
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 17:30:44 2017 +0100

    gsm0408_test: fix sanitized build
    
    Remove initial msgb talloc context creation: if we create a root ctx for msgb
    that all msgb are allocated in, we would in a final cleanup discard all msgbs,
    i.e. we would not verify that all msgb are cleaned up properly.
    
    If we create the msgb context and *don't* clean it up in the end, the sanitizer
    build fails because the context root is not cleaned up.
    
    Easiest is to actually allocate all msgb at NULL ctx, because then any msgb
    that aren't cleaned up properly would still linger, while we don't leave a root
    ctx that we need to clean up either.
    
    Change-Id: I1f2d1d05c75bbf4d92787f9735083f18cdc90f6f

http://cgit.osmocom.org/libosmocore/commit/?id=0c8e11de8d889b2d116ccca700238a727d7b3fdf

commit 0c8e11de8d889b2d116ccca700238a727d7b3fdf
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 16:25:08 2017 +0100

    lapd_test: fix msgb memleaks
    
    Change-Id: I0add9eac7225db23bc02fc2aaee5f42258d34e25

http://cgit.osmocom.org/libosmocore/commit/?id=d250cfcb60f1e9bf21cb981ce07ef97b223ac184

commit d250cfcb60f1e9bf21cb981ce07ef97b223ac184
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 16:24:36 2017 +0100

    abis_test: test_sw_descr: fix msgb memleak
    
    Change-Id: I69750d9cd2b8f30bfc6d2dfd9e62576e46989fab

http://cgit.osmocom.org/libosmocore/commit/?id=f9781a87c6c131f6a20990986557ae4452c555f4

commit f9781a87c6c131f6a20990986557ae4452c555f4
Author: Neels Hofmeyr <neels at hofmeyr.de>
Date:   Thu Nov 16 16:24:04 2017 +0100

    memleak: osmo_config_list_parse: getline() needs free also on error
    
    Change-Id: Iddf0a6cc733cd81d5f6c1eb62fc079ad319db119

-----------------------------------------------------------------------


hooks/post-receive
-- 
An utility library for Open Source Mobile Communications



More information about the osmocom-commitlog mailing list