From nobody Tue Jan 02 01:13:15 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 4T3vx75dbDz5639J; Tue, 2 Jan 2024 01:13:15 +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 4T3vx73yL5z3bCv; Tue, 2 Jan 2024 01:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704157995; 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=Jc+EcZ9EZPqYdZxFa7MaaEogMIbT1nkWIULzJZdAylY=; b=jsSa8tY6T/zpymqgInL+8Me5rPMs3+eBy/3cfgHOwU7KM4Ogn03ty6/cVRV82x1fKQepKj 5xA4aBHmwUvPZ7M5UWizn7icBkasGt4iapKg9NrNl58FxKv/16iQwdcf+uxJNMM5Tovzpu QOf62r1ggr6w/VHRpSe36YxzZf1U4raLcU+EV2RILlTZg11r9F9ty1+b5ZxYG9ChH6N3Og WfYA0DvMUQGi3Zzwn4uD0gMIYX/5+gJrIR8c1WcAN5JMRtRdQYpNM+hjAQWVlW5VgGPN/h gxMKrGxkgyiy8MtlTW0q/1XXGyD1+xpVdlnZnYuxLKgLBk/9owyQSgwjlYSWoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704157995; a=rsa-sha256; cv=none; b=pLiU1U5pg46XobLPfy04xHj1UPwGy1HQMqTwg/0nkedmAZLx9/a83pSHF9qsjyAcsoG7BI HxQ0CTjyNsUHUEIpD0vKTsyo8Y6fpqPdeoEUAwzOcGZgVGBV5Ypdg2kxBMGgGmFleyZv2n 64suGLgFSnx3zwnjzsXAU8PSNiXM6zib8DEvu+H+QdUnQ7DTqCq323z23f+uu+5YEjYAaC 1j1saT5D1gpKOEdbUb3NlTBZjJCiO+CnB4jz7d4S6/WmEURqK4cBkcRx9ltUJs1xiQXRhF 6z3ocKZfgOq3Y7R+Ude2D8Ts9XjUxHjvPQAXPwkkoQ/CpLRANjyoZZlxGsJ8fQ== 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=1704157995; 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=Jc+EcZ9EZPqYdZxFa7MaaEogMIbT1nkWIULzJZdAylY=; b=gn0EUa69WNzILrHtXeF/rOUsmdpBMXi4REpiyTYUhpL+i2sealIT0CweRzMYrIEJjoJ3yJ v3PlsjljEmIkW07q3dLEioURumwUprM9UejeetmjjFjkb1h/h/bhpixrc8bBIXXqMgrlvV Vfd0xsZtvJzUP2S0Js3LDoEK7pJavbHRMvA6LI9SvfYUkmOXLlR/bzzYangrN0uOxYhTKn QIovBFYY7f9bGe97zK7WEVoAp/3ZFDBVgCPR0U2WgMsPq90u9qyTTPuEsZMLjwzVOu5m4J a5DZqgfd6l3vW0h5C9Gea3ST4joge6KrH1lplgTms78tmOY5tWLGNS1FhzJOxg== 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 4T3vx733DDzgLp; Tue, 2 Jan 2024 01:13:15 +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 4021DFrU055494; Tue, 2 Jan 2024 01:13:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4021DF0o055491; Tue, 2 Jan 2024 01:13:15 GMT (envelope-from git) Date: Tue, 2 Jan 2024 01:13:15 GMT Message-Id: <202401020113.4021DF0o055491@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: 5f5da36a3a05 - stable/13 - iscsi: Check for copyout errors in iscsi_ioctl_daemon_receive() 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: 5f5da36a3a05876dfaeee51810913e5558357662 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5f5da36a3a05876dfaeee51810913e5558357662 commit 5f5da36a3a05876dfaeee51810913e5558357662 Author: Mark Johnston AuthorDate: 2023-12-26 01:43:31 +0000 Commit: Mark Johnston CommitDate: 2024-01-02 01:12:45 +0000 iscsi: Check for copyout errors in iscsi_ioctl_daemon_receive() Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43148 (cherry picked from commit 74e713804fa4767991c5f20e6b85da4235107122) --- sys/dev/iscsi/iscsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index ec5adf417867..51cfe7aca71d 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -1863,17 +1863,17 @@ iscsi_ioctl_daemon_receive(struct iscsi_softc *sc, return (EMSGSIZE); } - copyout(ip->ip_bhs, idr->idr_bhs, sizeof(*ip->ip_bhs)); - if (ip->ip_data_len > 0) { + error = copyout(ip->ip_bhs, idr->idr_bhs, sizeof(*ip->ip_bhs)); + if (error == 0 && ip->ip_data_len > 0) { data = malloc(ip->ip_data_len, M_ISCSI, M_WAITOK); icl_pdu_get_data(ip, 0, data, ip->ip_data_len); - copyout(data, idr->idr_data_segment, ip->ip_data_len); + error = copyout(data, idr->idr_data_segment, ip->ip_data_len); free(data, M_ISCSI); } icl_pdu_free(ip); - return (0); + return (error); } #endif /* ICL_KERNEL_PROXY */