osmo-msc/src/libmsc
Neels Hofmeyr 2fd69e15d3 fix VLR evil twin on LU with unknown TMSI
When a subscriber first attaches by TMSI only, and later tells the IMSI
via ID Response, it may turn out that this IMSI already exists in the
VLR database. If this happens, the TMSI that the subscriber issued was
not known in the existing VLR entry, indicating that the subscriber has
in the meantime camped on a different core. Which means we can assume
that there cannot be any active connections, and the old subscriber can
be discarded, for the benefit of the new one.

(We could also discard the new one, but it is more complex to reparent
the ongoing FSMs for Compl L3 than to copy some dormant VLR state.)

In vlr_subscr_set_imsi(), check for an existing IMSI entry in the VLR.

If such exists, copy any pending Paging and auth tuple state to the new
subscriber, and discard the old one from the VLR.

In order to safely discard a vlr subscriber by force, add a new vlr_ops
function: subscr_inval(), to tell the MSC that a vlr_subscr is no longer
valid.

Upcoming patch I583682d1a35a70b008d7bb2d89ba7c3109a60b21 better clears
TMSI state from the VLR, making it more likely to hit the evil twin
situation this patch fixes; hence this is, sort of, preparation.

Related: SYS#6860 OS#4721
Change-Id: Ifdabe0b65bffafbf7b8e5cc10e2d225d1ed1cecd
2024-03-28 04:06:58 +01:00
..
Makefile.am ASCI: Add VTY to configure GCR (Group Call Register) 2023-07-21 12:28:03 +02:00
asci_gcr.c ASCI: Add simple implementation of Group Call Register 2023-07-17 12:29:42 +00:00
asci_vty.c ASCI: Add VTY to configure GCR (Group Call Register) 2023-07-21 12:28:03 +02:00
call_leg.c Fix license headers: Should have been AGPLv3+, not GPLv2+ 2024-02-19 20:49:43 +00:00
cell_id_list.c Fix license headers: Should have been AGPLv3+, not GPLv2+ 2024-02-19 20:49:43 +00:00
codec_filter.c implement re-assignment to match codecs 2023-12-13 01:52:22 +00:00
codec_mapping.c cosmetic: rename to sdp_audio_codecs_foreach() 2024-02-08 23:42:17 +01:00
csd_bs.c csd_bs: force rate adaptation mode for CSD calls to V.110 2023-10-17 11:25:59 +00:00
csd_filter.c Add initial CSD support with external MNCC 2023-06-20 12:47:05 +02:00
ctrl_commands.c vlr_subscr: use osmo_use_count 2019-04-12 02:15:25 +02:00
db.c Turn off secure_delete in sqlite 2022-07-08 00:44:52 +01:00
e_link.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
gsm_04_08.c fix VLR evil twin on LU with unknown TMSI 2024-03-28 04:06:58 +01:00
gsm_04_08_cc.c Add LLC and HLC information forwarding to MNCC interface 2024-01-24 08:50:12 +00:00
gsm_04_11.c SMS over GSUP: correctly route GSUP responses to MT SMS 2023-09-25 05:13:49 +00:00
gsm_04_11_gsup.c SMS-over-GSUP: set Source Name IE for *all* messages 2024-01-09 22:26:43 +07:00
gsm_04_14.c gsm_04_14: fix off-by-one error in create_gsm0414_msg() 2020-07-29 05:28:54 +07:00
gsm_04_80.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
gsm_09_11.c ASCI: Add transaction type to trans_find_by_callref() 2023-07-09 07:41:33 +00:00
gsup_client_mux.c Fix license headers: Should have been AGPLv3+, not GPLv2+ 2024-02-19 20:49:43 +00:00
mncc.c mncc: cosmetic: fix coding style in mncc_prim_check_sign() 2022-10-03 16:20:05 +07:00
mncc_builtin.c libmsc: add 3k1_AUDIO and FAX_G3 bearer cap 2023-10-14 17:23:04 +02:00
mncc_call.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
mncc_sock.c Fix license headers: Should have been AGPLv3+, not GPLv2+ 2024-02-19 20:49:43 +00:00
msc_a.c invalidate vsub->msc_conn_ref when msc_a is discarded 2024-03-26 03:20:00 +01:00
msc_a_remote.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
msc_ho.c Fix license headers: Should have been AGPLv3+, not GPLv2+ 2024-02-19 20:49:43 +00:00
msc_i.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
msc_i_remote.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
msc_net_init.c GSUP: set default ipa-name at application level 2023-12-18 03:46:11 +00:00
msc_t.c ASCI: Use a unique call-id for RTP streams 2023-07-09 07:41:33 +00:00
msc_t_remote.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
msc_vgcs.c ASCI: Remove debug line, used during development process 2024-01-24 08:50:12 +00:00
msc_vty.c VTY: always print MNCC handler type (internal/external) 2024-01-06 18:35:38 +00:00
msub.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
neighbor_ident.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
neighbor_ident_vty.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
paging.c fix VLR evil twin on LU with unknown TMSI 2024-03-28 04:06:58 +01:00
ran_conn.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
ran_infra.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
ran_msg.c Fix license headers: Should have been AGPLv3+, not GPLv2+ 2024-02-19 20:49:43 +00:00
ran_msg_a.c Fix license headers: Should have been AGPLv3+, not GPLv2+ 2024-02-19 20:49:43 +00:00
ran_msg_iu.c Fix license headers: Should have been AGPLv3+, not GPLv2+ 2024-02-19 20:49:43 +00:00
ran_peer.c ASCI: Clear VGCS call and channel on BSSMAP reset message 2023-07-21 12:28:06 +02:00
rrlp.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
rtp_stream.c cosmetic: rename to sdp_audio_codecs_foreach() 2024-02-08 23:42:17 +01:00
sccp_ran.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
sdp_msg.c cosmetic: rename to sdp_audio_codecs_foreach() 2024-02-08 23:42:17 +01:00
sgs_iface.c libmsc: fix -Wenum-conversion in subscr_conn_toss() 2024-03-01 07:11:47 +00:00
sgs_server.c libmsc/sgs_server.c: do not override rc in case of SCTP_SHUTDOWN_EVENT 2019-05-13 20:15:04 +00:00
sgs_vty.c libmsc: fix: properly initialize the SGs server 2019-03-28 17:10:11 +07:00
silent_call.c silent_call: check return value of trans_alloc() against NULL 2023-12-12 22:34:22 +07:00
sms_queue.c sms: Introduce VTY-configurable minimum SMS validity period 2022-05-19 19:34:41 +00:00
smsc_vty.c copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH 2023-05-18 17:22:26 +07:00
transaction.c Cosmetic: fix typo 2023-08-23 16:42:24 +02:00
transaction_cc.c report caller's file,line in trans_cc_filter_run() 2024-02-08 23:42:17 +01:00