From patchwork Thu Sep 10 10:39:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya X-Patchwork-Id: 2302197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=by4HG5ju; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=XzCxzHTV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hgqMq0ffCz1xxw for ; Fri, 11 Sep 2026 06:41:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+IhuL9r+iOFcnNQyKWtp8ByrBvlX7z9QWCh5r55egkk=; b=by4HG5juaQz2IS KSWLZl7Sogy5WXmrWtInOztr9BcrMlU0Yp5x3wHlOLLn1kAQbjieA/iGWy+PwX0ORM0ilJMA7fI1A FFT7qIe9nVE7DVUXxFnlxBSaH1NECIhJGyG327VxvWBdePPUTGdMoLbjzOQqFE88o6o8R78/bjshq wj9wmCNDD3EujaoV5k0MgG7CLx/DcoMzwTqk1FFaMwuXXjpf5e2aI/CBqA40Vc+dfu3IZEgN55I0Z WlFdVY+wTgTPLoxJuEscK01r6cDCK7SBG8e7fLqU9RqBu0jQoRnkmRlC8EBddPbIGbpqO0zgMLVoR c9Nn4hDLNNqRnfGB8roQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x4lYq-0000000FLsn-37S7; Thu, 10 Sep 2026 20:39:56 +0000 Received: from mail-pj2-x10.google.com ([2607:f8b0:4864:39::10]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x4lYn-0000000FLs9-3uGp for hostap@lists.infradead.org; Thu, 10 Sep 2026 20:39:55 +0000 Received: by mail-pj2-x10.google.com with SMTP id d9443c01a7336-2d747ed9865so920515ad.1 for ; Thu, 10 Sep 2026 13:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789072793; x=1789677593; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=DWvVvAihmsXTcNkMhYKmYViqCrT3hjQUul9eo6M/EcA=; b=XzCxzHTVntzbU20RG529GfW6UsghCk4IKOy1WCUZWJQRQMalvRITfWZ/tmmi51XZvQ 8zhaPgnp631HN3B+1o18KrkZCDo0UE1BT2aF2h3TZHuD8lRQC7saUNsEoRCmZoPKeWxM qy2pY9O+Czs+wIDcS4ALrFQzwbDwEs6Re8Wb3mKdzOPCofw8a3FGT1U6mobDEW9T6PiK uR+V3GXW11cqceUilTBi7k84CCEIChQp4wjIgq+N2Nf8ZGpW1hSmHvG3GW2ga6BZBiIs 23fcRa0pGbA/diqohjWiEiv2Hp33mB9A4jPPGnSlz84hAw4DbSECBrxyqd5Km8sBeC2Z FS4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789072793; x=1789677593; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=DWvVvAihmsXTcNkMhYKmYViqCrT3hjQUul9eo6M/EcA=; b=LjOTJiWDnVi8r7ds+pfVY47Ro3buRfESsQiAtOT4sef5FNDYUNXgCU2Vg6lNw7KkYJ zT0bcyi2YZJsdsfZGTqBJiFwjC5IMieBqWNi2a6tq3VHFmKhs+oChsS8B8dzWdBOpQMa KqQxSgU7Dp+hCsPNExgfF043T+vHj/R9f+O4EzVLfZl5ZMNHUf3qAUFlIi+rwugRnyyO 3anC1x3HvH3tjl7EaI1ItvaVJPbCOslxtnz7ldL+ydwQyuVhZ5awqlLe/7GYm/wzVy/L lqvXtjjWKoLAkl8OZUEB17Bswrym+W6i+1ePvC646yhIwRfm4in/WOLZpEytGXKyJCbn o53A== X-Gm-Message-State: AFuF++mUzErVJaRwGMcG6dIxyPVCJo7Vqs+r6JVFc4K61qV4AM2uXjat zwhHU1uyZR4MUgChv0YTqxrgaYTEjWaI0CB5UUh5wsxZ6DM7z+5kM4PoPwVDhA== X-Gm-Gg: AYBFou0npshH728ELngYLQN6JeuDjWHoiM0P6rT2gg2PojrZvfryUfS/6N4PSeF6ZUJ lFKXc+G30W4tE3VfJWH0HH1l4lLAGGxzx4bhatd4BgeaqS4xJyil7/bLAhtVKRBp532kZDOW4Fq bPC01OZ1UlNNHPjMpkkTkS7Lf4wCfBRXx2nrseeu47G5lH9M3opDMyCJRXnjmuQXtjF5PPFGyH7 bWKc0aB77fRFgKP6przw7rBszEgfT/jSBWgJIVFrZfGRjwoNBLCuhSwMy8ALjtRz/Fdoctj7CAv 19oWvDkQiKx19UIMsXzEErs6l0MYIGrC8ZLQTiNqY6QGVqqFa3NSXyS40mCntYC15Y0DflYSdsy G7/xpNLpuGk3eoDCb+SxDgmvJGCPSSM1uE1v9QTW8CRVYSRE9MDdhFso0h6oLcDFWCfVFIvEJZ2 Yt9drTiVbfMlGJ1DUs8DnLnLR9ZvjSy4JJr4OqoDFaBMqhMhfvfqhIca9IDtky+VTGmzROKGUrb Bq2jwbRoEVOKnmEstLGOFU= X-Received: by 2002:a17:90b:1d44:b0:38e:57a3:f218 with SMTP id 98e67ed59e1d1-39d9c234a8emr756689a91.13.1789072793029; Thu, 10 Sep 2026 13:39:53 -0700 (PDT) Received: from tach01.nordicsemi.no ([183.83.138.150]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-14365ba71cesm1010807c88.13.2026.09.10.13.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 13:39:52 -0700 (PDT) From: Chaitanya Tata X-Google-Original-From: Chaitanya Tata To: hostap@lists.infradead.org Cc: Chaitanya Tata Subject: [PATCH 1/2] NAN: Use __builtin_ffs() instead of ffs() Date: Fri, 11 Sep 2026 02:09:47 +0530 Message-ID: <20260910203948.443913-1-Chaitanya.Tata@nordicsemi.no> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260910_133953_975462_0FD28C40 X-CRM114-Status: GOOD ( 14.43 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: ffs() is declared in only when __MISC_VISIBLE, __XSI_VISIBLE >= 700 or __POSIX_VISIBLE < 200809 (glibc and picolibc both use this scheme). Building with _POSIX_C_SOURCE=200809L and without [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:39:0:0:0:10 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [chaitanya.mgit(at)gmail.com] -0.0 DMARC_PASS DMARC pass policy X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org ffs() is declared in only when __MISC_VISIBLE, __XSI_VISIBLE >= 700 or __POSIX_VISIBLE < 200809 (glibc and picolibc both use this scheme). Building with _POSIX_C_SOURCE=200809L and without _DEFAULT_SOURCE/_XOPEN_SOURCE, a legitimate and fairly common strict-POSIX build configuration, therefore hides the declaration and fails with an implicit-function-declaration error. Reproduced with plain gcc -D_POSIX_C_SOURCE=200809L (glibc), no special build options otherwise required. Use the always-available __builtin_ffs() compiler intrinsic instead, which needs no header at all. Signed-off-by: Chaitanya Tata --- src/nan/nan.c | 4 ++-- src/nan/nan_util.c | 6 +++--- wpa_supplicant/nan_supplicant.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nan/nan.c b/src/nan/nan.c index 0a5439ad1..fc69da715 100644 --- a/src/nan/nan.c +++ b/src/nan/nan.c @@ -2933,7 +2933,7 @@ nan_peer_get_committed_avail_add(const struct nan_data *nan, return; } - idx = ffs(le_to_host16(bc_chan->chan_bitmap)) - 1; + idx = __builtin_ffs(le_to_host16(bc_chan->chan_bitmap)) - 1; if (idx < 0) { wpa_printf(MSG_DEBUG, "NAN: No channel found in chan_bitmap 0x%04x for oper_class %u", @@ -2961,7 +2961,7 @@ nan_peer_get_committed_avail_add(const struct nan_data *nan, op->op_class); return; } else { - idx = ffs(bc_chan->pri_chan_bitmap) - 1; + idx = __builtin_ffs(bc_chan->pri_chan_bitmap) - 1; if (idx < 0) { wpa_printf(MSG_DEBUG, "NAN: No primary channel found in pri_chan_bitmap 0x%04x", diff --git a/src/nan/nan_util.c b/src/nan/nan_util.c index 78dcde0a3..22ddd7914 100644 --- a/src/nan/nan_util.c +++ b/src/nan/nan_util.c @@ -934,7 +934,7 @@ int nan_add_avail_attrs(struct nan_data *nan, u8 sequence_id, while (map_ids_bitmap) { struct nan_channels pot_chans; - u8 map_id = ffs(map_ids_bitmap) - 1; + u8 map_id = __builtin_ffs(map_ids_bitmap) - 1; u16 ctrl = map_id << NAN_AVAIL_CTRL_MAP_ID_POS | NAN_AVAIL_CTRL_POTENTIAL_CHANGED; @@ -1462,7 +1462,7 @@ static int nan_get_control_channel(struct nan_data *nan, u8 op_class, if (!op || op_class > 130) return -1; - idx = ffs(cbm) - 1; + idx = __builtin_ffs(cbm) - 1; if (idx < 0) { wpa_printf(MSG_DEBUG, "NAN: No channel found in chan_bitmap 0x%04x for oper_class %u", @@ -1498,7 +1498,7 @@ static int nan_get_control_channel(struct nan_data *nan, u8 op_class, return -1; } - idx = ffs(pri_cbm) - 1; + idx = __builtin_ffs(pri_cbm) - 1; if (op->bw == BW80 || op->bw == BW80P80) return freq - 30 + idx * 20; diff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c index 18057c366..ded125dda 100644 --- a/wpa_supplicant/nan_supplicant.c +++ b/wpa_supplicant/nan_supplicant.c @@ -2514,7 +2514,7 @@ wpas_nan_fill_ndp_schedule_chan(struct wpa_supplicant *wpa_s, #endif /* CONFIG_TESTING_OPTIONS */ tbm->duration = wpa_s->nan_capa.slot_duration >> 5; - tbm->period = ffs(wpa_s->nan_capa.schedule_period) - 7; + tbm->period = __builtin_ffs(wpa_s->nan_capa.schedule_period) - 7; tbm->offset = 0; tbm->len = bitmap_len; os_memcpy(tbm->bitmap, bitmap_data, bitmap_len); From patchwork Thu Sep 10 10:39:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya X-Patchwork-Id: 2302196 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=f19Hrcs7; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=sareWolx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hgqMj3FpGz1xxw for ; Fri, 11 Sep 2026 06:41:21 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LHiGDwfAKtLjmfWTT2GTlXpIkFGlE3BwbY+qxSXOyn4=; b=f19Hrcs7AgUwqg VLtc7RpgGg6Sfkz8ABTyB9zBweEBPPV8clvYiaSKGNxmkYRFu7FHNNvCAoYfDKSRvefXHMEWh7Ob5 tjLEzymuIWABceVAOtixPdwQT3/glOoNR0154cD9AW2wD8D/Qw1B6iPzzOTzV8rCNvHyfmuMgEbKO ANCW19cl2waE4I4y7eEthOcG6Cf9S6PUxSM2FtKFqYGMq0tnojAd3TV0nnQtUo67Y7H2br24EMrN6 SKrMMDqJq4FwDQ8Rke3ag/F6ZG1jhrM7l9vNLdCwhe6PPurSSjt1ovcwAsHqeBpdodiIwCbkcFHip lj+/Zqz1I3lt+k6hfszg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x4lYs-0000000FLt8-3gYM; Thu, 10 Sep 2026 20:39:59 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x4lYp-0000000FLsX-4AG9 for hostap@lists.infradead.org; Thu, 10 Sep 2026 20:39:57 +0000 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-3856d6fbcb3so160773a91.2 for ; Thu, 10 Sep 2026 13:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789072795; x=1789677595; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=EkH7so80a7aIk0NYZdzkE+14DHLF55GpUd8v10lnZsc=; b=sareWolx/Oejj27iXL6vpLvoyU1aC1LJDyrL2yZx3X4VKMh7gIyXHyV3YkTYIQVmjl ddbfqyYUoICHEz995CJukIihTmiOR9bJ70tAjJEwYNMAmH3U5s6lRi85h87mZtWAXHlu fQ/jg8jnkfLVksahywLVX5ABTJ4uzJPzTTUhYyBdqnCAjmE7y6WeyyFZAyg5X9dFGW1f 1oo+lEBsLlg6UyFU0C6N4zVo+RpXo5eOGc6ZdmgQhpAjAFNZw9IHJ1yscBiRvMbBJ6Qw tGMmDUv5/rcfstXemfQEEuFviuIGiLHlGGeKyuTkyKNfnkSERI0XLDuclq4X+dr9+ZT2 l6BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789072795; x=1789677595; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=EkH7so80a7aIk0NYZdzkE+14DHLF55GpUd8v10lnZsc=; b=clUVl7SUkPMcsACtogoJlImFF+x0spgwLK3LhevvLdXk5GP0kR20yV5LkXYP33WSCP XkGrMco4PqUUVqg3N82Qct5qyoWqUztLtkjbFv52Am2g1vtEcRAy59OudtIj8mSO15Ss 8GrcGobRbWo5F/Bxj7lm5lToYssTnNLYGa+MzUp4qv2fA2nnhuA6g2laTB4OtgjJuYMZ PiJ+GrpD8oQ7aprnIN5BK7OIqX6dsTPDxyhhnzQ8dmY4XZxlCv7LRS4ibWYMu88K9bJK pCXeCG5zwA9EnpQRPKeZUhulylWND9UWua9D2Aaq/RBO9ulWydyx4jFp7EELN/ICE2dl VxQQ== X-Gm-Message-State: AFuF++kEI3kkNXmzTDV2VMKQ9hdSQ2ZnUIxmzvvt2AUMhqzffctku6i5 A3fRcxMqFAKhMjXjIuv8yjWEr7MTQJelp4Uz86a1ZZLGHz9sobuo22Ce/IDDSg== X-Gm-Gg: AYBFou1Bw/B5hCGPWKmMCQrUdjXCbbbJo04e39KPFTgLz86Cberh+tL5wuy30zEsiQC h+G5mmknEEFSUyES0JP9jIrxf8EGRS698flJ7o1IflCdJmZ0yC9quGz3h5Jq/bUVuW9Nzm07E2T f4q+1ezilwRwHga65uPxuBzT9VuAcZ0B74RnSpKmFW1eGgKKBQ/QElYnBzT+LClj7r8NoiMavTQ rhFWooNLC26xxkt1WNuzPGxETD9qaz7fe313WeZhLkc1Hiw4o7hs/0zLAobNNYOBndG9iGKKGa8 6KOXNeLKURQYh7cS0LAn97vs6T1J+DUT6SC2QZXhDWjgVHwUhpuvfwkv580ts0g9QtAm1vyxJd7 iw6+fkRuRa6CyYEKcHI8y2pBMJA9Eq+iUIzBOrkM6LM9IpcSM1b48BjjoPuZ9j0I2oFHui5uYzz 1pPsPSckFehfVXw5DEg0VWSiozJt/60v5NCkzxJwmUjVnne3lkKY+ZwC8LmPBE+uCmpX8x7zBt1 zUCM0vxnZA7+P2muFHBSgc= X-Received: by 2002:a17:90b:39af:b0:398:bf7e:b267 with SMTP id 98e67ed59e1d1-39d9bc0cdcfmr796093a91.2.1789072795145; Thu, 10 Sep 2026 13:39:55 -0700 (PDT) Received: from tach01.nordicsemi.no ([183.83.138.150]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-14365ba71cesm1010807c88.13.2026.09.10.13.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 13:39:54 -0700 (PDT) From: Chaitanya Tata X-Google-Original-From: Chaitanya Tata To: hostap@lists.infradead.org Cc: Chaitanya Tata Subject: [PATCH 2/2] NAN: Fix maybe-uninitialized warning in nan_sec_rx() Date: Fri, 11 Sep 2026 02:09:48 +0530 Message-ID: <20260910203948.443913-2-Chaitanya.Tata@nordicsemi.no> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260910203948.443913-1-Chaitanya.Tata@nordicsemi.no> References: <20260910203948.443913-1-Chaitanya.Tata@nordicsemi.no> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260910_133956_054046_222FE075 X-CRM114-Status: GOOD ( 11.59 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: instance_id and capab are only set by nan_parse_sec() on some paths (the else branch sources them from ndp_sec instead), which is enough to defeat GCC's flow analysis at -Os: it flags both as possibly [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [chaitanya.mgit(at)gmail.com] -0.0 DMARC_PASS DMARC pass policy X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org instance_id and capab are only set by nan_parse_sec() on some paths (the else branch sources them from ndp_sec instead), which is enough to defeat GCC's flow analysis at -Os: it flags both as possibly used uninitialized when copied into ndp_sec->i_instance_id/i_capab, which is fatal for any -Werror build. Reproduced with plain gcc -Os -Wall -Werror=maybe-uninitialized (GCC 13.3.0), no special build options required. Initialize both at declaration to keep such builds working. Signed-off-by: Chaitanya Tata --- src/nan/nan_sec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nan/nan_sec.c b/src/nan/nan_sec.c index 8561c7cd3..2ea267717 100644 --- a/src/nan/nan_sec.c +++ b/src/nan/nan_sec.c @@ -596,7 +596,7 @@ int nan_sec_rx(struct nan_data *nan, struct nan_peer *peer, size_t shared_key_desc_len; u16 info, desc, key_data_len; size_t total_len; - u8 instance_id, cipher, capab, gtk_csid = NAN_CS_NONE; + u8 instance_id = 0, cipher, capab = 0, gtk_csid = NAN_CS_NONE; u8 *pos; int ret;