| Message ID | 20251008202035.1807690-1-mattbob4@gmail.com |
|---|---|
| State | New |
| Headers | show
Return-Path:
<hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>
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=1qZDlFDY;
dkim=fail reason="signature verification failed" (2048-bit key;
unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256
header.s=20230601 header.b=SXp7tK95;
dkim-atps=neutral
Authentication-Results: legolas.ozlabs.org;
spf=none (no SPF record) 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 4chkvW6QQLz1yHM
for <incoming@patchwork.ozlabs.org>; Thu, 9 Oct 2025 07:22:29 +1100 (AEDT)
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=8dCiPmRutuJeaqlhpt9SDVow2dbfBoK5h1g0nOyv3Bk=; b=1qZDlFDYE+nXW4
2Umwtwtq3MjqJQodtYGzmmOT6wuZYMGFIQkOW2X40NLX0rvW69Lgx1oS0c+ecT3aa2AEGkpR5wYfg
SJtK6Q0Nn1wb1Cd6sainlKtV6f0hLvGtKAS+gHyscFCxwObPxB+6LrZAY55tE3Impd5Zv0kYRLT5e
k/6FgvLUo3xOY4+BNFkQN0o+nREZLm91rwkJYD7g30etpdsv1/rhTxbOd6uNt6Quto2k/Kkt9kri3
wCYJi7ANT8bjVyzJx/9cv3reswRNoEbUJxUy8FujL9AIPzCQjEcKuogjJXDx7xha0LIr9hmb0ogY9
wq6ULW5pF0/Ryvmb4wvg==;
Received: from localhost ([::1] helo=bombadil.infradead.org)
by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))
id 1v6afX-00000004cck-2c04;
Wed, 08 Oct 2025 20:21:51 +0000
Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534])
by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))
id 1v6afV-00000004ccF-3MvY
for hostap@lists.infradead.org;
Wed, 08 Oct 2025 20:21:50 +0000
Received: by mail-pg1-x534.google.com with SMTP id
41be03b00d2f7-b5f2c1a7e48so126096a12.0
for <hostap@lists.infradead.org>;
Wed, 08 Oct 2025 13:21:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1759954909; x=1760559709;
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;
bh=hqGKryTEFwPAFvcme3PU1IVwyECFgt8HAZEWYDpnSqY=;
b=SXp7tK95v3qc1AlekL2ASGs5xzjPGXtSWsmg/mC35WDYfFPoA86QraO2MvI73Byx9m
kGwNuqzEUqzfDl+kI9p+gmLYqZnKIxjeru5dYLl/T/n9tWEwbWOtRLWxCFgK89unbEVE
nBBl8MXly4t+LadPWfOh4B8A/BlP9pu+DEJC2rrFb0QzKxMKV2k1+LoZfqYrgyAWXLWT
xFDgCrrS5kQpdtaQffygSZSCUWS48Ti5lQ8uzJb9zcFdbo/5IV2dxuU5EPpxHy0Ap7ya
sX7n9WfFH07RzyQi9d5SIsh9RFVzfuU82n444pRWSxY2TKu+f+IVdLKnDB89i+m/ro/5
3aLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1759954909; x=1760559709;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=hqGKryTEFwPAFvcme3PU1IVwyECFgt8HAZEWYDpnSqY=;
b=YZrIx/sjxr0QuKbn0hQLGCygAtaPGHKDzi60aN4XK9VwwfN5sG64i3HeEoRG9TOVW8
rIr07wLfDdVhWjBOFm/Y/pg84z6pUNOwLWKRjhlFwkYnrUh33y2dMvqlSUgVjDBw3qNn
ORDGT7Yry1zDBBpauW127/7HwRwXzBJgVRe/RgkYmMcfpBLWPkOF0xnAjUh9fNcOKJoN
YBKhLD8OOnDGxy5UhXDgpzIPwK50NfusPzOA9ue7mHC0RuOnmnZn/hMxN6AjNKP0kHZd
C7w094+hnS3g4ewclmc7MMOz76gB27gocTnCqcRcFvryQQtbnmfQmIHEn9UY/dU1N/EF
vbeA==
X-Gm-Message-State: AOJu0YxZhzCu2omsysNKZTrN1ttDQi7TcRtAMusN2+JKHY2/CicG3rNh
4cV0EEfkWz7u5c8e4KhEkojWs3UgLWhfVQm/KprVnjdWvfjq1DmIqdxRed+9Rinb
X-Gm-Gg: ASbGncsZzsGPl/VQ3VP3eRRpuDAfqLiZk6iJP6VKF9rZHtsRB+JJaQpQaWSO8+jpuzI
GK1P2KR4eH03o6lWG8LIGV7mqtbVi9dDwvnUUIoo6JraS0r19MsFyJUa/iNlAgnx8+3vLrBD+3b
i165wDfPCpjC6MscDGrvr+uiDuL1O6FvG0n/SXoRdgj/draVZM/A+KGBesDO1zd9RdstMTYxM0c
N8iHHnNrqDd/ux86uyUBvwgVeQL/neujYj317OSTz1ehc8be+jDDkMq6tC0On/n+y1LyS23/ux1
KXaolmUlGYoQ9Qf8mMQLBGjMBlBdWxIk9KuxYVN5I1oA95owRwMFOADi753Z4vV1cvYIL5nBM42
6ZrVW4qkY+uxNwufBgS8ZxDsr4il/fZAtfDFqaIl2Hh3IFHd7ZOljCjtmUYtCr/g=
X-Google-Smtp-Source:
AGHT+IGWA+Ictgvb5zqBcDsflBWN11T37ON4e26HpbFTZReSt2GkEKjRIHeEGUT5uUzRxy19FxP0kA==
X-Received: by 2002:a17:902:e851:b0:26d:58d6:3fb2 with SMTP id
d9443c01a7336-2902729031cmr75201895ad.12.1759954908518;
Wed, 08 Oct 2025 13:21:48 -0700 (PDT)
Received: from mcather7560u20.lan ([136.36.87.252])
by smtp.gmail.com with ESMTPSA id
d9443c01a7336-29034f99fbfsm5741185ad.128.2025.10.08.13.21.47
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 08 Oct 2025 13:21:48 -0700 (PDT)
From: Matthew Cather <mattbob4@gmail.com>
To: hostap@lists.infradead.org
Cc: Matthew Cather <mattbob4@gmail.com>
Subject: [PATCH] Fix-up stale pointer after reconnect
Date: Wed, 8 Oct 2025 15:20:35 -0500
Message-ID: <20251008202035.1807690-1-mattbob4@gmail.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
X-CRM114-CacheID: sfid-20251008_132149_840678_52929929
X-CRM114-Status: GOOD ( 11.89 )
X-Spam-Score: -1.8 (-)
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: While investigating an issue with hostapd, I seem to have
stumbled onto a bug in `hostapd_cli`. The patch below is a sugested fix but
there may be a better approach. If our `PING` fails and we close the
connection
then our `ctrl` pointer becomes invalid. After reconnect we should replace
`ctrl` with a valid pointer.
Content analysis details: (-1.8 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:534 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_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 Message has at least one valid DKIM or DK
signature
-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
[mattbob4(at)gmail.com]
0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in
digit
[mattbob4(at)gmail.com]
X-BeenThere: hostap@lists.infradead.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: <hostap.lists.infradead.org>
List-Unsubscribe: <http://lists.infradead.org/mailman/options/hostap>,
<mailto:hostap-request@lists.infradead.org?subject=unsubscribe>
List-Archive: <http://lists.infradead.org/pipermail/hostap/>
List-Post: <mailto:hostap@lists.infradead.org>
List-Help: <mailto:hostap-request@lists.infradead.org?subject=help>
List-Subscribe: <http://lists.infradead.org/mailman/listinfo/hostap>,
<mailto:hostap-request@lists.infradead.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: "Hostap" <hostap-bounces@lists.infradead.org>
Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org
|
| Series |
Fix-up stale pointer after reconnect
|
expand
|
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c index 95f7fd2d8..5efeceaf0 100644 --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c @@ -2189,9 +2189,11 @@ static void hostapd_cli_action_ping(void *eloop_ctx, void *timeout_ctx) eloop_terminate(); return; } + eloop_cancel_timeout(hostapd_cli_action_ping, ctrl, timeout_ctx); + ctrl = ctrl_conn; } eloop_register_timeout(ping_interval, 0, hostapd_cli_action_ping, - ctrl, NULL); + ctrl, timeout_ctx); } @@ -2210,10 +2212,10 @@ static void hostapd_cli_action(struct wpa_ctrl *ctrl) fd = wpa_ctrl_get_fd(ctrl); eloop_register_timeout(ping_interval, 0, hostapd_cli_action_ping, - ctrl, NULL); + ctrl, ctrl); eloop_register_read_sock(fd, hostapd_cli_action_receive, ctrl, NULL); eloop_run(); - eloop_cancel_timeout(hostapd_cli_action_ping, ctrl, NULL); + eloop_cancel_timeout(hostapd_cli_action_ping, ELOOP_ALL_CTX, ctrl); eloop_unregister_read_sock(fd); }
While investigating an issue with hostapd, I seem to have stumbled onto a bug in `hostapd_cli`. The patch below is a sugested fix but there may be a better approach. If our `PING` fails and we close the connection then our `ctrl` pointer becomes invalid. After reconnect we should replace `ctrl` with a valid pointer. Signed-off-by: Matthew Cather <mattbob4@gmail.com> --- hostapd/hostapd_cli.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)