From patchwork Tue Feb 13 13:15:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Tiemann X-Patchwork-Id: 13555109 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F0BD55780 for ; Tue, 13 Feb 2024 13:15:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707830105; cv=none; b=BwQL6bCdjSmci1JxE4pXnhS1p07jO7tRejHDPyRk9wrmXapCkfcUmZGlW5oV3ZbAL9iYTNXPkDdLJWUeFY0bsLX9Z3c5FXSCs1RbWHtaQF7YfRk+Hrrzm/x8OuXEq5yc5iImJ0fean+kH7/WVxp7C+D8v2k2DzNybADHNepeXCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707830105; c=relaxed/simple; bh=npGgP6+Rk/C3isaZP8f27uWoCroQt20BkJLsVtTLYnM=; h=Message-ID:Date:MIME-Version:Subject:From:To:References: In-Reply-To:Content-Type; b=oBJtuDBn+kCJ2RbWuEf3DLMDOHMLhB2RVVQqeNLGZP/xuD5ghdkW2wuYL4AhvNGtpcPfj/O9SQCFnN5sNrjs6vCnab8pZ7X2kX6fvlnxe5mSPxMDQ3JX894JgzRKTNCv+u43hwB9IyNq/nfJaQ+quQdhucQwvGOPP9xsREikmAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=rtie@gmx.de header.b=noCdMewT; arc=none smtp.client-ip=212.227.17.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=rtie@gmx.de header.b="noCdMewT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1707830101; x=1708434901; i=rtie@gmx.de; bh=npGgP6+Rk/C3isaZP8f27uWoCroQt20BkJLsVtTLYnM=; h=X-UI-Sender-Class:Date:Subject:From:To:References:In-Reply-To; b=noCdMewT9uXi7EvIiHhfL9HV0Ph0lrqQm3zmC+WEkkJ7ij22T7c7Xcz71aJmK8fT 5qS5nq5Ea1S6CVFrr24ABrWm2stau9gBAIKZrslIKneDopsn93IzBUTP+8TQOn/g+ daufpKIv7cLRL14MAWEk+JpsPmTTZHzl9rKjjrs+PUYrRL4IICqOT/Ad1eQNewbB4 I++cr3ZstytAZxTDzRObbRKoogbvgLBs+DwX8Q+GUg4gFxSFbipqam0kXNJZ5XeSs lDJc2BTXMn8df+PW3ghwbYRTpCh0ZJ0Wz6Mmz5XnMzibv+/MR4IAjurzblXWmIGsx AS974RfZtKGzD+chVw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.15.101] ([87.245.7.122]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MCbIx-1rhoik2dlr-009l4e for ; Tue, 13 Feb 2024 14:15:01 +0100 Message-ID: <12ba9a91-450d-4f40-9178-df2c2fca214f@gmx.de> Date: Tue, 13 Feb 2024 14:15:01 +0100 Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 1/4] wifi: Fix use-after-free when tethering is disabled. Content-Language: de-DE, en-US From: Robert Tiemann To: connman@lists.linux.dev References: In-Reply-To: X-Provags-ID: V03:K1:hGhGU0zbopGPpdnN1/nK63s7Yc/4f69FEV8DttiYVGguXeFI87B /3oki9XLHDvv5VFWaCstMxdG8XZ772uHhs2CWerjh7B90+V4wQjBSeYUvDFenWCJUmS6unG R1Pwx3HfuPY9lGcxhqA4UcBq+85DbYutI1AtJi7Ys1vZS9QlNQXHDwp5dGGVz2+FMleJ+yh GikK8I6zHpGMsFgCyHf7w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:RjhHllwCrZQ=;U3vneUqX5rpVak7kCKy5uIkOWmK Z8qKez1Rxk1FR8t/Oy0bOy1h6Vx+VghEvCytUMW7JjGJROX3n0i6q1QrU1SxfOG0j3r4Ono8z x8XxzXNMBASL/qV9kSODGr7DTS8gd03txq7EfZDqgnoJjrzMGo5jDRD4bqcBZ71bK6fovb6n9 BYrWTOds3PwEH3hWoG7Q9QJwKsCgLzKmWte1qgWIzbaC+/R/6oLJMWZHqt1Cua7WBA4Oge0lu CxDFGgb0Kymw05dGza07wc4jwAyPn7MOUXbQS9CI7hddJV8h6K+VlhH9jneB7QWD2qXHTe5Wm MqbaKu8HPzPFsdmeMyajUW0elLJE55aECy/Smbu1aqvgNP7/Vp4zGdAjZTaymIH3/Wjhwr1Zl H3J+2WO8U8OjNe4dP2ul2IxKrV9cXcfiMN31rinP/EInVTts/19maGPdXGFDlybdYlo3CJOQg TQdPjkjJjcO/woVYcMtcsQaTG3dOu5LBAjndPeHg/TcxA0NBPX8oKrYqsauOqhv7ohh1cpDvO YArvabEAFrR+wCEZxncvdAkNZnKsJbq/k9V1nOddkxUDkn5ai1AyA1SbjXMZOzFGNv56icDCM J4VYfkdDBdgU6IRyll/z2sodl0ehF92bBeDjRlADaRWrBChsNohHWY+6rJgX3plpTqu3KrNSb 33Z9HUk5aOL3olIgoOyC/Uc4O8qnkbHZ7/occ6dPXc6dmf7wc3PGBH0fXhMjRWdlfpYyQJHoR E763WZdq694FXNJSYfstepiivs8kmAKnKbswcH2Zwxu5FeT6pS1CK2ybVW9s6svi/xdKE3nfm njgILI2yb+3RVmkrMdwRsxhqTpUN/0VpYs21SNg6W0ibE= The bug frequently causes junk being written to the Tethering.Identifier and Tethering.Passphrase entries in the settings file. This in turn prevents Connman from starting up at all the next time it is run. To reproduce with connmanctl, use the following commands: enable wifi tether wifi on MyNetwork ThePassphrase tether wifi off Then have a look at the settings file. Disabling tethering causes a call of remove_ssid() from interface_select_network_result() in gsupplicant/supplicant.c, which frees the SSID and passphrase strings of the given GSupplicantSSID structure (originally initialized by the wifi plugin). These strings, however, are shared with a connman_technology structure, and they are accessed in technology_save() (called indirectly from set_property() in technology.c) after they have been freed. To fix this bug, the affected strings are copied into the GSupplicantSSID structure instead of simply assigning them. We make sure (1) to free them in case supplicant didn't take the GSupplicantSSID structure due to an error, and (2) to avoid double frees in ap_create_callback() and sta_remove_callback(). Originally, there were two GSupplicantSSID instances in the wifi plugin: one for the supplicant, and one stored in the wifi_data's tethering_param structure. The latter, however, was never used, so this commit removes its allocation to avoid a new memory leak, to save memory, and to generally avoid confusion. The bug fixed by this commit was introduced in 481d08f108. --- plugins/wifi.c | 54 ++++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 30 deletions(-) -- 2.34.1 diff --git a/plugins/wifi.c b/plugins/wifi.c index ed7437f5..ba5aa2d7 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -2547,6 +2547,16 @@ static bool handle_sae_authentication_failure(struct connman_network *network, return true; } +static void wifi_data_free_tethering_info(struct wifi_data *wifi) +{ + if (!wifi->tethering_param) + return; + + g_assert(wifi->tethering_param->ssid == NULL); + g_free(wifi->tethering_param); + wifi->tethering_param = NULL; +} + static void interface_state(GSupplicantInterface *interface) { struct connman_network *network; @@ -2568,11 +2578,7 @@ static void interface_state(GSupplicantInterface *interface) return; if (state == G_SUPPLICANT_STATE_COMPLETED) { - if (wifi->tethering_param) { - g_free(wifi->tethering_param->ssid); - g_free(wifi->tethering_param); - wifi->tethering_param = NULL; - } + wifi_data_free_tethering_info(wifi); if (wifi->tethering) stop_autoscan(device); @@ -2832,9 +2838,7 @@ static void ap_create_fail(GSupplicantInterface *interface) connman_technology_tethering_notify(wifi_technology,false); } - g_free(wifi->tethering_param->ssid); - g_free(wifi->tethering_param); - wifi->tethering_param = NULL; + wifi_data_free_tethering_info(wifi); } } @@ -3387,7 +3391,7 @@ static GSupplicantSSID *ssid_ap_init(const struct connman_technology *technology return NULL; ap->mode = G_SUPPLICANT_MODE_MASTER; - ap->ssid = ssid; + ap->ssid = g_strdup(ssid); ap->ssid_len = strlen(ssid); ap->scan_ssid = 0; if (freq) @@ -3403,7 +3407,7 @@ static GSupplicantSSID *ssid_ap_init(const struct connman_technology *technology ap->protocol = G_SUPPLICANT_PROTO_RSN; ap->pairwise_cipher = G_SUPPLICANT_PAIRWISE_CCMP; ap->group_cipher = G_SUPPLICANT_GROUP_CCMP; - ap->passphrase = passphrase; + ap->passphrase = g_strdup(passphrase); } return ap; @@ -3423,9 +3427,7 @@ static void ap_start_callback(int result, GSupplicantInterface *interface, if (info->wifi->ap_supported == WIFI_AP_SUPPORTED) { connman_technology_tethering_notify(info->technology, false); - g_free(info->wifi->tethering_param->ssid); - g_free(info->wifi->tethering_param); - info->wifi->tethering_param = NULL; + wifi_data_free_tethering_info(info->wifi); } } @@ -3448,14 +3450,10 @@ static void ap_create_callback(int result, if (info->wifi->ap_supported == WIFI_AP_SUPPORTED) { connman_technology_tethering_notify(info->technology, false); - g_free(info->wifi->tethering_param->ssid); - g_free(info->wifi->tethering_param); - info->wifi->tethering_param = NULL; - + wifi_data_free_tethering_info(info->wifi); } g_free(info->ifname); - g_free(info->ssid); g_free(info); return; } @@ -3483,14 +3481,10 @@ static void sta_remove_callback(int result, info->wifi->tethering = false; connman_technology_tethering_notify(info->technology, false); - if (info->wifi->ap_supported == WIFI_AP_SUPPORTED) { - g_free(info->wifi->tethering_param->ssid); - g_free(info->wifi->tethering_param); - info->wifi->tethering_param = NULL; - } + if (info->wifi->ap_supported == WIFI_AP_SUPPORTED) + wifi_data_free_tethering_info(info->wifi); g_free(info->ifname); - g_free(info->ssid); g_free(info); return; } @@ -3563,9 +3557,6 @@ static int enable_wifi_tethering(struct connman_technology *technology, info->ifname = g_strdup(ifname); wifi->tethering_param->technology = technology; - wifi->tethering_param->ssid = ssid_ap_init(technology); - if (!wifi->tethering_param->ssid) - goto failed; info->wifi->tethering = true; info->wifi->ap_supported = WIFI_AP_SUPPORTED; @@ -3584,10 +3575,13 @@ static int enable_wifi_tethering(struct connman_technology *technology, failed: g_free(info->ifname); - g_free(info->ssid); + if (info->ssid) { + g_free((char *)info->ssid->ssid); + g_free((char *)info->ssid->passphrase); + g_free(info->ssid); + } g_free(info); - g_free(wifi->tethering_param); - wifi->tethering_param = NULL; + wifi_data_free_tethering_info(wifi); /* * Remove bridge if it was correctly created but remove From patchwork Tue Feb 13 13:16:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Tiemann X-Patchwork-Id: 13555110 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0877482DA for ; Tue, 13 Feb 2024 13:16:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707830222; cv=none; b=p1gYvGg9AZfWPl5asWOAInlhu7et48zD72fJJL9YCBhz9NBl5vqNsHwgTgxXiX/v8CE54yVPOTCZmZ+9rUW590aMGD5xAjKaK3KB8o667xW02s9ZkINGrjQlTdPJx8nNgkCJQLfkk/THAnqrn0JRg59GCEpVjlU80EnF2FOI19g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707830222; c=relaxed/simple; bh=LaXy4T26A5SE9xNEQtezsL4DDEMqs7dFdDxEtm3QJvU=; h=Message-ID:Date:MIME-Version:Subject:From:To:References: In-Reply-To:Content-Type; b=aimkJCd/6cTMZ4ESiFS+zbVvY4QfR/DzEznEAAvEQ5jbIQZidJtpqzNl6UmHJgJa9SaLUoeAykoloqvlcfYaHiRa5O/kRIKYiHpI8HhA/XZwCxKrsiS0gMgvFCDKXd/rqtdXdCJEAZgLfCc39fhXnehjzmtV5SPq9QOMViDQpkM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=rtie@gmx.de header.b=CjsqPWZk; arc=none smtp.client-ip=212.227.17.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=rtie@gmx.de header.b="CjsqPWZk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1707830218; x=1708435018; i=rtie@gmx.de; bh=LaXy4T26A5SE9xNEQtezsL4DDEMqs7dFdDxEtm3QJvU=; h=X-UI-Sender-Class:Date:Subject:From:To:References:In-Reply-To; b=CjsqPWZkLBaIy+Nb+iZxUeUFnwvHC/ozd7zhadOL2cEROumODak3RT+kV8SD6ne4 wyommdRArGj5aWOIlQa+jzU5misaL7K7hvSlvTIl/0QZqeWAqWbXy/jQIL7dZpiIe XEGGy/t1IDEayNQ7mWrbdcEAUz4L8LBxgsn3SiGRsgTIUMrbywQoJsge/je5Xbe5k xiqlzNGj7CYDnh6ZL/pG9s1W7fLdH4eDzRCl6+RF2rg0nYW7iFRTtwQmHQjbjfHCX +LU3hoTpYNpfMY7OHcwEgBBLS6gBQ7a5+JFno3jWBmMqoj8FttE4+R1mRArVjwV5s MlbHnmeYUmtfMz3krw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.15.101] ([87.245.7.122]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MrQJ5-1rEHIU3hPL-00oZdc for ; Tue, 13 Feb 2024 14:16:57 +0100 Message-ID: Date: Tue, 13 Feb 2024 14:16:57 +0100 Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 2/4] wifi: Fix memory leak. Content-Language: de-DE, en-US From: Robert Tiemann To: connman@lists.linux.dev References: In-Reply-To: X-Provags-ID: V03:K1:KmnMi2xKmupayvALgsR0hTmOKd65QqphZppvYKK5f/LZyqvfHVW DC7K4ZvFUtmyfwjLNWPFP3TRD9E2c8aa0bjrvPYXr3FJ6D4i3Yqtl6su4B4h+gvnUskb73q HCiOoF0ZLYlZ+bjFY9KrGx4AQoTlcBFZr4vlHBLDQmy7EUUIh34C/Ck01NB5SlTtd9w1mdh KT+A/WaBxAw2up6mbCQsQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:q/UGr3YoHXU=;OPnywG5yjQhpRu9mgAVU7Um4LuY x6401mD2c8stSO48zJojl8/3gs/qrUXlnlyEDZZhQN2qt8+Pq34IrR8b2rGyeruVjPnitba87 oNgllxkbEirrfcM9AxpEhRFfT9BnoGosA9b5eB8cMIipyIexTvkzPfXPiuFqhaVsR4rhKD5OH RpwlvDhcI3lTsvVnIYLtOSvI1RUkkLYg0I1/UYGuRonV9kRBG9gl7z5gZAFhzJAvrOM6itxo/ JnUHEqtDTgpmeMnnNSkNdqh5Cl9CdogMjO6p37cZ6yMFfVxa8cxgQoEejQxRqPwFHM7e6i19T pUc+0sLK9SrGW+o5814TtSRhxc2KbGjWWg1kDPRSXG+9kQwxeB4OogAekln7GlVfjnyaWrB/c ck62IMEPxRdv32h5htpka95knvIR1WJY2+C/cpjVpuNvi2Cxc5gn5EkWqB1FOz7C34xcURiQU Z78VM1yQsB65wqaxynfgNU1Ft62mGUb1izoOohni3GrhO1Ai5y86ro3Kz9myUkysPu+EpAeyX 9JNYHcSQzrOunb5MoklfjoxXVCDOG0raS7Lc2LGjb5O77s6mhvZAQPzJwBU1yS4+XfMNy3L21 yfff4xnBdwzuPaYi9UOmVuuTt7o6j+Cm8HOGOlr1IzfgGzyoaL7kiLHKJ6Khk91fG6t/L3Onu a+nrqnO619WnvtNvz0CfdKISIat7vqPecXYZVAe0Y1hIIhtLOVfOgJXmHTn8WnfbpH2eSUGk3 mf62F+Quj6NRAyprte8Rc0LpX6cVUhYFiFEGGcle/meZUujLxTxh8oepjJYMRwKJOsielVf6w gyaYflL/M/EoCCK1k+ZqHTAf/H8pSeiwfotxS+zuwa9fE= A GSupplicantSSID instance was leaked in ssid_ap_init() in case connman_technology_get_wifi_tethering() didn't succeed. --- plugins/wifi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.34.1 diff --git a/plugins/wifi.c b/plugins/wifi.c index ba5aa2d7..cc30d258 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -3387,8 +3387,10 @@ static GSupplicantSSID *ssid_ap_init(const struct connman_technology *technology ret = connman_technology_get_wifi_tethering(technology, &ssid, &passphrase, &freq); - if (ret == false) + if (ret == false) { + g_free(ap); return NULL; + } ap->mode = G_SUPPLICANT_MODE_MASTER; ap->ssid = g_strdup(ssid); From patchwork Tue Feb 13 13:17:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Tiemann X-Patchwork-Id: 13555111 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AAB355764 for ; Tue, 13 Feb 2024 13:17:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707830274; cv=none; b=I6KQwGlrZILB3KV+CUvykqb8dbxXX32Qg4BvxrSRhz1DoJlOmysCG9tUjGikvx/+tkKwNCSX0ndo7P2UWU/cEYwyrHwGQWjLdZqzZqBulJ7Tm8sDVWUzexLA/AY8i6vX0QMlNTngMc5bKshTM2ibjKhOMEEy9cO5z0HzVu3kswQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707830274; c=relaxed/simple; bh=Wuqb8naqBurWD9R7E/+zTAG7syKah97ArWOMZYfgRjM=; h=Message-ID:Date:MIME-Version:Subject:From:To:References: In-Reply-To:Content-Type; b=j4ZfR6bfOI5ONSMAT3Va0clwWxIah52MSOQAMz9W0kep4vFx9b7fb+J0uvDRj3fUTg+vqaKZX1HLQhdJ0pmnbyq3CW1DnrHmbm/uWYbUX5rKRynMUjRocZZsl8oMTPzuEcAkZZGpESza3cKv80bBatNFhBlIwYVFPaMSt0EGcSk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=rtie@gmx.de header.b=ODF9mjQ+; arc=none smtp.client-ip=212.227.17.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=rtie@gmx.de header.b="ODF9mjQ+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1707830270; x=1708435070; i=rtie@gmx.de; bh=Wuqb8naqBurWD9R7E/+zTAG7syKah97ArWOMZYfgRjM=; h=X-UI-Sender-Class:Date:Subject:From:To:References:In-Reply-To; b=ODF9mjQ+Lg83ztxdZ9nwNLoKVIfvYibBqx4a1xPMcIdh4g9JRT2vZwm0f0fN07o1 rs5uiCYWIgxouFyZundosYWJHwKAIvIpvI2ECPSA0/8jmKZPaA09aX3ot11aOpvMh srp1yjOd8NUBv12PajssR8XGsP1mD2Ex/PEeocNqYnKwRY06ysflC+zKuqXptqjij 7eS2mk32CClYVZtBiPJz/6dPDugKY7VhhcJfl/S7aMmWJmpabC7tbppWs/+UrjAb6 bk6nCVxLEtFcFuxxQxAgdnRQGqhOGmbkgMysCQy6R4d9yggMNeYgJpza9jcMFLCBX 5crWNi5G9sK8QUcTUQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.15.101] ([87.245.7.122]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MTzb8-1rQQSC16Hq-00R0wD for ; Tue, 13 Feb 2024 14:17:50 +0100 Message-ID: Date: Tue, 13 Feb 2024 14:17:50 +0100 Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 3/4] wifi: Fix indentation. Content-Language: de-DE, en-US From: Robert Tiemann To: connman@lists.linux.dev References: In-Reply-To: X-Provags-ID: V03:K1:Y5TyjY0TnNSakx5LYD7Pf49Qh1He85tEDonbDbqGy7YMYqUyNud Rg49w9V/9JM9sNkbtVuP6wF/dQN8yhVQDB567AFsSfnGcfXuuY2EnIbA0624uGZfrbLdjLz o9xPJfniq/MiZZyXh9bfch/M4yg4E9OUsF2Bk6Wotug0bY7Cxqt3e8szHMUuTWhJp65iJU5 0vEaDq6Ks3z4x4FJFKI6Q== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:ZKfbG2fQtfE=;Yyt/XUcEDbackN7ivHmiub1e51N oidtRKpTM3T/yAPmyqZ0UDAYDEU/C48jcPtpfmzs/Ok2UnlmJ1NvlRj3tF9kfQtS75SKJj2+k DwO0YIsB83FHC6bc8CRExLK4TAm4HadbMpnAx+2FRjZR7WJJkyORei1oF1U4rRxqPyOJtzwkf aYooq1SxuaI/VAD1SqHh5Si0eNNS4WiUf9MhLqZSamKMLKzZ2vae2CG80JpDH/UOYVaFmmQQ0 ejqlQtuY8mrBl9EvCq8uYO1G7GVVPWIZ5P1Go/sqdRsJrOajis72bZ7dMgXZq2x0YRa7mtlES P2FNKsk2CGrxljhVwKuajEDqoqAVz9K3RN/+DMT5YS1eBzJu8vemrTLlA2yOLBhC0zKxZnxr0 2L7l0FXmYYf9zeXdo81oLqvJYzv7NFbhElLnzngDAlzKMZaLKKvG0UHN9iuQi/Kh9yMw5YhgK 9a4d0xnC3Iht+12SKU6F2pHqowDrm0z1nniviF9tii8yINWX29CyUQYi0GFHS3LZZYgIRIRKq gIU12j7tCucnu782vBrnb6D2ewaKzjyouYq6wH25yiR9ewimCmvMvzcX/kv1+Z2GUHfbx8KaY XpZBpErzQSBcZFg8lNlziWMIR0AzjL/gKC/lZBtO9PtY+TmAxojLQhGLcDT+5LGCu41gWLITK bfkGGtgtqvxMnwXXf0StQwHx7oLx8IJl9PDnaGpeUHVHkHMYu22Oj/U9OdvRCKNapHO4oCrhU zhJafj23pB9v5+nE+/P7voNo0JWBVRKLJgIcArEsJomUUek1MQSrL4Vb7TE7BiHyvfH3/wZVy FKqxnCD7fnLDYia+trWMt5+Dvpdv22SpDX/D+JuZZdZAI= --- plugins/wifi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- 2.34.1 diff --git a/plugins/wifi.c b/plugins/wifi.c index cc30d258..12389fa6 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -3405,11 +3405,11 @@ static GSupplicantSSID *ssid_ap_init(const struct connman_technology *technology ap->security = G_SUPPLICANT_SECURITY_NONE; ap->passphrase = NULL; } else { - ap->security = G_SUPPLICANT_SECURITY_PSK; - ap->protocol = G_SUPPLICANT_PROTO_RSN; - ap->pairwise_cipher = G_SUPPLICANT_PAIRWISE_CCMP; - ap->group_cipher = G_SUPPLICANT_GROUP_CCMP; - ap->passphrase = g_strdup(passphrase); + ap->security = G_SUPPLICANT_SECURITY_PSK; + ap->protocol = G_SUPPLICANT_PROTO_RSN; + ap->pairwise_cipher = G_SUPPLICANT_PAIRWISE_CCMP; + ap->group_cipher = G_SUPPLICANT_GROUP_CCMP; + ap->passphrase = g_strdup(passphrase); } return ap; From patchwork Tue Feb 13 13:18:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Tiemann X-Patchwork-Id: 13555112 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A979955764 for ; Tue, 13 Feb 2024 13:18:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707830306; cv=none; b=gl8o5qTjDgpRFnyMtb0XiJof/PT+cDx+aYIZr225IfyXP0pQPJitWqVuvMBWcpXTLCGqSfyLrwm6rXCCThdliny2CSXSP6YO035RLilxBROUGgFDZdhgogvmHiC1cDNPhjqKApLhO9Q/tcn/ZmcEV33hvE+SCM4yZAD0eIxBkMY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707830306; c=relaxed/simple; bh=aT9uakTDE+5AOxheOWAyeXd6zMcpRaWqgOBtd9cgSZM=; h=Message-ID:Date:MIME-Version:Subject:From:To:References: In-Reply-To:Content-Type; b=V5qXMU0n+tSMH8GwSBqXvPBwFnm/Vg9I5PcuvntONlr76Q9azpU8vTuKfk3IopMix21olb4csJEddl1dutFBADvHiiKWXYj9LNm3e259rTZSfcwTdjFIz1e2aZ/ct9/9jYpbBBI6ULV1sS8mPtdMyC+wxJQmmSCobMsmgX1znNI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=rtie@gmx.de header.b=sKMMfnGc; arc=none smtp.client-ip=212.227.17.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=rtie@gmx.de header.b="sKMMfnGc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1707830302; x=1708435102; i=rtie@gmx.de; bh=aT9uakTDE+5AOxheOWAyeXd6zMcpRaWqgOBtd9cgSZM=; h=X-UI-Sender-Class:Date:Subject:From:To:References:In-Reply-To; b=sKMMfnGcjZ3QNJeYfh1NdJoKmmK9GdN49VSW4QdBX0BJApf+P8/LR7kY6JFv1Xhq mkm/fx5NElw5UQZUpIGiCbcdGo9EzU15APEq2Q6IN50sEyWcNRln6YAM0rB6x6sSQ 0SxFgO/C4a4nPweyYo/z/rPON5TJIoFOsWYE4HdhHudOEbfefl79sw+JTjQIRb0vY QblkxNHzpU1zKKs1uCHoh5qCGAKT4Qyf9+T+7V+zR3C0ne52Tv13uY2RHZp08xnye phY2C/D0B5s3TnzIVvP3A4YhuTlR90T0F0jCbzPElYR1mK8ctbfBrlxXxoolxaMGI fdeBG6y0/R8GY+3kHQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.15.101] ([87.245.7.122]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MnJhU-1rAgLS39u8-00jMZT for ; Tue, 13 Feb 2024 14:18:22 +0100 Message-ID: <3aea58eb-e3ea-4abd-b6ab-b03e0bfd7f19@gmx.de> Date: Tue, 13 Feb 2024 14:18:22 +0100 Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 4/4] technology: Fix memory leak. Content-Language: de-DE, en-US From: Robert Tiemann To: connman@lists.linux.dev References: In-Reply-To: X-Provags-ID: V03:K1:KuCmhLvjyqHm9BuzWN+YuaUsZgWTC/erEALBMyomUZNmJ3uS0q7 59bAcbDFBBbbjH7G1+KdFrdFOMN14Zev/1XjVTei4280Hy1PeBuCOntZBSrKXDZz6pPAqOj Wi7wyFDZd2Vo5JRnHOhxpwozN0u/CChmSLMag/xvr8PwlW7TmY6S62VsN206wgRFeLbZl8h zt/+ZHObYTarxFk4ZbNVQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:AIzmkerwTNI=;7IJv3R3xzjohLe/ztDE44qska12 faEKQtx9B30976nFrattizhbhX7S93WO5ZbGVJWDTHzz8sArwlarTTGWLPZtVBZ0Hc4fHgu3h vB2aw8YFlOA1SEk/hSyh4s/UqtRjCO87IyDQ/kbZVHl9dc3S6AmN4ykveGM/Svdb6/bS+tI+6 nMIiIeetdJzb3bvdBmlqpiXBl6e8ELlNcbtFb4/cAjReWX7SFjSSyCCVIApDRGY/ebdVTKmM2 4m+Bo0Cu053unltNUDsaOS4l0xDi2WOUQA0ht3tcsAmRwc50MbMS4hq1e0fl3eOyQwu5iAxBR 0PDqMXXCUDO6R/lCQ+ZEKVR+ACh2JP7oWDqM6Jq0aHmn68ycteSeG3MMPJ7j9Uvn9ntMd8EED 0WGAQpxa514YiFcsp6+jbPY616594zNT/0vfhlqO5NSZlkSPF+VRV1vIb1TOmF5o8H0wM1hge BxI1z2tlXd2lUiJ0VE48VUu6/SNs02Z67YmwYk9lvO46cYZgXSlI5Xq8JBNCoflocX3mvd24j q/42KzvksGgfTkdPNMd4+cfHZkI4c3ePnIsKpI2afMRK4kAicodscE8ctk+vRd/ibIO70eZpY YbwUscGq7buz84Nu2Z3GvWHRYvoIqU1zwW+VCs+XMCHIIExCMv2mZACcpMtGwdF7rqHh2viWB p8r4EljY8a107dFNZK+bvKjJpuzKtRHendH9lI5m0l2bIin0zaX5pJ7/cv2TMyGWbdnQYmIL+ 1phq8DG62ApQsK3T9pfQ0I703nxPf1+UQuFVAn+dgJRcHnXlx8aeX3la8vToUgyuMlGmCrzs3 jtQXQSY8c3GFk7R4T82C/u5E3yPFJyeZ0MWiaKvZ0tMBQ= --- src/technology.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- 2.34.1 diff --git a/src/technology.c b/src/technology.c index 65fb9854..270d83d0 100644 --- a/src/technology.c +++ b/src/technology.c @@ -479,8 +479,10 @@ static void technology_load(struct connman_technology *technology) enc = g_key_file_get_string(keyfile, identifier, "Tethering.Passphrase", NULL); - if (enc) + if (enc) { technology->tethering_passphrase = g_strcompress(enc); + g_free(enc); + } technology->tethering_freq = g_key_file_get_integer(keyfile, identifier, "Tethering.Freq", NULL);