From nobody Sun Jul 14 18:02:03 2024 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 4WMY7c0bspz5R6BG; Sun, 14 Jul 2024 18:02:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WMY7b4JgFz4V5P; Sun, 14 Jul 2024 18:02:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720980123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l2AkDHKZvZlsHgXLAeOhi3mgKgV/0Umph7izxQ6aEKA=; b=aCMYQWFHGK9pM7JfsZPvxeoQ9BZ3aeAOIxFbvo5eLX4cJndrqRmimuEwLItFobpxFx5c/r mLaibFiUQjV7fJEEI5MDy3MEIDemIHqsWEfZKcMmWjcSu7JPm7VhipsI2G/xWPcZRuXI5F LAP++uacUCQ/4i9GBG8MH2Bv3rQxrE2i377LC3kmqCdg4azv96cK/UzwdiQp7JCHJP63oJ m8cN+W8MVcvQYWf/zIfQTkbgkfIE0mp19KXlf+F4E3LNtpOSL3XfbuCMrpRiSpIIn3QH8q 3/kPYsKWZsHWhNii6z3b9wDDNxGysW720MplMfjA3j/tPMw7KTcgtlHtn1TuSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720980123; a=rsa-sha256; cv=none; b=BPij1od5ex0YBmyZpDmIj1KFNj8IBz8RRhuSLxJE8dTGnkelNxAjT7sHIAzJiliDDjsq4s 4pQtk8qIes3qj1gbpLoBshZkOhODKBgj8pEguLeUujnkildvqGUsh/2OhM3aTcQAWik5WH 2k9txrsHo1dIaFkaNn5CGdj87MDMkmkCmzCJdTnOhGj+dfcnCPLsrMapin6oR9YwMjHUoS iilS4wpAdmMcp+rQXhaTMraIPKpGNd3ZGpe01W7dw5TL8q1eqhzehJHnRgy86vzIH1bl6V eDvop9wP4WQlhRZ6bJ/KI0H5deSBaXHZCowEaLnrzvY+fqsdvsDqb95Hkzs5Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720980123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l2AkDHKZvZlsHgXLAeOhi3mgKgV/0Umph7izxQ6aEKA=; b=MPI1xRTyXAF5gQ/IJ+Sydv+27RoFqmnsB5SWnDQ0l7rWG8aQsICthBx75E/uO3zSiFQfpr 8juH4p6+5dA7yo3MxHG2ia4KMkZENpRiP/h4VRfd+DuVMc/JPy2l7SJLl5uIPU8NQHHwt8 KJjyEwDneslkgUhIYV9eLgN4rvTIwr7iufEvw+U5md0Dpw+GrecrZmvZj4hQzFH2quQWci xF1ZA3pJ+awRBRYFVsVFipV6Ma6Keiz72oM+s4gB8F8A2Z4WrYwaHS3jjudXb07Us2T6uk VKgK6ET8L24QW00Uwini7gaOjwc5V+tCtk6K3eZGAerWdbrg4zImZPwAYiWPWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WMY7b3w55zK7v; Sun, 14 Jul 2024 18:02:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46EI230W074737; Sun, 14 Jul 2024 18:02:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46EI23iO074734; Sun, 14 Jul 2024 18:02:03 GMT (envelope-from git) Date: Sun, 14 Jul 2024 18:02:03 GMT Message-Id: <202407141802.46EI23iO074734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 82dfbaf7e7ca - main - rtld-elf: Fix signed conversion for %hh 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82dfbaf7e7ca1334960ee918fa1b4eb2537d444b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=82dfbaf7e7ca1334960ee918fa1b4eb2537d444b commit 82dfbaf7e7ca1334960ee918fa1b4eb2537d444b Author: Warner Losh AuthorDate: 2024-07-14 18:01:43 +0000 Commit: Warner Losh CommitDate: 2024-07-14 18:01:43 +0000 rtld-elf: Fix signed conversion for %hh While char is signed on some of FreeBSD's architecutres, it's unsigned on others. So the naked 'char' cast here needs to be 'signed char' because in this context, we want the signed interpretation. We don't really use %hh conversions in the run time linker, so this is likely a nop. However, for correctness, we need this, like we did in the kernel in fc3e5334ab89. It's a nop on x86 and riscv due to defaults as well, but does fix a bug on arm and powerpc where char is unsigned. Suggested by: kib Sponsored by: Netflix --- libexec/rtld-elf/rtld_printf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld_printf.c b/libexec/rtld-elf/rtld_printf.c index befac1c547b7..45c0bdc00b29 100644 --- a/libexec/rtld-elf/rtld_printf.c +++ b/libexec/rtld-elf/rtld_printf.c @@ -367,7 +367,7 @@ handle_sign: else if (hflag) num = (short)va_arg(ap, int); else if (cflag) - num = (char)va_arg(ap, int); + num = (signed char)va_arg(ap, int); else num = va_arg(ap, int); number: