From nobody Fri May 2 21:38:30 2025 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 4Zq46b043kz5v5gr; Fri, 02 May 2025 21:38:31 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zq46Z4YKkz3BqQ; Fri, 02 May 2025 21:38:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746221910; 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=/88LUFkLKJxA0pw7W6LaCY54re5cObiMkDmrIRjoVvE=; b=dnduOwaoyXczCiWnMU6qSEYxecwWG3EOgrEa6w8dq2Q4CbGQT+ws4yATTyTE4b2NurGkjr OJb5yO/bK1E/XZaj3e5tD+r9dJxtPbuk/LCWxNBpnE5SuXqX3exbkWifpYfU2KLKFipxab Q1SI88m59OsQ3luJBc5/v+ayKAjxmXAk4DykDXBW0KSHzE06FHqtkCCRiPle8Vd64345rV y48cB9CXKcsPBd6g3RWeoUk7OeU1vBTAF/2I8yTg1jqhUsRBH426gMjdLCBvso+U35f+bW XZpb0XzLoHl20PwZjNumHbf1MLoRosRyMkHh5qwxtRE5sllCOTirnLUyLFGhjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746221910; 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=/88LUFkLKJxA0pw7W6LaCY54re5cObiMkDmrIRjoVvE=; b=DXiLmihWqU98GZLisJfRxhcE7WUucpIaWpvbOtAx+RzDs9oni9dGc01D1jNRYidu5Kg9dk 9xevmmDRj4DexR8Xu9ajxTYN5cNCRdM2VVTk9QNSsUDdFYxih/Spm3CmhCtSm1XGHoXqrb PVgCuCFAQPYzx3i1/5nfRtChLNTH4jQoa8DzRnLGSMtEvt50PRtBrjTKzZXBB+LL6WUhoC 29OGas39vvuh/a7zJVkVTc8dy+p2WAne8xtZp1qobv56OuZyNaFGW+NSQ8KR1C8Ka+GsiN vQoe9iK+hs3ZyOV5v++sOkZtnUmlHtufcwdqapyMc6lnC1zwfv1n5k9FSGOtyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1746221910; a=rsa-sha256; cv=none; b=MYlADw0HBrS7JuAi9NVqNGvH4/t9HjlsS8Q7ez7cqPx03dHxPDd7cpjuMimW/rlQpxnOOQ cgoLstZvWnK3a+dZ/QYcRpzjV+aiK+Uuxw86HrRHHc7ltM8NZGt23F5LJzWdT+d7/cThmf 0NxApII7IvwH/qrCRA1IWbFonafVeTd+mt/WVlqYXePrcElcUgJ7NTOxD7/W6ixfPpAezI 4jsns08HMM+f+eevhFmYC9HFp2PjNWQJxj6HZ3JG9GGnCiKHY/moKhzwK7oonwhkOyEXly thVdaK6jca8xoowTwQAs5xYnnnO91Eb0jyO/kw3YN+++lzSTyIatOlKdYKTMbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4Zq46Z3gkDz1SNt; Fri, 02 May 2025 21:38:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 542LcUxG054425; Fri, 2 May 2025 21:38:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 542LcUd4054422; Fri, 2 May 2025 21:38:30 GMT (envelope-from git) Date: Fri, 2 May 2025 21:38:30 GMT Message-Id: <202505022138.542LcUd4054422@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: ab01a5f5628e - main - aio: Fix opcode handling in aio_process_rw() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: ab01a5f5628eb0d334f491ff06462cff214d5f49 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ab01a5f5628eb0d334f491ff06462cff214d5f49 commit ab01a5f5628eb0d334f491ff06462cff214d5f49 Author: Mark Johnston AuthorDate: 2025-05-02 21:37:39 +0000 Commit: Mark Johnston CommitDate: 2025-05-02 21:37:39 +0000 aio: Fix opcode handling in aio_process_rw() LIO_FOFFSET needs to be masked off, as it is in aio_aqueue(). Reported by: syzbot+b6e15476c91852bb2264@syzkaller.appspotmail.com Reviewed by: kib, asomers MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50118 --- sys/kern/vfs_aio.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 92c30b48e4f5..97dc854c9386 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -755,10 +755,9 @@ aio_process_rw(struct kaiocb *job) long inblock_st, inblock_end; int error, opcode; - KASSERT(job->uaiocb.aio_lio_opcode == LIO_READ || - job->uaiocb.aio_lio_opcode == LIO_READV || - job->uaiocb.aio_lio_opcode == LIO_WRITE || - job->uaiocb.aio_lio_opcode == LIO_WRITEV, + opcode = job->uaiocb.aio_lio_opcode & ~LIO_FOFFSET; + KASSERT(opcode == LIO_READ || opcode == LIO_READV || + opcode == LIO_WRITE || opcode == LIO_WRITEV, ("%s: opcode %d", __func__, job->uaiocb.aio_lio_opcode)); aio_switch_vmspace(job); @@ -768,7 +767,6 @@ aio_process_rw(struct kaiocb *job) job->uiop->uio_td = td; fp = job->fd_file; - opcode = job->uaiocb.aio_lio_opcode; cnt = job->uiop->uio_resid; msgrcv_st = td->td_ru.ru_msgrcv;