Commit Graph

6202 Commits

Author SHA1 Message Date
Neels Hofmeyr b3fa355321 vlr_gsupc_read_cb: fix use after free of GSUP msgb
osmo_gsup_decode() doesn't actually decode everything, it does leave quite a
number of pointers into the original msgb. Hence we must not deallocate the
gsup msgb before dispatching GSUP events.

Move msgb_free() to the bottom of vlr_gsupc_read_cb() and use rc and gotos to
early-exit if needed.

Change-Id: I16fc92dcf84e29fcf34712a2e8b0464ef08425ad
2017-11-20 13:49:32 +00:00
Neels Hofmeyr 1a5bcd5c3b sub_pres_vlr_fsm_start: fix heap use after free
When sub_pres_vlr_fsm_start() is called, it dispatches an event which may in
some cases already cause tear down and free of the parent FSM instance, after
which storing the returned instance pointer in that parent's metadata will use
freed memory. Instead, pass the target pointer to remember the instance at to
sub_pres_vlr_fsm_start() and assign the pointer *before* firing the event.

Explain so in a new comment.

I haven't checked whether that pointer is actually used at all -- this is the
easiest way to fix the use-after-free without getting sucked into semantic
questions.

Change-Id: Ibdc0b64cd12ba3e2b9737e3517d8484e67abcf04
2017-11-20 13:49:32 +00:00
Neels Hofmeyr c6bf27466c rate_ctr: don't use . as separator
Use ':' as separator, so that no mangled rate_ctr descriptions are allocated.

When '.' is used, the rate_ctr mangling code creates tallocs of mangled counter
descriptors, and hence affects the amount of expected talloc contexts in
msc_vlr_tests.c.

Change-Id: Ib1db8e3dc6c833174f1b0b1ca051b0861f477408
2017-11-20 13:49:32 +00:00
Philipp Maier e4db08a8b5 cosmetic: move log message to else branch
The log message after the nullpointer check for conn tricks Coverity
Scan into detecting a nullpointer deref.

Include the log message into else branch to state the program flow
more clearly

Fixes: Coverity CID#178656

Change-Id: If6e962f4033c955ecd3539a719031a83c9b6205a
2017-11-20 09:23:55 +00:00
Philipp Maier 8ae3c924ef reset: remove name variable from reset context
The reset context contains a string buffer to allow for setting
a human readable name, that is then displayed in the logs. Since
OSMO-FSMs already have such a feature there is no need for an
extra name variable.

Use LOGPFSML and the name parameter of osmo_fsm_inst_alloc()
to display the name of the FSM

Fixes: Coverity CID#178664

Change-Id: I5b051606791c5e085ca6bb1be20592127d48ceb5
2017-11-20 09:22:33 +00:00
Neels Hofmeyr 7cec38852a add --enable-sanitize config option
Change-Id: I6c0c91abc0d3fa737dbe3db1e6473358da64c2a5
2017-11-18 10:16:46 +00:00
Alexander Couzens f1521a14df debian/rules: remove doublicated project name in example files
For example:
/usr/share/doc/osmo-msc/examples/osmo-msc/osmo-msc.cfg -> /usr/share/doc/osmo-msc/examples/osmo-msc.cfg

Change-Id: I702cd963d5c3a2f4085ebce5e0dfa1a8a27ea89f
2017-11-16 00:12:45 +01:00
Harald Welte 0f2555e06f sms_route_mt_sms: Don't return uninitialized variable
Wen there's no SMPP support compiled in, and routing was successful,
we shouldn't return an uninitialized value.

Change-Id: I4abbbb5ab336a7e8da08d682f396baec3b56fa3a
Fixes: Coverity CID#174176
2017-11-14 15:09:18 +09:00
Neels Hofmeyr c698ab9a82 vlr: auth_fsm_start: check return value of fsm alloc
Fixes: coverity CID#178663
Change-Id: I7d1c15b546377b1afa38f7f40c5421b743e21605
2017-11-12 14:20:05 +00:00
Neels Hofmeyr 48ba1be752 examples: apply mgcp_client vty rename from 'mgcpgw' to 'mgw'
osmo-mgw.git is changing the mgcp_client_vty API to use 'mgw' instead of
'mgcpgw'. Fix example configs after that patch is merged.

Depends: I1d43d42929dc9162e57640499526fb7cadbcfbe6
Change-Id: Ib4c5ec1046a3c7a916ecfb7e5aa83dfe2f5ea8bf
2017-11-08 03:24:13 +00:00
Neels Hofmeyr 84ad185713 vty: skip installing cmds now always installed by default
vty_install_default() and install_default() will soon be deprecated.

Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: I34708c73d8084db4e6c83a39be8fdaeaa492d743
2017-11-01 00:51:21 +01:00
Neels Hofmeyr 0b8dec70a2 defaults: assign TMSI by default
When using ciphering, the TMSI is an important part of the ciphering. To guard
against users forgetting to set 'assign tmsi' in the config and compromising
their ciphering unknowingly, the default should be to use a TMSI.

To optimize in an unencrypted network, 'no assign tmsi' config can still switch
off TMSI use.

Change-Id: If115e95bebc314bedb50faf3993b52071fee5c1e
2017-10-31 02:02:44 +01:00
Neels Hofmeyr 26a3e2560d vty: drop deprecated 'logging level sms...'
No need to drag legacy VTY from osmo-nitb to osmo-msc.

Change-Id: I38ba8b9414de383bf497526d97bf7a039e41fd35
2017-10-31 02:02:44 +01:00
Neels Hofmeyr 97ce015f58 vty: make auth tuple reuse configurable
Change-Id: Iba6253d9bf8d4a9d9f6f26ba045e6c7f0dc7f8f2
2017-10-31 02:02:44 +01:00
Neels Hofmeyr 7b1418e6fc tests: add msc_vlr_test_authen_reuse
Change-Id: I185a2cbff6241a27722f1c37ae609f0fcc59a71e
2017-10-31 02:02:43 +01:00
Neels Hofmeyr 33f534136c cosmetic: vlr: rename auth_tuple_max_use_count to _reuse_
The name auth_tuple_max_use_count suggests that if I want to use each auth
tuple exactly once, I need to set it to 1. Curiously, so far you need to set
to intended uses - 1.

Reflect this in its name by renaming to auth_tuple_max_reuse_count.

I first considered to not rename but change the if-conditions so that == 1
means each tuple is used once, and upon struct vlr allocation, set the default
to 1. That would also logically entail that setting to 0 means to re-use
vectors infinitely often, like now a value < 0 does. That means, when
allocating a vlr struct zeroed out, we would by default have the most
dangerous/unsafe configuration. It's no problem to set a default to 1 upon
allocation, but by renaming the variable instead, we get safer alloc-zero
behavior and don't need to change any conditionals in the code (even though the
patch ends up considerably larger from all the renaming).

Change-Id: I0b036cae1536d5d6fb2304f837ed1a6c3713be55
2017-10-31 02:02:43 +01:00
Neels Hofmeyr 96748ca790 msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuilt
Before this, a code change in libvlr or libmsc would not cause a rebuild of the
tests.

You'd have thought 'AM_LDADD' were the right name for the variable, but
apparently it is just 'LDADD' instead. Tested that it works as intended.

Change-Id: Icbdedc1581fa23abe9ed99cef3918592b25f30b3
2017-10-30 08:45:15 +00:00
Harald Welte 9a5b4747ac Bump version: 1.1.1.2-633e5 → 1.1.2
Change-Id: Id3ddab71f98046c3ce26ea240313b0ffef8ddf09
2017-10-29 09:01:31 +01:00
Harald Welte 633e58a196 Debian: require minimum versions of packages we depend on
I'm using the dame version as in configure.ac to avoid build failures
against older versions of certain packages, such as older libsmpp34.

Change-Id: I83c617fa4e83e2e3d2613e454f517d6031814f21
2017-10-29 08:49:12 +01:00
Harald Welte 6a9d9baef5 Depend on both libosmo-sigtran-dev and libosmo-sccp-dev
libmsc/a_iface.c and libmsc/a_iface_bssap.c still include
osmocom/sccp/sccp_types.h to get access to enums defining SCCP
cause values.  Until that is resolved, we have to keep the build
dependency to libosmo-sccp-dev

Change-Id: I957dcb2bcce216d0fd81a58bfe869aca0e4624a8
Related: OS#2601
2017-10-28 23:53:23 +02:00
Harald Welte aaa858069a Bump version: 1.1.0.1-6299 → 1.1.1
Change-Id: I0143cbf462d8685bb7388024dddbc0eb9b3883dc
2017-10-28 19:58:11 +00:00
Harald Welte f45c34ddab Debian: Depend on libosmo-sigtran-dev, not libsomo-sccp-dev!
Change-Id: I478e28ba5f7e39cecea8912183e288ecb2f03337
2017-10-28 19:58:11 +00:00
Neels Hofmeyr 7f5ab9e0fa jenkins: use osmo-clean-workspace.sh before and after build
See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale.

Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93
Change-Id: I6ae80147b2624079b5c364dbce08194215cc4e95
2017-10-28 15:08:24 +00:00
Harald Welte 6a01568351 Tag/Release Version 1.1.0
[ Alexander Couzens ]
  * debian/rules: show testsuite.log when tests are failing

  [ Neels Hofmeyr ]
  * build: check for -lgsm
  * am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON vars
  * jenkins: fix build: osmo-mgw from master, not pre_release
  * jenkins: drop unused build matrix vars, always --enable-smpp
  * configure.ac: fix to "AC_INIT[osmo-msc]"
  * rewrite README
  * rename openbsc.pc to osmo-msc.pc
  * debian: fix web and VCS links, tweak osmo-msc.install
  * drop files unrelated to osmo-msc
  * rename include/openbsc to include/osmocom/msc
  * doc/examples: add detailed cs7 config examples
  * use separated libosmo-mgcp-client, apply rename to mgcp_client_*
  * ctrl: subscriber-list-active: list only attached subscribers
  * debian: fix dependency to mgcp library
  * main: remove cmdline args no longer available for osmo-msc
  * vty: fix: missing default cmds at hlr node
  * ctrl: remove unimplemented cmds subscriber-{modify,delete}
  * fix build: remove obsolete header legacy_mgcp/mgcp.h
  * fix debian: fix erratic doc/examples install path
  * fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free()
  * fix vty tests: long timeout due to unreachable STP address
  * cosmetic: vlr: declare a struct in .h; drop unused header
  * add ';' after OSMO_ASSERT()

  [ Philipp Maier ]
  * a_iface: fix memory leaks
  * a_iface: fix typo

  [ Max ]
  * Remove rest_octets.h
  * Remove SI-related code
  * Remove BTS-specific attributes
  * Remove unused osmo_bsc_rf.h header
  * Remove pkg-config file

  [ Harald Welte ]
  * Update .gitignore for post-nitb-split
  * remove further files and autotest/autoconf bits irrelevant to osmo-msc
  * Rename osmo_fsm to avoid illegal space in name + more meaningful name
  * Debian: remove obsolete Dependencies
  * configure.ac: Depend on latest tagged/released libosmo-* versions
  * Debian: Build with enabled SMPP support
  * osmo-msc: Don't link against libasn1c
  * Debian: Include systemd.service in package
  * Debian: include all (not just one) example config files

Change-Id: Ic24d937658e5b467c6643ae3cd54e5b6d9db3175
2017-10-28 15:17:53 +02:00
Harald Welte 9588450f92 Debian: Add proper description for packages.
Change-Id: I6cf4a6d84048e68abd7323387766acb674fd345c
2017-10-28 15:17:53 +02:00
Harald Welte e0c728fd39 Debian: include all (not just one) example config files
Change-Id: I19ac23898e9543081a1407da9af63ed643791d6e
2017-10-28 15:17:53 +02:00
Harald Welte fb60b57923 Debian: Include systemd.service in package
Change-Id: Iee768a0e812db782f3e23c5a1454e141eee08a74
2017-10-28 15:17:53 +02:00
Harald Welte 8f042b9000 osmo-msc: Don't link against libasn1c
osmo-msc doesn't use any API/symbols of libasn1c directlry.  Rather,
we use libosmo-ranap which in turn uses libasn1c.  Let the linker
work out that dependency.

This fixes the following dpkg-shlibdeps warning:

Change-Id: I2f840884d8f1cc542de1e26acd3d4215bd2fd899
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-msc/usr/bin/osmo-msc was not linked against libasn1c.so.0 (it uses none of the library's symbols)
2017-10-28 15:17:53 +02:00
Harald Welte bde463d781 Debian: Build with enabled SMPP support
Change-Id: Ibab5ede36cf329620a66b7811c43cc73c7135ecd
2017-10-28 15:17:53 +02:00
Harald Welte c44cf84853 configure.ac: Depend on latest tagged/released libosmo-* versions
This is the safe choice, as in absence of automatic testing we don't
know if we actually still build against the [sometimes] ancient
dependencies.  Would be great to automatize this, but until we have that,
better be safe.

Change-Id: Idf5cad1dc17a5136d00c970c326cdf3b7ee18e3c
2017-10-28 15:17:47 +02:00
Harald Welte 69c5ae0923 Debian: remove obsolete Dependencies
libgtp and c-ares are GRPS dependencies; we don't have GPRS in MSC

Change-Id: Ie7fb8a9417d9024e3da0e8547679f7b696c79a9f
2017-10-28 14:22:31 +02:00
Harald Welte 6556d3cb1d Rename osmo_fsm to avoid illegal space in name + more meaningful name
A FSM doesn't need "FSM" in its name, as it is obvious that it is a
FSM.  Also, having two that are called RESET is confusing, so let's
try to come up with better names.

Also, after Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 in
libosmocore, we now enforce that no FSM identifiers contain spaces
or other illegal characters.

Closes: OS#2593
Change-Id: I858a81b8a4e01b2e802e3159f2835e5ca515953d
2017-10-25 03:28:35 +02:00
Max 61cacb0aaa Remove pkg-config file
It's an artefact of split which is unused anyway.

Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269
2017-10-16 15:29:26 +02:00
Alexander Couzens ba692aecbd debian/rules: show testsuite.log when tests are failing
Change-Id: I588ed7c7766a2e71284c9c7a3f3ce5a48561fe7f
2017-10-11 08:13:26 +00:00
Neels Hofmeyr 0906a39425 add ';' after OSMO_ASSERT()
Currently, OSMO_ASSERT() is defined such that it ends in a semicolon, hence an
added ';' is redundant. However, the usual way this kind of macro should be
defined is

  #define OSMO_ASSERT(x) do { ... } while(0)

so that the compiler requires a trailing semicolon.

To prepare for such a change possibly coming up in libosmocore, add ';' to all
OSMO_ASSERT() users.

Change-Id: Ic79c8b8f98a7f3bef761751d55a7e6125cf2c46d
2017-10-05 15:33:06 +02:00
Neels Hofmeyr bffa684e1a cosmetic: vlr: declare a struct in .h; drop unused header
In vlr_core.h, "pre-declare" a struct used in function declaration.

In vlr_lu_fsm.c, gsup.h is not used, drop the #include.

Change-Id: I61d793c3001abbe6d381be1ae0bb350b07403e88
2017-10-04 11:14:39 +00:00
Neels Hofmeyr ca4875f133 fix vty tests: long timeout due to unreachable STP address
The doc/examples/osmo-msc SCCP config examples with 10.23.42.1 as asp ip-remote
cause >5 minutes timeout for each VTY config test being run before the VTY
becomes available. This hugely elongates the config tests, we didn't spot it
before because it does succeed after that timeout. Rather use link-local
addresses in order to immediately note the lack of connection and carry on with
the VTY config tests.

Related: OS#2333
Change-Id: I5ea4ef8a7e181bd3a38edf9c3b5d098f6ba65ee5
2017-10-04 11:14:15 +00:00
Neels Hofmeyr 834f94a2cb fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free()
Add required msgb_free() to vlr_gsupc_read_cb().

Adjust msc_vlr_tests.c gsup_rx() to *not* free the msgb again after
vlr_gsupc_read_cb() did.

Related: OS#2476
Change-Id: I347c53f57a7fa79921aed3f6e42599841acf27c0
2017-10-03 20:30:17 +00:00
Harald Welte 5c76e0aa1a remove further files and autotest/autoconf bits irrelevant to osmo-msc
Change-Id: I68e879e7474cbd3dd053f23bc4d5d22dc2748c5b
2017-10-03 09:44:23 +08:00
Harald Welte 4fad0edda6 Update .gitignore for post-nitb-split
Change-Id: I8bac4399a35b722908a4dc4d47c4962946ed52e9
2017-10-03 09:41:21 +08:00
Neels Hofmeyr 4e7ece0bd9 fix debian: fix erratic doc/examples install path
Change-Id: I8fc3d50b95649145e45ea6b56792ddbaf0548050
2017-09-25 15:52:04 +02:00
Neels Hofmeyr 6e0f7d145a fix build: remove obsolete header legacy_mgcp/mgcp.h
Since Ifb8f3fc2b399662a9dbba174e942352a1a21df3f libosmo-mgcp-client has its own
definitions in mgcp_common.h, which conflict with legacy_mgcp/mgcp.h. This
cross-inclusion to support libosmo-mgcp-client is no longer necessary.

In the future, including libosmo-mgcp-client together with libosmo-mgcp will be
made possible, but not with libosmo-legacy-mgcp (because we don't care enough).
That is why including libosmo-legacy-mgcp headers would cause build failure.

Depends: Ifb8f3fc2b399662a9dbba174e942352a1a21df3f
Change-Id: I8e3359bedf973077c0a038aa04f5371a00c48fa0
2017-09-24 19:52:25 +02:00
Neels Hofmeyr 165a7d7cc8 ctrl: remove unimplemented cmds subscriber-{modify,delete}
Change-Id: I754de5d08c053fea5f1ca2673b0ac4d26a85778a
2017-09-19 00:37:48 +02:00
Neels Hofmeyr 952a926441 vty: fix: missing default cmds at hlr node
Without this, it is impossible to exit the 'hlr' node.

Change-Id: I53e572194af39a431c54f83cd07e4c41c6fdf7f8
2017-09-19 00:15:53 +02:00
Neels Hofmeyr b323cd283b main: remove cmdline args no longer available for osmo-msc
Change-Id: I3009d2b3dd89eacdf6bc3d9c19744e9fdf4be6c3
2017-09-18 23:50:59 +02:00
Max a8b1aac5bc Remove unused osmo_bsc_rf.h header
Change-Id: I7a668665b571d00a6a34629626ddbfb60b6c09cc
2017-09-15 14:18:35 +02:00
Max e591d479dd Remove BTS-specific attributes
Remove *bts_model_* functions as they are only useful to BSC.

Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587
2017-09-15 14:15:52 +02:00
Max f953d8bbb2 Remove SI-related code
Get rid of unused data structures and functions related to SI handling.

Change-Id: I048885e85a9f97b8b071f3a3f1c362b54a44720e
2017-09-15 13:52:52 +02:00
Max 43b01b0514 Remove rest_octets.h
The MSC should not fiddle with low-level SI details like rest octets
anyway. Unfortunately simply removing the header is impossible as it
causes massive fallout due to missing includes. Fixed it as well.

The only other parameter which required removal is cell_ro_sel_par which
is not referenced anywhere in the code anyway.

Change-Id: Ibff77330de056fad4288cd4c48d016aad8105354
2017-09-15 11:31:03 +02:00
Neels Hofmeyr a81ee7c3b8 debian: fix dependency to mgcp library
osmo-mgw has split the MGCP client to a separate library in
change-id I8e0b2d2a399b77086a36606f5e427271c6242df1
or commit 97df691307e48c39170ac39b2394a7095d7f0ee5.

Change-Id: I9c56c218fce2264fe0acae62caed4d9ff4bfb54c
2017-09-14 03:29:33 +00:00