From nobody Fri Sep 04 02:57:11 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hbh2g1FkXz6qt3x for ; Fri, 04 Sep 2026 02:57:15 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hbh2f3W0Fz4376 for ; Fri, 04 Sep 2026 02:57:14 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-51c08df8513so4430401cf.3 for ; Thu, 03 Sep 2026 19:57:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788490634; x=1789095434; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=jtrerB4k9Kr8CSMuwt9FiGXSvf0jhYxGa/SM/Om60nM=; b=UoFBPdMEmDFcxWEDLt85Y52GUgqJGFE0dUOEoijEaqqdpVXHmnUCAKXn5wf+ViK5gt b9NrWiNt00QBrAnhIG58RHmc2DLAP8ftd1z12ts5CyTlwh1nuKwVuoYthe/CpuxYi1ay awF5kQQ6YnYuyr+Wylx+kDvk5pCIwQecJ67Nf6iULKQM1EYgYSIae7qVY/Gt3OqhTCeO AFkGHlIsvSPhI8vJ/9/Z7Xc8h2VhWWc7yiGujmzknCodyMAXzaMmjtX6lCWuzRBww+En I3Lpf3lPCD9KPhqXm6yzMeUOu7lvewSQEz7jXlTSxg/1/Uj0/w/zkcD8b6oyTppA8QVL kStg== X-Forwarded-Encrypted: i=1; AKwUvBzjI/wscNGP5yjRoVy1IcqNEzoVkdWLClvSfT1MgKIpRbh3UoUgagnyiKhu4LBV84Cb+lubiIJI04GV5df7FSDQayQt@freebsd.org X-Gm-Message-State: AFuF++kMuj/l8b915dE8W2nhT/4tclD+jcVfSgwMMn0uAwrT7Gt8+pxn X7c5E0XcTPIkeiaCwyz/gCqdjW1fksr/zJsIT1Gpv7y7k/LMvQjfECj+ X-Gm-Gg: AYBFou16mKD6XKxkDDXfNAibHDhbsX53MvV0hqWDQyDrOiVRLYwUh//Umkfjz0lRIFl +YSYtVqARYlwM8+4Kv6sxOXIL+iF/+d96I+9V7DC4XIUEUa0vJMVY8ZC7D81xADI6obiwzGFX3Y 6F6Eaadp2S22W4fR0+CREhQeJW37ra9hBi1OMNiOSvfhUOAbs1O1nOgw2HqcHmFoMLdfGsxA1pE DxAr3WAXgRbrDGPCA9kLJVWV54IPvqO5rO02JH58ArZIYMmW/m3XrLQIlllechBwXYT0M84ttho gxChJd1x4nUtk07VkED74WcdEZTJfgmAzibSYg+XZY71mtu4C6tz49BiAOD0mjggiKGmKuRFpOv 79CmfmzKtrOJSQvWgCTLRrrgkiq+CjEaN5JdtFJZfpkExhEMTCJglC0t7eqIaBLTFjqUqlEkxJ8 6d3fnHXaZIR20yOnH4SiaWGun3VFulWWJe0OWuxiJYAVeEfqNdOkZnhYXImNUPHnou3t4fES7SC 573cWUdCmRr59heat7TJL35J/b8DHek4Q== X-Received: by 2002:a05:622a:991:b0:52f:b495:e9a5 with SMTP id d75a77b69052e-530549c537cmr44222931cf.37.1788490633507; Thu, 03 Sep 2026 19:57:13 -0700 (PDT) Received: from FreeBSD.org ([2001:470:8:34c:781d:5563:22c8:db31]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5305413ce9dsm10744401cf.11.2026.09.03.19.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2026 19:57:12 -0700 (PDT) Date: Thu, 3 Sep 2026 22:57:11 -0400 From: Glen Barber To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 8646d65b4533 - main - hastd: Fix crash on empty message Message-ID: References: <6a9928d3.212f2.16eadf76@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="b3n6okpatpx4dilm" Content-Disposition: inline In-Reply-To: <6a9928d3.212f2.16eadf76@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4hbh2f3W0Fz4376 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Spamd-Bar: ---- --b3n6okpatpx4dilm Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: git: 8646d65b4533 - main - hastd: Fix crash on empty message MIME-Version: 1.0 On Thu, Sep 03, 2026 at 07:59:15AM -0500, Dag-Erling Sm=F8rgrav wrote: > The branch main has been updated by des: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D8646d65b45339642d4aab1de35= a2bc79fc45f09e >=20 > commit 8646d65b45339642d4aab1de35a2bc79fc45f09e > Author: Glen Barber > AuthorDate: 2026-09-03 07:51:28 +0000 > Commit: Dag-Erling Sm=F8rgrav > CommitDate: 2026-09-03 07:58:54 +0000 >=20 > hastd: Fix crash on empty message > =20 > A HAST message can be empty, in which case ebuf_add_tail() does nothi= ng > and ebuf_data() returns NULL because the size of the ebuf is zero, but > hast_proto_recv_hdr() asserts that the return value is not NULL, > resulting in an immediate crash if hastctl or hastd receive an empty > message. This is trivially reproducable by running `hastctl status` = or > `hastctl role init` (as the rc script does prior to stopping hastd). > =20 > To avoid this, don't try to grow the ebuf or receive additional data > if the header size is zero. > =20 > PR: 298085 > MFC after: 3 days > Reviewed by: kevans, gjb > Differential Revision: https://reviews.freebsd.org/D59306 > --- > sbin/hastd/hast_proto.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) Thank you! Glen --b3n6okpatpx4dilm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJPBAABCAA5FiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAmqaM38bFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMCwzAAoJEAMUWKVHj+KTCB4QAJYvlD6BAMFZPJzyh072 cG1Q0B2LQ2ZjPXRVVwpoKojT3YSObZ1ZClVdMqexHoXUywa82yYYftzRzm2v6Bs9 pHz2c7cC4V0vhs/ZC8TZwA6d5uNViI1q+OAoBr2pYSMBs5YE/k5TGDjhnOmh8YrZ mfklqkQ/kKDeCTkp6tO80TEmiOMpPEKLTxBBtLztHhtN3SQqAsy4aQMnBP8AT1ag zSEaP6cOr4kg251+GiBtYislWCGcvccNgPSDl3NhQe5x5eutEyhpWt2flqUfZ0WT T/zP/5qJ+eYs6Mm0kfAa56NuiB8mhP21HOJ1QKdkvMafIXYqnKxhYNKg8JhfSqJS aUaPBWC4WwV+/5hoLo7TEs0dTLuvlOEH2th96i9Sz1UoVRycj1gqrY3WmlIu53Uk /feIqsRjVNPWJGJwZwQLoXeD43db89gOIeiOaQdLaYG6NqhspQIM0GUzGmUdWvqj w24UkFjaHH0uoLtlmaMm6JyQx8bVW42IBT3UB8xiiL7XgALrLUoYANqk0tLPaNA0 +imZiwZFPZnXVhXOEWl2cFvBRa6G4OEpAM2MhPu/lFFyAhg6Lwe9M2t9CG/0frYd 1zUdM67QUYdyAWTOW3A9puugS8/GhNHzgG8pGwGX+ptF6dR3XsoLwy/l3xEDyBWX pKNxAyDF7ufhhMXIsKW3feNB =bNC+ -----END PGP SIGNATURE----- --b3n6okpatpx4dilm--