From nobody Sat Apr 25 14:00:29 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 4g2s184vKXz6bXvS for ; Sat, 25 Apr 2026 14:00:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 4g2s180zz3z3CD3 for ; Sat, 25 Apr 2026 14:00:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-48a3e9862f0so44821265e9.1 for ; Sat, 25 Apr 2026 07:00:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777125642; x=1777730442; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rZ+7mUGAYkh3IJ09zbgnnw3SC2Q7Xs65OBdiYDGXeAc=; b=hWYIcMByM9FX5cAoqAAhgdDNFJiIQ0FcYtRr/NakLAYC9JJUZRzSo8YOBBVny9TSGF /gF/kM0R3iKioV4Xewx3QgEAlQeA/NmcS9PuGQWEp2LHSou45gdfFPI2sI7cSBCtcjze y3sT139lf97txh+MkQg5zq5xS3l+Om/gEuOaGVYD0xptXH6GtEfPxzI6hDBVuLwOFL1q 34JoBMIXv6bKc0ZQBGbWrounSi1G37aO+RECBBcK+zOBagRr0um4mW/yMCDu02EIP4Nh KOLUyF6P29rKz9ELn5Hgl87y1HjJ012WOjFg62muT69uc8SOHderLG2djjNLMYVAolJU yEMQ== X-Forwarded-Encrypted: i=1; AFNElJ/pNaO0oLhAk+IaOfjHAwHCjWF6E4agJTXklsJ/9CYbbJTpkY0CdWRD/nseLfwl6be54Gy90Jcc2Ms5Wyj3eUzzXp9F@freebsd.org X-Gm-Message-State: AOJu0Yyzpbwag2ma0veUXUYG8RcAVjrDhcD8wWULyadLFrtdRZsri2aC zcStwPpIuwKd8BC3Aq1AhTumoaf5TbI6RNZwjsaTIvwfpIBaPcJZda3wDYm5rfi2VnA= X-Gm-Gg: AeBDieszCrF+8IDrUp+BuGJkNiM39ccxd7DJ3nflLOuFUDmV75KkM4JW2JxAw+M/mkw VbPSiz9QUafpo5IsvFWv//0ve5tGbsmQrAMLukKP/USL2+WVh51WBmGU9kQAvBSdkt4lLzH+/lY p1U0rJkvv2b0oVEo8UUZX8tCTd/AgSH06UmHiGFTozLaXQXqj7SG7TOlFtUTJWtXK5BDUohcNaV rJwQiZMNIzMmpELD90gbbofmIIQyAoAzVNBj0xQZHZ6eroCnbOHWVQCEj0DSxWjC0MLYZBPIh41 R60kKuUhlLW/crCproriCoO+wdYrWlwbW24Wl/6KDweaHoeVUGVrZ9P0Fl+UAV/kBZcQU4s1JAI h3y6xd8JAzPa/E02e8ueWG/jObkbmHihWj2Lc8lu9DT+wjK+TwoGymtOdnaQ2EExCRlfMY6ojDR yi9DhjUQGsXTpNZ3I5MLF/GGu1jC2iJ9jmkAdWzZxWfVsv9NlXmL5QEMWm1nhYZwuCMaWPzQuCH BZ7fA== X-Received: by 2002:a05:600c:4e0c:b0:489:1d7a:4537 with SMTP id 5b1f17b1804b1-4891d7a463emr362315325e9.3.1777125641247; Sat, 25 Apr 2026 07:00:41 -0700 (PDT) Received: from smtpclient.apple (nat-184-78.net.cam.ac.uk. [131.111.184.78]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a575ad67asm288427615e9.2.2026.04.25.07.00.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Apr 2026 07:00:40 -0700 (PDT) Content-Type: text/plain; charset=utf-8 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 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: git: 753a166bdeb3 - main - imgact_elf: Fix uninitialized variable use in note_procstat_auxv From: Jessica Clarke In-Reply-To: <6BCE247D-8992-4603-8CFF-F7C87E464829@freebsd.org> Date: Sat, 25 Apr 2026 15:00:29 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Alex Richardson Content-Transfer-Encoding: quoted-printable Message-Id: <250813FE-84A4-4C61-8072-6CA106DADA41@freebsd.org> References: <69ecc4df.33991.53b0871@gitrepo.freebsd.org> <7DD33B7A-A4B7-4AF7-9EA6-CF65BF388500@freebsd.org> <673E90BE-4519-46D9-BF02-458830DCC304@FreeBSD.org> <6BCE247D-8992-4603-8CFF-F7C87E464829@freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3864.400.21) X-Spamd-Result: default: False [-2.85 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; NEURAL_HAM_SHORT(-0.95)[-0.949]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; RCVD_TLS_LAST(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.53:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.53:from]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; APPLE_MAILER_COMMON(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5] X-Rspamd-Queue-Id: 4g2s180zz3z3CD3 X-Spamd-Bar: -- On 25 Apr 2026, at 14:58, Jessica Clarke wrote: >=20 > On 25 Apr 2026, at 14:53, Dimitry Andric wrote >>=20 >> On 25 Apr 2026, at 15:46, Jessica Clarke wrote: >>>=20 >>> On 25 Apr 2026, at 14:42, Dimitry Andric wrote: >>>=20 >>>> The branch main has been updated by dim: >>>>=20 >>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D753a166bdeb3aeba02fd9678e7360f09= 29007368 >>>>=20 >>>> commit 753a166bdeb3aeba02fd9678e7360f0929007368 >>>> Author: Alex Richardson >>>> AuthorDate: 2025-09-15 06:27:12 +0000 >>>> Commit: Dimitry Andric >>>> CommitDate: 2026-04-25 13:42:16 +0000 >>>>=20 >>>> imgact_elf: Fix uninitialized variable use in note_procstat_auxv >>>>=20 >>>> Found building with latest clang >>>>=20 >>>> MFC after: 3 days >>>> --- >>>> sys/kern/imgact_elf.c | 9 ++++++--- >>>> 1 file changed, 6 insertions(+), 3 deletions(-) >>>>=20 >>>> diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c >>>> index af0841c75549..3c5fbe4df342 100644 >>>> --- a/sys/kern/imgact_elf.c >>>> +++ b/sys/kern/imgact_elf.c >>>> @@ -2712,13 +2712,16 @@ __elfN(note_procstat_auxv)(void *arg, = struct sbuf *sb, size_t *sizep) >>>> struct proc *p; >>>> size_t size; >>>> int structsize; >>>> - >>>> +#if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE =3D=3D 32 >>>> + structsize =3D sizeof(Elf32_Auxinfo); >>>=20 >>> Elf_Auxinfo *is* Elf32_Auxinfo for __ELF_WORD_SIZE =3D=3D 32? >>>=20 >>>> +#else >>>> + structsize =3D sizeof(Elf_Auxinfo); >>>> +#endif >>>> p =3D arg; >>>> structsize =3D sizeof(Elf_Auxinfo); >>>=20 >>> But it=E2=80=99s initialised right here? So that assignment is dead? >>>=20 >>>> if (sb =3D=3D NULL) { >>>> size =3D 0; >>>> - sb =3D sbuf_new(NULL, NULL, AT_COUNT * sizeof(Elf_Auxinfo), >>>> - SBUF_FIXEDLEN); >>>> + sb =3D sbuf_new(NULL, NULL, AT_COUNT * structsize, = SBUF_FIXEDLEN); >>>=20 >>> These are equivalent? Though this one at least I see an argument = for. >>>=20 >>>> sbuf_set_drain(sb, sbuf_count_drain, &size); >>>> sbuf_bcat(sb, &structsize, sizeof(structsize)); >>>> PHOLD(p); >>>>=20 >>>=20 >>> I really don=E2=80=99t understand this change at all. I think all = but the final >>> part should be reverted >>=20 >> I've only committed this because it's part of the llvm-21-update = tree, and on behalf of Alex. I think this was to suppress a bunch of = warnings, and I'm happing to fix it post-import, if there are no further = errors. >=20 > I mean, maybe once upon a time some early form of this patch was > needed, but I have no clue what warning this could possibly have been > fixing, it=E2=80=99s so clearly not right when you look at the diff. = So can we > please revert this now rather than maybe at some point in the future? > There=E2=80=99s no world in which this is sensible code to have in the = tree, > and if you don=E2=80=99t revert it, I will. If anything I would expect = this to > introduce *new* warnings due to the dead assignment to structsize > that=E2=80=99s been added. Probably 8a68c2509c00 ("imgact_elf: Unconditionally initialize a variable in a note handler=E2=80=9D) is what has made this diff become = nonsense and unnecessary. Jessica