From nobody Sun Jul 23 13:03:32 2023 X-Original-To: bugs@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 4R83Pw6S9yz4ny4L for ; Sun, 23 Jul 2023 13:03:32 +0000 (UTC) (envelope-from bugzilla-noreply@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 4R83Pw58Gkz3DDM for ; Sun, 23 Jul 2023 13:03:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690117412; 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=6lNVwDNiMiQUrHvH29u+RuQGb+q58paK8w4BQ7XXn7U=; b=vO2jHZHGT0Elg6sUGRQf4FT04YXTe3s8MaDF4ZCNpPt+00my1QnqCB8oN5zPX3dK9dWJeo AkQ39K6VjWIo9/JLAoGcyvN4gs3cw986RiIt/jpXaYMWqWvKeE6yF+VCwBAEmwVlu13L96 uc4lF9cDGzUL0P7d80Vw1lGqnv8n2+TqWxqJ6f+4uMqbC+cJVw7S3PhBRoeZ+aS3UX60WR WXFCjcX9Fk/M6yw1nC91e5VueUF90Gso4jYlOhwZG4YETO8tretkMCtjsBDO6ltfVZ9eXq 2ut0b68BaaBn7k8zLH2HIpEEvkXT2Tmx6ADW/mwHU7myZGi6Oar97zmj87Tpsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690117412; a=rsa-sha256; cv=none; b=VqUiLOLE7lBlahW1atW8TelDFkdHyuGS+TTxo3pZnoCto/llIpldRUfhKyr3TuKtJVoqme B9MUNE32ZpL2jfbiDJcF9W8xxIG5LlpwJR2/K9uD4AMqyzsZM9B5KEuP0RgVW37b9ayrWa Md5P8b9zDcubBGZWZeJNBWaPiXzd+aNH775evb6oHKyuJCbjnPq3K6PDz0eKxkdsy0Cvto b0zskWHqyReBL8xjcu5Z9aXOTOZP0baQ/+XgaBHItcdmyDXaYp34ye99UWbLdMWz6atILs jnFJG44t29WU1EsEdFBZURYnP24y4Wv9VdpKCl5P9SrScNIDGuMsGvFQWJ5VQA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4R83Pw4DDkzd97 for ; Sun, 23 Jul 2023 13:03:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 36ND3Wh2051148 for ; Sun, 23 Jul 2023 13:03:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 36ND3Wh2051147 for bugs@FreeBSD.org; Sun, 23 Jul 2023 13:03:32 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 272678] VFS: Incorrect data in read from concurrent write Date: Sun, 23 Jul 2023 13:03:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: knielsen@knielsen-hq.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.mimetype attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272678 Bug ID: 272678 Summary: VFS: Incorrect data in read from concurrent write Product: Base System Version: 13.2-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: knielsen@knielsen-hq.org Attachment #243566 text/plain mime type: Created attachment 243566 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D243566&action= =3Dedit C test program to trigger the bug A read(2) system call on a file can read incorrect data when run concurrently with a write(2) that appends to the file. The attached test program demonstrates this: sudo mount -t tmpfs tmpfs /tmp cd /tmp ./test_concurrent_read_write2 ERROR! invalid value read 0x 0 at 343 of 387, pos 387 It's a race, seems to need a couple hundred iterations to provoke the bug (it defaults to 1000 iterations). When the bug happens, the read() sees the length of the file as including the data from the concurrent write(), but the read data is incorrect (all zeros in my tests). This was reproduced with FreeBSD 13.0, 13.2, and 14-current. It is reproducable on tmpfs with default settings. It can reportedly be reproduced on ufs filesystems by disabling vn_io_fault and enablint vn_io_pgcache_read_enable. A work-around is: sysctl debug.vn_io_pgcache_read_enable=3D0 --=20 You are receiving this mail because: You are the assignee for the bug.=