From nobody Wed Jan 03 01:00:57 2024 X-Original-To: dev-commits-ports-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 4T4WcT3hjCz56HwX; Wed, 3 Jan 2024 01:00:57 +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 4T4WcT2p8gz3fDj; Wed, 3 Jan 2024 01:00:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704243657; 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=X+UlUxSK5OxYlQ6UM/bnuXPxg2t+6Fc+2VmGMhQ88O0=; b=rKztGDajTZvQKSXUvF7MZZa77M5zA5da2Rf+acXwa11MH3eoRHcx9XTYLSyLD7deRrd+A6 8R4ma0kxCJvqRhRnsvfAubw+XqCJ2oyM/Xl5nrFTNcVrVDbRi8BAkdsriZKFKNODJgS4SC rnq3Ywv18eyuxZ07ja2uycwN6drgAFnBRiA0k6thJkt/KOVHQ5OovQDiddyhvQKRhKzZjP 2Nr1RzfECMAi2B2GduAinWFIP0dU8QbzsiJRmoAJvPOIA8pSZvMHAxP08ny7VqdL/o3kHh uGZ70y3W3r3MsNATbUJG8v1xp0oTLIRneSVpUrUZbPAIn83lwanxeRmP2D9DlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704243657; a=rsa-sha256; cv=none; b=hZYYSUMUOfYe/kiKu/vjNTIknqsJLOtmIyPs15kk+cfJ8/iw2v9pJC2cwXemviDXE4JlQo vb1GDv8YwFgXpH9fCbOspB0kwFijXYuzxi2d0bls8flPoGsaBY78YFnryn7lwVXKUS7mmy ooJBUx/cr6NYBUTjBnzBZl1DdTt6MHA0HuQUGQxvBINZMCHrk5cxhoNuG1W/ROswPNkJwN sVgpyGrFk21g5D7pPa556yGAik7P5X8iYtgQbI8NaK7HPZ4Hs+nOlSG2axcH7xu73l/GmB HF2ZSIvdezrTZF1Q6/fhlQGrcztQ1Jh8SfxcLZ5uY5v/231eu7OUuKQwfcHboA== 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=1704243657; 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=X+UlUxSK5OxYlQ6UM/bnuXPxg2t+6Fc+2VmGMhQ88O0=; b=MunvJ7q06DoX2MUDkmt4Mj364f6yYXMKMFPp3ubZGDHyGUKrdbfY/Cx4xeigQd7R5Us7Pu lO5P+MRh0Eryxd4Ei9obhFu9Zq7c/rWH5jW1mZ+k7wrKWKZnKGHfwd8DII21FJTFs4kzSO 1flCdr0uC7+d1P+fC4XGC+afCp1IRuAgiXCKOgol5Xt2UY4xHOhEHfHQNfgu/NbDiM5KMB vVeNMTQVHg6Z6ryojab0IGSnKCFd96dIvmibiAfj8AFP0O31RjhWqiTh7oVig4kHM87C5j wMgV75aAOh/eCmLCej2cHTLpkynguECaL9/I1L3jeCcddhiXHJBhqVve/rSclQ== 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 4T4WcT19csz1NT1; Wed, 3 Jan 2024 01:00:57 +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 40310vd0050901; Wed, 3 Jan 2024 01:00:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40310vqA050898; Wed, 3 Jan 2024 01:00:57 GMT (envelope-from git) Date: Wed, 3 Jan 2024 01:00:57 GMT Message-Id: <202401030100.40310vqA050898@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mark Johnston Subject: git: 823c8faa7506 - main - net/aoe: Fix error handling for a copyout() call List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-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: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 823c8faa750685c75c8a9a701f0e36808dd7bd48 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/ports/commit/?id=823c8faa750685c75c8a9a701f0e36808dd7bd48 commit 823c8faa750685c75c8a9a701f0e36808dd7bd48 Author: Mark Johnston AuthorDate: 2024-01-02 18:10:47 +0000 Commit: Mark Johnston CommitDate: 2024-01-03 01:00:26 +0000 net/aoe: Fix error handling for a copyout() call This will soon be required by the base system. PR: 275986 Approved by: antoine --- net/aoe/Makefile | 2 +- net/aoe/files/patch-aoeblk.c | 23 +++++++++++++++++++++ net/aoe/files/patch-aoecmd.c | 48 +++++++++++++++++++++++++++++++++++++++----- 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/net/aoe/Makefile b/net/aoe/Makefile index 1ad2f1cf6e69..4a1e523107f2 100644 --- a/net/aoe/Makefile +++ b/net/aoe/Makefile @@ -1,6 +1,6 @@ PORTNAME= aoe PORTVERSION= 1.2.0 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= net MASTER_SITES= https://people.freebsd.org/~sson/aoe/ DISTNAME= ${PORTNAME}-freebsd-${PORTVERSION} diff --git a/net/aoe/files/patch-aoeblk.c b/net/aoe/files/patch-aoeblk.c new file mode 100644 index 000000000000..7c096292da89 --- /dev/null +++ b/net/aoe/files/patch-aoeblk.c @@ -0,0 +1,23 @@ +--- aoeblk.c.orig 2024-01-03 00:56:10 UTC ++++ aoeblk.c +@@ -114,7 +114,7 @@ aoeblk_ioctl(struct disk *disk, u_long cmd, void *vp, + { + struct ata_ioc_request *iocmd; + struct aoedev *d; +- int n; ++ int error, n; + + if (cmd != IOCATAREQUEST) { + IPRINTK("cmd %ld not IOCATA.\n", cmd); +@@ -153,9 +153,9 @@ aoeblk_ioctl(struct disk *disk, u_long cmd, void *vp, + + switch (iocmd->ata_ioc_request_ata.command) { + case ATA_ATA_IDENTIFY: +- copyout(d->ad_ident, iocmd->ata_ioc_request_data, sizeof d->ad_ident); ++ error = copyout(d->ad_ident, iocmd->ata_ioc_request_data, sizeof d->ad_ident); + mtx_unlock(&d->ad_mtx); +- return (0); ++ return (error); + case ATA_SMART: + if (iocmd->ata_ioc_request_ata.feature != ATA_SMART_ATTR_AUTOSAVE) { + n = aoecmd_ata_smart(d, iocmd); diff --git a/net/aoe/files/patch-aoecmd.c b/net/aoe/files/patch-aoecmd.c index 6868561e5ffb..7a8694ee7c81 100644 --- a/net/aoe/files/patch-aoecmd.c +++ b/net/aoe/files/patch-aoecmd.c @@ -1,6 +1,6 @@ ---- aoecmd.c.orig 2006-05-26 00:13:09.000000000 +0700 -+++ aoecmd.c 2010-09-13 20:15:55.000000000 +0700 -@@ -44,6 +44,7 @@ +--- aoecmd.c.orig 2006-05-25 17:13:09 UTC ++++ aoecmd.c +@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD: src/sys/dev/aoe/aoecmd.c,v 1.23.2. #include #include #include @@ -8,7 +8,21 @@ #include -@@ -427,29 +428,6 @@ +@@ -197,12 +198,11 @@ rexmit(struct aoedev *d, struct frame *f) + { + /* struct mbuf *m; */ + struct aoe_hdr *h; +- struct aoe_atahdr *ah; + + h = (struct aoe_hdr *) f->f_hdr; +- ah = (struct aoe_atahdr *) (h+1); + + #ifdef AOE_DEBUG ++ struct aoe_atahdr *ah = (struct aoe_atahdr *) (h+1); + + IPRINTK("mlen=%ld verfl=%X major=%X minor=%X cmd=%X\n" + "\ttag=%lX aflags=%X errfeat=%X scnt=%X cmdstat=%X\n" +@@ -427,29 +427,6 @@ loop: goto loop; } @@ -38,7 +52,7 @@ static void ataid_complete(struct aoedev *d, char *id) { -@@ -457,13 +435,13 @@ +@@ -457,13 +434,13 @@ ataid_complete(struct aoedev *d, char *id) memcpy(d->ad_ident, id, sizeof d->ad_ident); @@ -55,3 +69,27 @@ } if (aoeblk_register(d) != 0) IPRINTK("could not register disk\n"); +@@ -614,7 +591,7 @@ aoecmd_ata_smart(struct aoedev *d, struct ata_ioc_requ + struct aoe_hdr *h; + struct aoe_atahdr *ah; + register daddr_t lba; +- int timeout; ++ int error, timeout; + + timeout = iocmd->ata_ioc_request_timeout; + +@@ -664,10 +641,12 @@ aoecmd_ata_smart(struct aoedev *d, struct ata_ioc_requ + iocmd->ata_ioc_request_ata.lba = lba; + + if (iocmd->ata_ioc_request_flags == ATA_CMD_READ) +- copyout(ah+1, iocmd->ata_ioc_request_data, iocmd->ata_ioc_request_count); ++ error = copyout(ah+1, iocmd->ata_ioc_request_data, iocmd->ata_ioc_request_count); ++ else ++ error = 0; + + f->f_tag = FREETAG; +- return (0); ++ return (error); + } + + /* Set the write caching. */