Re: [PATCH] mm-modem-helpers-qmi: avoid SIGSEGV with mmcli --set-current-bands

2019-08-23 Thread Dan Williams
On Mon, 2019-08-19 at 16:31 +0200, Reinhard Speyerer wrote:
> For devices which do not provide feature_extended_lte_band_preference
> mm_modem_bands_to_qmi_band_preference() gets called from
> mm_shared_qmi_set_current_bands() with extended_qmi_lte_bands
> set to NULL which may cause a SIGSEGV in the memset() call in
> mm_modem_bands_to_qmi_band_preference().
> 
> Avoid this by checking whether extended_qmi_lte_bands is non-NULL
> before calling memset().

Thanks, pushed as MR:

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_requests/140

along with the other 2 mm-modem-helpers-qmi patches you posted this
week.

Dan

> Reported-by: Nick 
> ---
> diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c
> index 86e1803b..a0bc4f4a 100644
> --- a/src/mm-modem-helpers-qmi.c
> +++ b/src/mm-modem-helpers-qmi.c
> @@ -567,7 +567,8 @@ mm_modem_bands_to_qmi_band_preference (GArray
> *mm_bands,
>  
>  *qmi_bands = 0;
>  *qmi_lte_bands = 0;
> -memset (extended_qmi_lte_bands, 0, extended_qmi_lte_bands_size *
> sizeof (guint64));
> +if (extended_qmi_lte_bands)
> +memset (extended_qmi_lte_bands, 0,
> extended_qmi_lte_bands_size * sizeof (guint64));
>  
>  for (i = 0; i < mm_bands->len; i++) {
>  MMModemBand band;
> ___
> ModemManager-devel mailing list
> ModemManager-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel

___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel

Re: [PATCH] mm-modem-helpers-qmi: avoid SIGSEGV with mmcli --set-current-bands

2019-08-23 Thread Reinhard Speyerer
On Fri, Aug 23, 2019 at 06:59:59AM +1000, Nick wrote:
> Hi Reinhard,
> 
> Thanks, I am using your latest libqmi patch, and latest MM patches.  No more 
> crashes or off-by-one???s from by qmicli, but MM is still showing eutran-32 
> as a supported band of the MC7430.  I have reset the MC7430 to RMA defaults, 
> and recompiled MM and libqmi to try to do my due diligence.  Do you have any 
> suggestions?
> 

Hi Nicholas,

my suggestion would be to check with ldd that the rebuilt ModemManager
correctly refers to the newly built libqmi .so, check with type mmcli
that the correct binary gets executed and also to ensure that ModemManager
has been restarted after it has been rebuilt.

Regards,
Reinhard
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel