From nobody Fri May 20 14:36:33 2022 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 BA55F1B37492; Fri, 20 May 2022 14:36:33 +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 4L4TnF4dGgz3hlw; Fri, 20 May 2022 14:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653057393; 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=1O28EBOrSIyB4viLLeWa3SazyHePdMlj3l2iIQwkWhA=; b=UtbVYV7/o+pfcWzp+S3YgwrqfqOQ9dZtfD3aPWop7TZxJfMbS/fy6Lhe+QcJrOqPKDd+e2 dHl4ope+uGW8alG3K/vpL611gKVgiObOQDW0ZIwnF+03ahribD6wUCXSfqfwqFcQJRcxnf mjEVbgJl8Mddkfi78YeZfjSoDPSKgWZg2tJTXCfXwIVhMK0k+XZZQEFyglTseNiMQqRzZ5 fHK8pknoswuUy52c70v6zTgG2EhAbRl8ahuTSjzjKlUf14FNwXJTK1czoPS6HVEzVFCXKO MPanYve+61Dhu87E/o9v3QoOxj/mtrIpLEIysU0sG4DyWAbhcxCQoB37vKkJQg== 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 7E10D1438F; Fri, 20 May 2022 14:36:33 +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 24KEaXrX028010; Fri, 20 May 2022 14:36:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24KEaXQl028009; Fri, 20 May 2022 14:36:33 GMT (envelope-from git) Date: Fri, 20 May 2022 14:36:33 GMT Message-Id: <202205201436.24KEaXQl028009@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: bcc3148c70c7 - main - libsa: Fix a bug in nvlist creation 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: owner-dev-commits-src-main@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: bcc3148c70c72cc409881e7a25e2bb053a39a0da Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653057393; 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=1O28EBOrSIyB4viLLeWa3SazyHePdMlj3l2iIQwkWhA=; b=g+TCcTChsUKGiRgijlQLeQvmKg7tubyY1cklV5CjLZR9I5f7qDKrm0QaOPUvviZX8dUoYj cn/dmLTz+lWufChocI9SHqSDYgVs7GKygr4wBeiruEzayESa6kf8zz3yQ0Ps0V/UbPK2x0 kd7h9SzXT7QthMocxUjFdYAD2KM9nEyic1qcfZF8j1vxAtHFWkEH1Sbny4w1t53ovbHhOd YKaaAMzUlqPSa1a5kta70+mKRrcHJWyRrrIStsNjP8yL7jsl8l3HjlYS70q9LyY15iN2pv 60J3FzMczYHub9VvXbFw4BiuFTZWKrOvu9LUcGi/Nqa0Xgev+mLvvNmC05VXKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653057393; a=rsa-sha256; cv=none; b=FDh16SZeljRThlPZms6UGm1ZAVPKkdOJYSMtN3sEaainlnJfhninGYcMbS9cIjBflzbNIV oyla0MUd+KlATlpmMbHeNRo842U80YoEt98uy5/AGvyK8i8FstijlTphJ54OgelxbI4Bmd px5+nKH+2kgVFkd5TSvRrluxEk1ouOpyAe6JS2756XMsqWjeg5Ed71f/okE8iXPDg300TS 1clmrTYGUR1ufDagKp299JszUy6Ya4ngJ9O3vKkISg8bUsjRWT6NcrcZRcDjjDH9ibiK0i t9AAjq/M15D3atsYf8EgXzAcgHiQJAOgVwvGjmTiSgyi9EJJMpBt7mxT422PWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bcc3148c70c72cc409881e7a25e2bb053a39a0da commit bcc3148c70c72cc409881e7a25e2bb053a39a0da Author: Mark Johnston AuthorDate: 2022-05-20 14:15:00 +0000 Commit: Mark Johnston CommitDate: 2022-05-20 14:34:43 +0000 libsa: Fix a bug in nvlist creation When adding an entry to an nvlist, the data buffer might need to be resized. When this happens, the XDR encoder's notion of the buffer size also needs to be updated, otherwise the operation may erroneously fail. Reviewed by: tsoome, imp MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35254 --- stand/libsa/zfs/nvlist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/stand/libsa/zfs/nvlist.c b/stand/libsa/zfs/nvlist.c index ba994f97d40a..84a0edafe182 100644 --- a/stand/libsa/zfs/nvlist.c +++ b/stand/libsa/zfs/nvlist.c @@ -1213,6 +1213,7 @@ nvlist_add_common(nvlist_t *nvl, const char *name, data_type_t type, nvl->nv_idx += sizeof(*hp); xdr.xdr_buf = nvl->nv_data; + xdr.xdr_buf_size = nvl->nv_asize; xdr.xdr_idx = nvl->nv_idx; xdr.xdr_idx += xdr.xdr_putuint(&xdr, namelen);