From nobody Fri May 27 13:20:48 2022 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 9B7551B4A01A; Fri, 27 May 2022 13:20:48 +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 4L8lmc3YRnz3DSx; Fri, 27 May 2022 13:20:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653657648; 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=uHWxpIBVbUr/tkvNQAn8db4MwpEBCVs3CqTskhnIGIg=; b=mdxxsleaiTNo4jRHP02iY0GsO9lkh12uys/gd8bortzJ0h7uNv6YaoV65OqFuxkhBf4kTT /B2aGT7DoSD+ZOFn/CPNmP652koLLbKPkmi4jOMtYNPMjIMPSkRrvGuR0paRd2S7E8pXsE 8+H7UlL3CJzr2WeMN++ez3tlIrCMgMmBIt9KcNBl+LKEpR+LppHpP3m/GKfMGqQ+rzczwy Fl4fNe74V8KDNN6nfGFFCgHB8fAvtfE8EwU4t3k2N6o13LbrbxXbAC4upsGGQWS44J2ITn ZJ+FlljZzeIwC/e1RbEQ4gr62JZLscxSZEOq5tt49Vlq0O5zZ9PGW9IvBC29Uw== 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 5A4CA23062; Fri, 27 May 2022 13:20:48 +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 24RDKmSw048286; Fri, 27 May 2022 13:20:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24RDKm0C048285; Fri, 27 May 2022 13:20:48 GMT (envelope-from git) Date: Fri, 27 May 2022 13:20:48 GMT Message-Id: <202205271320.24RDKm0C048285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f2206d2f94a4 - stable/13 - libsa: Fix a bug in nvlist creation 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f2206d2f94a42f925db350a2bbab52091368ef95 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653657648; 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=uHWxpIBVbUr/tkvNQAn8db4MwpEBCVs3CqTskhnIGIg=; b=cJD2Iq/aP9XBS2/O9G0RnjKcsSeBh5AW6lde1plm1+5Faobjexh9C4/+QneW+ao3xyNLQt JZN/K9WjKDthMpXgc0PPNrday7/ylbCYOG7HZd1QEWso+xUSuPSfpq3PtY5BBVvjkS4POk lSvRR6PKbsXfW9sycXf9fC/n4mJ2tGTjIbUxcP1gGUZfnLiDLofaEmn3xF8a1rx+sgN5R6 KA6MCOweE0pWBbrCtTNcGFxI/hpTKnYXqkocs6AEUuHt0sFWYImp5Auv0ux6VtMQwU79m0 9qUQ3TpuGlI+K1UGKpk6u9hesrqJu3PxaWhFFw69EwiV5moALCLiUOvpcpuFhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653657648; a=rsa-sha256; cv=none; b=h+LyOtmc0T2AN5puDwlldk4bq01ajwWsIqHRkob6+/edTCudlZeVdHN3yvrVEed4tpT/BQ i7MJSGRI9A6ZlT5owCROqHfu50xQ0iur/4c9YV99wMRjk1pAyoau9jnIwKk+PVXJkeacN1 VT+CaDPil7Kh0NKZElwiuMZNI+80TGGAhkfAi/VJLvIa0RgHwelyqSBYg0rKiaZGvjyqmI fDWvSdVMCB4fk/KBHl4gyB534ZA5YGWOEma/5+xvYFsjpMLdwcPInJlb8f8nwNb02c17Z6 BvoPsqQzpL0619y+gNx8yvlVBVbYWFXZCQm2AAYWDeOqHGl32rioZN4dzATbng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f2206d2f94a42f925db350a2bbab52091368ef95 commit f2206d2f94a42f925db350a2bbab52091368ef95 Author: Mark Johnston AuthorDate: 2022-05-20 14:15:00 +0000 Commit: Mark Johnston CommitDate: 2022-05-27 13:14:58 +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 Sponsored by: The FreeBSD Foundation (cherry picked from commit bcc3148c70c72cc409881e7a25e2bb053a39a0da) --- 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);