osmo-msc/src/libmsc
Vadim Yanitskiy a79aac0113 libmsc/gsm_04_08.c: fix: verify MI before calling vlr_subscr_rx_id_resp()
During the last congress, we have noticed that OsmoMSC crashes
on receipt of malformed MM Identity Response messages:

  BSSAP
      Message Type: Direct Transfer (0x01)
      Data Link Connection Identifier
          00.. .... = Control Channel: not further specified (0x0)
          ..00 0... = Spare: 0x0
          .... .000 = SAPI: RR/MM/CC (0x0)
      Length: 11
  GSM A-I/F DTAP - Identity Response
      Protocol Discriminator: Mobility Management messages (5)
          .... 0101 = Protocol discriminator: Mobility Management messages (0x5)
          0000 .... = Skip Indicator: No indication of selected PLMN (0)
      01.. .... = Sequence number: 1
      ..01 1001 = DTAP Mobility Management Message Type: Identity Response (0x19)
      Mobile Identity - Format Unknown
          Length: 8
          .... 1... = Odd/even indication: Odd number of identity digits
          .... .111 = Mobile Identity Type: Unknown (7)  <-- This makes OsmoMSC crash
              [Expert Info (Warning/Protocol): Unknown format 7]
                  [Unknown format 7]
                  [Severity level: Warning]
                  [Group: Protocol]

The value '111'B is not a valid Mobile Identity type, and shall be
considered as reserved according to 3GPP TS 24.008, section 10.5.1.4.
Later on it was discovered that '000'B also crashes OsmoMSC in the same way.

The crash itself is provoked by OSMO_ASSERT(0) in vlr_subscr_rx_id_resp().
Let's keep that assert in there, and make sure that:

  - on receipt of MM Identity Response, Mobile Identity type
    matches the one in MM Identity Request;

  - on receipt of RR Ciphering Mode Complete, Mobile Identity
    contains IMEI(SV) if present.

Change-Id: Ica4c90b8eb4d90325313c6eb400fa4a6bc5df825
TTCN-3 test case: I62f23355eb91df2edf9dc837c928cb86b530b743
Fixes: OS#4340
2020-01-05 11:23:09 +00:00
..
Makefile.am add sdp_msg API: SDP parsing/composition 2019-11-28 02:52:55 +01:00
call_leg.c use osmo_sockaddr_str_is_nonzero() 2019-11-01 17:35:17 +01:00
cell_id_list.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
ctrl_commands.c vlr_subscr: use osmo_use_count 2019-04-12 02:15:25 +02:00
db.c sms db: when storing an SMS, retrieve the ID 2019-12-12 15:46:41 +00:00
e_link.c GSUP: include terminating nul in inter-MSC source/destination name 2019-05-08 17:02:32 +02:00
gsm_04_08.c libmsc/gsm_04_08.c: fix: verify MI before calling vlr_subscr_rx_id_resp() 2020-01-05 11:23:09 +00:00
gsm_04_08_cc.c fix incoming call while Paging 2019-11-28 02:52:55 +01:00
gsm_04_11.c libmsc/gsm_04_11.c: do not abuse LOG_TRANS() in gsm411_alloc_mt_trans() 2019-06-20 16:54:45 +00:00
gsm_04_11_gsup.c libmsc/gsm_04_11_gsup.c: fix SM-RP-OA encoding for MO SMS over GSUP 2019-12-19 22:12:18 +09:00
gsm_04_14.c rename bscconfig.h to config.h, cleanup 2019-05-08 17:02:32 +02: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 Fix some typos 2019-11-19 01:04:34 +00:00
gsup_client_mux.c gsup_client_mux_tx_error_reply(): fix: do not omit SM-RP-MR IE 2019-06-15 13:13:50 +07:00
mncc.c MNCC v6: add optional SDP to the socket protocol 2019-11-28 02:52:55 +01:00
mncc_builtin.c libmsc/mncc_builtin.c: drop dummy switch in int_mncc_recv() 2019-06-14 22:58:33 +07:00
mncc_call.c Check for osmo_fsm_register() error return value 2019-12-01 15:32:09 +01:00
mncc_sock.c Fix some typos 2019-11-19 01:04:34 +00:00
msc_a.c msc_a CC: add some basic sanity tests 2019-11-28 02:46:05 +01:00
msc_a_remote.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
msc_ho.c libmsc: fix potential NULL-pointer dereferences detected by GCC's LTO 2019-12-02 08:44:53 +00:00
msc_i.c call_leg: remove unused event MSC_EV_CALL_LEG_RTP_RELEASED 2019-05-10 07:13:41 +00:00
msc_i_remote.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
msc_net_init.c add 'encryption uea 1 2' cfg / fix ttcn3 iu tests 2019-08-13 23:52:31 +02:00
msc_t.c use osmo_sockaddr_str_is_nonzero() 2019-11-01 17:35:17 +01:00
msc_t_remote.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
msc_vty.c libmsc: fix potential NULL-pointer dereferences detected by GCC's LTO 2019-12-02 08:44:53 +00:00
msub.c msub_check_for_release(): Initialize msc_role_a_c 2019-05-09 08:42:48 +00:00
neighbor_ident.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
neighbor_ident_vty.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
paging.c paging: Send SGsAP-SERVICE-ABORT-REQUEST on paging timeout 2019-09-26 19:23:54 +00:00
ran_conn.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
ran_infra.c rename bscconfig.h to config.h, cleanup 2019-05-08 17:02:32 +02:00
ran_msg.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
ran_msg_a.c Fix some typos 2019-11-19 01:04:34 +00:00
ran_msg_iu.c log: RANAP encode: use RANAP message names instead of BSSAP 2019-10-29 16:46:32 +01:00
ran_peer.c Fix some typos 2019-11-19 01:04:34 +00:00
ran_up_l2.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
rrlp.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
rtp_stream.c use osmo_sockaddr_str_is_nonzero() 2019-11-01 17:35:17 +01:00
sccp_ran.c large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
sdp_msg.c add sdp_msg API: SDP parsing/composition 2019-11-28 02:52:55 +01:00
sgs_iface.c Fix some typos 2019-11-19 01:04:34 +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 large refactoring: support inter-BSC and inter-MSC Handover 2019-05-08 17:02:32 +02:00
smpp_openbsc.c Fix some typos 2019-11-19 01:04:34 +00:00
smpp_smsc.c smpp_smsc: Call destroy_tlv() when using build_tlv() 2019-04-10 10:53:23 +00:00
smpp_smsc.h SMPP: Don't accept password or system-id exceeding spec length 2019-05-10 07:07:00 +00:00
smpp_utils.c dissolve libcommon: drop debug.c 2018-03-22 17:05:42 +01:00
smpp_vty.c Write configuration correctly from vty (alert notifications) 2019-03-29 22:48:38 +00:00
sms_queue.c sms log tweak 2019-12-12 15:46:57 +00:00
transaction.c LOG_TRANS for CC: always log CC state 2019-10-21 00:40:31 +02:00