From owner-freebsd-current@freebsd.org Thu Nov 7 15:15:33 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1971E1B7272 for ; Thu, 7 Nov 2019 15:15:33 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [198.144.209.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4786R81PPKz3K59 for ; Thu, 7 Nov 2019 15:15:31 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id xA7FFUdv057275; Thu, 7 Nov 2019 15:15:30 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id xA7FFUjA057274; Thu, 7 Nov 2019 07:15:30 -0800 (PST) (envelope-from david) Date: Thu, 7 Nov 2019 07:15:30 -0800 From: David Wolfskill To: Arnaud Ysmal Cc: freebsd-current@freebsd.org Subject: Re: Segmentation fault in netstat after r354373 -> r354373 update Message-ID: <20191107151530.GU1194@albert.catwhisker.org> Mail-Followup-To: David Wolfskill , Arnaud Ysmal , freebsd-current@freebsd.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Z7anUBlSj09l+zDK" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 4786R81PPKz3K59 X-Spamd-Bar: ------- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of david@catwhisker.org designates 198.144.209.73 as permitted sender) smtp.mailfrom=david@catwhisker.org X-Spamd-Result: default: False [-7.89 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:198.144.209.73]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[catwhisker.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[73.209.144.198.list.dnswl.org : 127.0.10.0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:7961, ipnet:198.144.208.0/20, country:US]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(-3.49)[ip: (-9.33), ipnet: 198.144.208.0/20(-4.46), asn: 7961(-3.63), country: US(-0.05)] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 15:15:33 -0000 --Z7anUBlSj09l+zDK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 07, 2019 at 04:08:28PM +0100, Arnaud Ysmal wrote: > Hi, >=20 > I just got the same issue, it happens when argv[0] does not contain a /= =20 > (calling uptime segfault but calling /usr/bin/uptime works). >=20 > In xo_parse_args there is no check whether cp is NULL before calling=20 > xo_streq. >=20 > I fixed it by changing this line: > - cp =3D &cp[len + 1 - sizeof(gnu_ext)]; > + cp =3D (char *)(uintptr_t)(const char *)(&xo_program[len + 1 -=20 > sizeof(gnu_ext)]); >=20 > Arnaud Ysmal Ah! Excellent analysis: thank you! :-) Peace, david --=20 David H. Wolfskill david@catwhisker.org It's ... rich ... for Trump to accuse someone else of being a liar. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --Z7anUBlSj09l+zDK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE4owz2QxMJyaxAefyQLJg+bY2PckFAl3ENRJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEUy OEMzM0Q5MEM0QzI3MjZCMTAxRTdGMjQwQjI2MEY5QjYzNjNEQzkACgkQQLJg+bY2 PcnzHAgAqTAQosIcyxn6JT1qehvtF544V2yQOwVI6+0r8sQvUlnHWAsjh6re36+O uQzqchccMyxZxsWqNjactV/N4YILHOO4mGW9B+AUAs4cl6EwQbgLZu8G0L1pTQhw Xqgrqp15oiqwFcLiUuWrIt6X9q7TbmdCkb1D1tvjZ/s3rTfK266vZDA2JHqJ254c 2ACKJRsy7dRxfgA5A8I3tLh3OdyX4EbpdKrkfgrB7YBOyJM+tRKb8bxS7rmTpx9W XNseX0k/aeuUFmRNthUHVDWSuKHfBFyCAezMui6hPgBiRCew/LAuiznVdEQCxnwF ZZyi5kp4H/qp+Gj7q4UzPM4iKgyrNA== =S2bj -----END PGP SIGNATURE----- --Z7anUBlSj09l+zDK--