In case we try to enter the PIN/PUK and fail to enter a correct code,
the PIN/PUK retries are not rechecked as they should be.
Reported by: Florent Beillonnet <florent.beillonnet@gmail.com>
It seems that the function at_pin_send_puk should have been changed
along with at_pin_send, because it's also refering to the
at_pin_send_cb callback
See this commit : ba9f126716
The return value from ofono_modem_register was not being checked. If this fails
the modem object is not setup and causes a crash. This was specifically seen
when using the mbim driver without having configured with mbim support.
Now the modem object gets destroyed properly if the modem registration fails.
On the SIMCom SIM7100E, setting AT+COLP=1 causes there to be no
response at all from "ATD...;" commands until the call is answered.
The results in oFono stalling rather than creating a new VoiceCall
object.
We fix this by adding SIMCOM to the list of vendors for whom we set
AT+COLP=0 rather than AT+COLP=1.
Add support for the SIM7100E modem. We add a new "sim7100" plugin
because there's no other AT-based modem that has support for both GPRS
and voice calls.
In file included from unit/test-mbim.c:28:0:
unit/test-mbim.c: In function ‘parse_device_caps’:
unit/test-mbim.c:332:9: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
assert(cellular_class = 1);
Typically responses to USSD requests are coming with status
zero (NOTIFY) but some are coming with status 2 (TERMINATED).
If those contain data, the data should be presented to the user.
QMI_UIM_GET_CARD_STATUS is retried in more error cases
when trying to get password type.
In case of failure, driver report an error instead of
OFONO_SIM_PASSWORD_INVALID. This avoids a crash.
Use right slot and application to get card status, PIN status and PIN
retries. Without this patch, SIMs where selected application and slot
numbers are different are not detected.
The way things are currently coded, the gobi plugin calls
qmi_device_discover and does nothing else until it succeeds. As such,
we can safely assume that the version_list is set up when we go to
create a service.
The only thing this output parameter is being used for now is for
getting the transaction ID. Return the TID directly from
__submit_requesta and drop the 'head' parameter altogether.
The only way request_alloc can fail is if one of the memory allocation
routines fail to allocate memory. However, Linux memory allocation
doesn't really fail in this manner; memory can be overcommited and the
out-of-memory reaper will take care of re-establishing the balance when
excess memory is actually accessed.
Given this, request_alloc will never return anything other than success
and the failure paths will never be exercised.
The service and control requests differ slightly in their headers, but
this difference is minor enough that we can handle it directly in the
request submission routine. This patch unifies the header setup for the
two request types.
After setting up the request structure, qmi_service_send makes no
further use of the 'param' and 'service' fields of the service_send_data
structure. This patch removes those fields and frees 'param'
immediately after the request has been allocated and the parameter data
thereby copied into the send buffer.
If an operation is in progress and an operation is canceled, we don't
actually destroy it, but simply clear out the callback. In the case of
a context being destroyed, the operation is left on the simfs op_q with
a dangling pointer to the already freed context. So the current logic
in sim_fs_op_free tries to access invalid memory.
Fix this by performing the watch operations in sim_fs_end_current
instead and setting the context pointer appropriately.
==2870== Conditional jump or move depends on uninitialised value(s)
==2870== at 0x4C2ED31: __memcmp_sse4_1 (vg_replace_strmem.c:972)
==2870== by 0x4F451A: sim_pin_retries_query_cb (sim.c:462)
==2870== by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870== by 0x45544A: service_send_callback (qmi.c:2143)
==2870== by 0x452D00: handle_packet (qmi.c:815)
==2870== by 0x452E85: received_data (qmi.c:863)
==2870== by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x4C680B: main (main.c:256)
==2870== Uninitialised value was created by a stack allocation
==2870== at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870== at 0x4F451D: sim_pin_retries_query_cb (sim.c:462)
==2870== by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870== by 0x45544A: service_send_callback (qmi.c:2143)
==2870== by 0x452D00: handle_packet (qmi.c:815)
==2870== by 0x452E85: received_data (qmi.c:863)
==2870== by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x4C680B: main (main.c:256)
==2870== Uninitialised value was created by a stack allocation
==2870== at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870== at 0x4F3DFB: get_pin_retries (sim.c:278)
==2870== by 0x4F4553: sim_pin_retries_query_cb (sim.c:467)
==2870== by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870== by 0x45544A: service_send_callback (qmi.c:2143)
==2870== by 0x452D00: handle_packet (qmi.c:815)
==2870== by 0x452E85: received_data (qmi.c:863)
==2870== by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x4C680B: main (main.c:256)
==2870== Uninitialised value was created by a stack allocation
==2870== at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870== at 0x4F3E65: get_pin_retries (sim.c:288)
==2870== by 0x4F4553: sim_pin_retries_query_cb (sim.c:467)
==2870== by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870== by 0x45544A: service_send_callback (qmi.c:2143)
==2870== by 0x452D00: handle_packet (qmi.c:815)
==2870== by 0x452E85: received_data (qmi.c:863)
==2870== by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870== by 0x4C680B: main (main.c:256)
==2870== Uninitialised value was created by a stack allocation
==2870== at 0x459B1A: query_pin_retries_cb (sim.c:531)
0 0x00007ffff7b20517 in g_queue_is_empty () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
1 0x00005555556adcdd in sim_fs_op_free (pointer=0x5555559cb990) at src/simfs.c:101
2 0x00007ffff7b205fc in g_queue_foreach () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
3 0x00007ffff7b2065b in g_queue_free_full () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
4 0x00005555556add81 in sim_fs_free (fs=0x5555559c0780) at src/simfs.c:125
5 0x00005555556828f3 in sim_remove (atom=0x5555559cb000) at src/sim.c:3175
6 0x000055555564f16f in flush_atoms (modem=0x555555a8fb00, new_state=MODEM_STATE_POWER_OFF) at src/modem.c:432
7 0x000055555564f3bd in modem_change_state (modem=0x555555a8fb00, new_state=MODEM_STATE_POWER_OFF)
at src/modem.c:510
8 0x000055555564ff99 in set_powered (modem=0x555555a8fb00, powered=0) at src/modem.c:896
9 0x000055555565074c in modem_set_property (conn=0x55555596c8d0, msg=0x55555596e460, data=0x555555a8fb00)
at src/modem.c:1120
==14399== 28 bytes in 4 blocks are definitely lost in loss record 151 of 390
==14399== at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==14399== by 0x209065: convert_gsm_to_utf8_with_lang (util.c:651)
==14399== by 0x2091D1: convert_gsm_to_utf8 (util.c:690)
==14399== by 0x22DDA7: ussd_decode (smsutil.c:4738)
==14399== by 0x18BF71: qmi_ussd_request (ussd.c:233)
==14399== by 0x2183EA: ussd_initiate (ussd.c:614)
==14399== by 0x27B6C8: process_message (object.c:259)
==14399== by 0x27D1CD: generic_message (object.c:1070)
==14399== by 0x5170732: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14)
==14399== by 0x5161D83: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14)
==14399== by 0x27907C: message_dispatch (mainloop.c:72)
==14399== by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399== 16 bytes in 8 blocks are definitely lost in loss record 132 of 390
==14399== at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==14399== by 0x59E03D9: strndup (strndup.c:43)
==14399== by 0x18277E: qmi_result_get_string (qmi.c:1794)
==14399== by 0x184221: get_ids_cb (devinfo.c:129)
==14399== by 0x18353B: service_send_callback (qmi.c:2286)
==14399== by 0x18093C: handle_packet (qmi.c:831)
==14399== by 0x180ADD: received_data (qmi.c:880)
==14399== by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399== by 0x4E82A5F: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399== by 0x4E82D81: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399== by 0x201900: main (main.c:306)