From nobody Wed Apr 10 15:19:13 2024 X-Original-To: dev-commits-src-main@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 4VF61Y5Fr8z5HHSQ; Wed, 10 Apr 2024 15:19:13 +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 4VF61Y3DvMz4n0Q; Wed, 10 Apr 2024 15:19:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712762353; 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=DcqHQ0iU96wFecnYyFdL85M1bUOeN+SVIxh5yAmF5ME=; b=BNwOlKlGNBK5Lkam9yi8+9wanIV5yvwktddepTZJl1mZlv6M/U7W4zJ8iL9aZLN7h71cqx UeeM2Xjm45MZ+bMFQ1gRGHWnjZZ0j+ftmGBcQWAnjzEuKsC8Cf5RGCOd0pL9MXz+jxEWcY CmMpSfy1D+Hl5+OM1VVO70xk9XJvvHzXHJEHxgTvK285AMUYwWP9Ip2u95ZHxFbX4/7krG d6ifyiT34w859dCUXfAR3InYPLK7V+Pp2GGH9Io+Ar9pLFzGB4LWrYAuhHTJrGGqUOJpgD sjoO3aGL4Brv3f37K8JvEt4ey/Wu8vbIZ1Q1lN/EUgcd2ECTpwWTWu2aFH2BFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712762353; a=rsa-sha256; cv=none; b=Hg+Kmcpc70G7FQaS57WCAX1p+ldHHG3JJ+zsa4PtkRthw1IH42LWoPKwXDPwPYVUTZyfxZ tlpzgxS5C+KRU25pKdqkpbzq65wzn2BETmaVqMwjlSci7n69j0ctIW2+FvAkN9SXZHx0ks eW9/W9DQG3o929q8U5irPwPgZJbGvwEU0HHFehqR/HJs8Qv0s8+9CEWDXnDKbJAtQLrb0K Xvbg155n15vn9l770ohpynAsLOxs9DqfXfFuZ2Y5dNUyrHUKBUYpjBXoYAyHp/FwuJkG6V jKMib9ft7nukYc5CNQoTo6+HgWCR9kD1v4hTvDpVZE4M5psNeh8pziu6XaGlcA== 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=1712762353; 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=DcqHQ0iU96wFecnYyFdL85M1bUOeN+SVIxh5yAmF5ME=; b=RRcXTzn6aqtVjf6wE7r0mbHhtdA0iX9WjXJIMIx6ZhYwggmzx6Qd0Izw0UgKJuH2x4wMk+ /C33NtOxPKpx0ALMZcyZnMtKzZ9G3r2Ok7Ali4tqQN0kwFiZEb9vykhC5RNxQsUTfDZ5if shbCmzMwfaeoUlFiN8CDZZIpLKNi2TyJFr9b+fMpsG8FQY49CSk+20CLzEPf9LRQ5UYOvJ Gh5cajVB6R34vy1F3JB5ZawEm38rp8teK1wD1fljHpzMs0mfA4mC+7r0lV9A4W9x493VV3 yIqSBzEXuobqqSQ37lAJ6imDGV+oJSrr82MvTQdLryrRXJs/d5qhakaWPaCisA== 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 4VF61Y2r83zjjb; Wed, 10 Apr 2024 15:19:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43AFJDtP093162; Wed, 10 Apr 2024 15:19:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43AFJDtI093159; Wed, 10 Apr 2024 15:19:13 GMT (envelope-from git) Date: Wed, 10 Apr 2024 15:19:13 GMT Message-Id: <202404101519.43AFJDtI093159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e499fdcb66b9 - main - libvmmapi: Zero out the structure passed to VM_GET_MEMSEG List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: dev-commits-src-main+owner@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e499fdcb66b9ef3d9fc3c626daaefe909c65a2ab Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e499fdcb66b9ef3d9fc3c626daaefe909c65a2ab commit e499fdcb66b9ef3d9fc3c626daaefe909c65a2ab Author: Mark Johnston AuthorDate: 2024-04-03 17:09:43 +0000 Commit: Mark Johnston CommitDate: 2024-04-10 15:17:56 +0000 libvmmapi: Zero out the structure passed to VM_GET_MEMSEG Avoid assuming that the kernel zeros the name buffer, it does not do this for zero-length segments. MFC after: 2 weeks Sponsored by: Innovate UK --- lib/libvmmapi/vmmapi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 073aaddf4c92..5dcad8a16703 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -371,6 +371,7 @@ vm_get_memseg(struct vmctx *ctx, int segid, size_t *lenp, char *namebuf, size_t n; int error; + bzero(&memseg, sizeof(memseg)); memseg.segid = segid; error = ioctl(ctx->fd, VM_GET_MEMSEG, &memseg); if (error == 0) {