From nobody Mon Jul 31 21:36:07 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 4RFBQ00RN5z4pWQR for ; Mon, 31 Jul 2023 21:36:11 +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 4RFBPk5PHKz4MFh for ; Mon, 31 Jul 2023 21:36:10 +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=1690839370; 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=sUl1oNmvbMTXJUaeo49Kv3hu94SquxlkR6xSEf+Vp8Q=; b=yGAXe8gltOIR3T0VnMSZuGPWxkDmIVkHghXTGF/xS0hEGv98eCSpiqqH5FU0U6EzbtNPbv 9/JrmPfoJ6Qbpodik9PMH+hpaeWNjGPwz0/xmYvm7ZN0q8EDdyBYu/Zew7hLcLJZpOGq32 vWoCDKnGr+dX5j8W6NaBkoAWI1bYicxZ5aeS32TmecTVnUp2u4PwjIFDm0+6u/RvVQrKcO kzwYVjul6H+SVwH8YnNmqJONO176er/PSQjFkLKkENKC/UMr3nAdiV7JUjvdr1n6JsCuf8 95b4r8cWsNE1Zkfeake7KEV+Za1GX4cISKQDzzPumsm5R6yVhfKHiswf+OTLqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690839370; a=rsa-sha256; cv=none; b=uurDsJG1o4ks96qkoVFvPn5imDQKFbzCKJB3rhzJQHkHXlgrZl96Yn7losn8P0Agnrma8U 3i0yHRSkNzW/CxHff5Sw4VoErk0W1hNDdfMN/mM7YhSOj+Q1vT1LsUjAXtx2jhLhyzqfnj 50SZgXqFRK/jiGwQh18eoNONbj7huc9yWL2Qu/Vc8BIY/2tHgV8CnmiHyn9YjratTRUWJM 7lSQSQOIbZrAdP0CQJdqdnBCGyEmK4DtNcV3z9xmBWN8LSIiMFYLfaGZ1U7wW2HSiJl95M 44KqF0GPSd0FQYg24uNXBAfOV1l49X00xGttVmpgrFIjg+F+uldK74Annr0DsQ== 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 4RFBPj2VbWz1BDW for ; Mon, 31 Jul 2023 21:36:09 +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 36VLa7Yr031691 for ; Mon, 31 Jul 2023 21:36:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 36VLa7XK031690 for bugs@FreeBSD.org; Mon, 31 Jul 2023 21:36:07 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 272856] cd9660_rrip_loop() can call bread() without brelse() Date: Mon, 31 Jul 2023 21:36:07 +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: rtm@lcs.mit.edu 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.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=3D272856 Bug ID: 272856 Summary: cd9660_rrip_loop() can call bread() without brelse() Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: rtm@lcs.mit.edu Created attachment 243757 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D243757&action= =3Dedit a gzipped cd9660 image that causes bread() to be called w/o brelse() cd9660_rrip_loop() in sys/fs/cd9660/cd9660_rrip.c says: while (1) { ...; || bread(ana->imp->im_devvp, ana->iso_ce_blk << (ana->imp->im_bshift - DEV_BSHIFT), ana->imp->logical_block_size, NOCRED, &bp)) ...; } if (bp) brelse(bp); The brelse(bp) is outside the loop; if the loop bread()s twice, a block is left locked. I've attached a demo image: # gunzip cd7a.iso.gz # mdconfig cd7a.iso # mount_cd9660 /dev/md0 /mnt panic: userret: Returning with 1 locks held panic() at panic+0x26 userret() at userret+0xf4 syscallret() at syscallret+0xa0 ecall_handler() at ecall_handler+0x22 do_trap_user() at do_trap_user+0xf2 cpu_exception_handler_user() at cpu_exception_handler_user+0x72 --- syscall (378, FreeBSD ELF64, nmount) --=20 You are receiving this mail because: You are the assignee for the bug.=