From nobody Thu Dec 08 23:40:16 2022 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 4NSrHP1V3Xz4jnVC; Thu, 8 Dec 2022 23:40:17 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4NSrHN3tpdz3tTk; Thu, 8 Dec 2022 23:40:16 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net; dmarc=none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 1D4B13C0199; Thu, 8 Dec 2022 23:40:16 +0000 (UTC) Date: Thu, 8 Dec 2022 23:40:16 +0000 From: Brooks Davis To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 1055bedbed42 - main - pw: Don't return a pointer to an on-stack buffer from grp_set_passwd. Message-ID: References: <202212050030.2B50UYka069607@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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <202212050030.2B50UYka069607@gitrepo.freebsd.org> X-Spamd-Result: default: False [-1.79 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; AUTH_NA(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.991]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; R_SPF_NA(0.00)[no SPF record]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; FREEFALL_USER(0.00)[brooks]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4NSrHN3tpdz3tTk X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N On Mon, Dec 05, 2022 at 12:30:34AM +0000, John Baldwin wrote: > The branch main has been updated by jhb: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D1055bedbed42dc176468b45b4f= 167a752ed8868f >=20 > commit 1055bedbed42dc176468b45b4f167a752ed8868f > Author: John Baldwin > AuthorDate: 2022-12-05 00:28:22 +0000 > Commit: John Baldwin > CommitDate: 2022-12-05 00:28:22 +0000 >=20 > pw: Don't return a pointer to an on-stack buffer from grp_set_passwd. > =20 > Make 'line' static to move it to .bss instead as that pattern is used > elsewhere in pw(8) (e.g. the static buffer in pw_pwcrypt). It continues to astonish me that compilers allow stack pointers to be returned at any warning level. I think casting the result away completely might manage not to be undefined behavior, but even a dead store is UB. -- Brooks