From nobody Fri Oct 7 10:18:13 2022 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 4MkPQY6r5yz4V0xj for ; Fri, 7 Oct 2022 10:18:13 +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 4MkPQY543Vz3YTl for ; Fri, 7 Oct 2022 10:18:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 4MkPQY47FzzZ6t for ; Fri, 7 Oct 2022 10:18:13 +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 297AIDk6033613 for ; Fri, 7 Oct 2022 10:18:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 297AID8V033612 for bugs@FreeBSD.org; Fri, 7 Oct 2022 10:18:13 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 266885] [FUSEFS] fcntl(F_GETLK) overwrites flock->l_pid even if unlocked Date: Fri, 07 Oct 2022 10:18:13 +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: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jmillikin@gmail.com 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 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665137893; 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=zIi6Gf7OXbRJ34Gifk7oeJbkyvktAlvFhoLfEp1vdwY=; b=qqH8O9ctFKKTfttg4T+vloGZ3hqWgYy3q8U+ziNXYumo5Y4+zPdSH8Oxb3/XsDdu+xhuWL Aj2Blem5lm0cLiM+8uDZG7C1M36hpPAuj7Mdo/ZV8mhnjSBYioShx4zBUykdoM9h4UaLc0 enaGibDUn/emDkvhzvewZ1ZkS4oCzO3CydxuDoEMDAk5H8YaF8+OFb1AGy8mw6KUHtqoJj ukuLQtZgvHN6xtpSgTA5NMsozTYWSiaEgzp7ix0Wzy6SdlHcnsH0BjpzZV3XazpO3oT2lH 7iMiY6HCUVhU4KVXOBZSOy+M9pOdFnLkBZnQITc60OxZyuZ7TWYCTZAIjnO2NQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665137893; a=rsa-sha256; cv=none; b=sEiOKGVcgVl7MvY0Lqgdr2iG+dXpaG/5LMilJ7IttjcROIe7YTLRpd2FzQJHmFWfB7yde1 HdmklDwubG2eBVIVOtbTWXQT8lCCg/B6cOnhUDA4NSQwoXZA3npEav3DG17m2Yx7TRUlS7 5IqiDH9G4rXMGOXHCmPGHDCgPo0MoaR6fvt4WDhxd+YUlzusEkf2E0dHusdk+tkXpU/fjT /BDVijjXdGqr5YYe6RE7pfBqckgJt/PRGWi9RmY+3PNJLigZq4ytxUZHTqeT/KFJh5lPpQ zAV02lrhWQQkXKgVwPWjqLVuOKxVTE0SZW24VMk7Vntj7Xqyf74EB8ulDuhGlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D266885 Bug ID: 266885 Summary: [FUSEFS] fcntl(F_GETLK) overwrites flock->l_pid even if unlocked Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: jmillikin@gmail.com The documentation for fcntl(F_GETLK) says: If no lock is found that would prevent this lock from being created, the structure is left unchanged by this system call except for the lock type which is set to F_UNLCK. However, the code is currently overwriting the flock structure's `l_pid` fi= eld: /* sys/fs/fuse/fuse_vnops.c :: fuse_vnop_advlock() */ if (err =3D=3D 0 && op =3D=3D FUSE_GETLK) { flo =3D fdi.answ; fl->l_type =3D flo->lk.type; fl->l_pid =3D flo->lk.pid; /* <- here */ if (flo->lk.type !=3D F_UNLCK) { fl->l_start =3D flo->lk.start; I think that assignment should be moved down a line, into the `!=3D F_UNLCK` branch. --=20 You are receiving this mail because: You are the assignee for the bug.=