From owner-dev-commits-src-all@freebsd.org Wed Jun 16 16:21:05 2021 Return-Path: Delivered-To: dev-commits-src-all@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 822B6665296; Wed, 16 Jun 2021 16:21:05 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G4r5r5MwHz4jTp; Wed, 16 Jun 2021 16:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 95E851EFBA; Wed, 16 Jun 2021 16:21:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15GGL4vJ007119; Wed, 16 Jun 2021 16:21:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15GGL4E6007118; Wed, 16 Jun 2021 16:21:04 GMT (envelope-from git) Date: Wed, 16 Jun 2021 16:21:04 GMT Message-Id: <202106161621.15GGL4E6007118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 1a3a57d74590 - main - kdump: use VIS_NOLOCALE when printing output MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a3a57d74590bb44e96629aec35897b475bd69fa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2021 16:21:05 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=1a3a57d74590bb44e96629aec35897b475bd69fa commit 1a3a57d74590bb44e96629aec35897b475bd69fa Author: Alex Richardson AuthorDate: 2021-06-16 15:28:27 +0000 Commit: Alex Richardson CommitDate: 2021-06-16 15:28:27 +0000 kdump: use VIS_NOLOCALE when printing output Attempting to parse the output as UTF-8 exposed an out-of-bounds read in vis(3) (see https://reviews.freebsd.org/D30771). However, I don't think it makes much sense to decode this output at all. Additionally, passing one byte at a time will almost certainly result in incorrect output for multi-byte characters. Reviewed By: brooks MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30772 --- usr.bin/kdump/kdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 05988f43133e..d863fffea774 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1638,7 +1638,7 @@ visdump(char *dp, int datalen, int screenwidth) printf(" \""); col = 8; for (;datalen > 0; datalen--, dp++) { - vis(visbuf, *dp, VIS_CSTYLE, *(dp+1)); + vis(visbuf, *dp, VIS_CSTYLE | VIS_NOLOCALE, *(dp+1)); cp = visbuf; /* * Keep track of printables and