From nobody Fri Sep 04 02:57:11 2026 X-Original-To: dev-commits-src-main@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 4hbh2g1GR4z6qtH7 for ; Fri, 04 Sep 2026 02:57:15 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (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 4hbh2f3fxmz42nS 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-f176.google.com with SMTP id d75a77b69052e-5303932c4f3so3502211cf.2 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=QskyYQUPJF2t3032dScIHGJ+CVN7CkXhW/sAPbi9MTIAFfd+a3ixMMh4XvBRR2QY7D 3IXYEyZ8nLwx2R98fK0XpIdMKbCGiPqm4Z9oHp03je/lc33Gf213pO6i77K5FUbaug6K qWEgwxJjHjB9NnAcT/sdiAF4YkY2HnUg8Q6fYFJ0JJUMTM4zpvP6PwPS1O/Emroy6B71 NnCt3bALUK2ZY8wiA2ookU/51wvG7680wqma6eEzgV1P+CmsKFD6ZIFr80LY/iRDIFla FsPJsQIPbM1RM/+WPGGYGHMrtjkLCGRP2BIYktuxAYRnGJmxnJaYcmvmQOj+c9T/Nh/G EJxg== X-Forwarded-Encrypted: i=1; AKwUvBxs72slCLOwR/3niTqSw5D2edha72ji1dxF5XstxTRsROQL61WFMvAQYuI/YBlZX6Dt+UtBlhUmJ8R6e4vW3BQ44HvgBA==@freebsd.org X-Gm-Message-State: AFuF++nWBdNI539fdlZFzKzhwaAKibuZSuZvrLKEVO9OJJ3Y7bMTUpNO AEA3lYdN+yVSIb8NvOMvS9FwaDFiqBREGyyFYb1Dk725HYAtqrpCxyUo X-Gm-Gg: AYBFou0VvlIIrx9IB+9FdyIOh8ZwYW6QA/cynSr4fFCFzVXDCwwv0lFwm0VCOqmVbBC Yg9Hymv+FQEHtIvgpz7N12r31X3SFgWihGigYqiAg9c16v7TZVjuMptMDmcZavFs4+3e1RPq0Ho 5euRXSzo4GHVmRaQ5hYaLg922n71g30OEqCIlCtfKVsdUIKuXC5FjXS1vLyBo4tdOTw8iphHJ/3 Kd3Leu+BARs5pQuNxl3+rKm7hg1OyeHBnudeBGUCSF/GdScI9bDxcLHiGFRBRQSLkhoJHZEHbST AhWGPx4nWQA9d8qj7jjMLytjc0J3Suminvof9cIE+zWznxc/2gzCmcgV8OPO2Otdv01eoz7V/D3 rDx0fK2aESfvtsjn5QWcyLT+JTqw8VsiWr1nEvdbS7C05uDUE9554UsMk9d9xXs0UH8hptPekQN VPs92fqmQuNSxqWT7mT+WcHHl5IHWB3XULwUWpNn1Z93ywpE6vgTd3olI4uCKQXPaA2PFRDshSx dvAvu4qrgT/i2u6MaKGae6YOOLTCmHTpA== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4hbh2f3fxmz42nS 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--