From owner-freebsd-current@freebsd.org Thu Nov 7 15:08: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 D961E1B6E6A for ; Thu, 7 Nov 2019 15:08:33 +0000 (UTC) (envelope-from a@stacktic.org) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 4786H44c0vz3JVF; Thu, 7 Nov 2019 15:08:32 +0000 (UTC) (envelope-from a@stacktic.org) Received: from webmail.gandi.net (webmail28.sd4.0x35.net [10.200.201.28]) (Authenticated sender: a@stacktic.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPA id 9ABC5FF80D; Thu, 7 Nov 2019 15:08:28 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 07 Nov 2019 16:08:28 +0100 From: Arnaud Ysmal To: david@catwhisker.org Cc: freebsd-current@freebsd.org, phil@FreeBSD.org Subject: re: Segmentation fault in netstat after r354373 -> r354373 update Message-ID: X-Sender: a@stacktic.org User-Agent: Roundcube Webmail/1.3.8 X-Rspamd-Queue-Id: 4786H44c0vz3JVF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of a@stacktic.org designates 217.70.183.199 as permitted sender) smtp.mailfrom=a@stacktic.org X-Spamd-Result: default: False [-2.88 / 15.00]; ARC_NA(0.00)[]; FAKE_REPLY(1.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:217.70.183.192/28]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[stacktic.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[199.183.70.217.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:29169, ipnet:217.70.176.0/20, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-1.48)[ip: (-4.53), ipnet: 217.70.176.0/20(-1.59), asn: 29169(-1.26), country: FR(-0.00)]; FROM_EQ_ENVFROM(0.00)[] 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:08:33 -0000 Hi, I just got the same issue, it happens when argv[0] does not contain a / (calling uptime segfault but calling /usr/bin/uptime works). In xo_parse_args there is no check whether cp is NULL before calling xo_streq. I fixed it by changing this line: - cp = &cp[len + 1 - sizeof(gnu_ext)]; + cp = (char *)(uintptr_t)(const char *)(&xo_program[len + 1 - sizeof(gnu_ext)]); Arnaud Ysmal