[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2019-01-21 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

Oleksandr Tymoshenko  changed:

   What|Removed |Added

 CC||go...@freebsd.org
 Status|New |Closed
 Resolution|--- |FIXED

--- Comment #13 from Oleksandr Tymoshenko  ---
There is a commit referencing this PR, but it's still not closed and has been
inactive for some time. Closing the PR as fixed but feel free to re-open it if
the issue hasn't been completely resolved.

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-29 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

--- Comment #12 from commit-h...@freebsd.org ---
A commit references this bug:

Author: kib
Date: Tue Mar 29 19:59:45 UTC 2016
New revision: 297401
URL: https://svnweb.freebsd.org/changeset/base/297401

Log:
  Do not access buffer if bread(9) or cluster_read(9) failed.  On error,
  the functions free the buffer and set the pointer to NULL.  Also
  remove useless call to brelse(9) on the error path.

  PR:   208275
  Submitted by: Fabian Keil 
  MFC after:2 weeks

Changes:
  head/sys/fs/cd9660/cd9660_vnops.c

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-29 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

--- Comment #11 from Fabian Keil  ---
Thanks for the pointer. Somehow I missed that comment.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-29 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

--- Comment #10 from Konstantin Belousov  ---
(In reply to Fabian Keil from comment #9)
See the comment near the end of cluster_read(), right after the opening '{' of
if (reqbp) block.  It all comes from r294954.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-29 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

--- Comment #9 from Fabian Keil  ---
I agree that moving the n calculation behind the error block
is technically sufficient to prevent the panic.

I added the NULL check in front of the brelse() because the function
contains a comment that indicates that passing NULL to it is considered
incorrect.

My assumption was that the brelse() was there for a reason and that bp
would sometimes not be NULL or at least could be in the future.

cluster_read() and bread*() indeed seem to reliably reset bp to NULL
on error, but unlike breadn_flags(), cluster_read() has no comment that
explicitly mentions this, so I wasn't sure that one can depend on this
behaviour.

If the behaviour is unlikely to change in the future, I agree that the
brelse() should be removed.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-29 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

Konstantin Belousov  changed:

   What|Removed |Added

 CC||k...@freebsd.org

--- Comment #8 from Konstantin Belousov  ---
(In reply to Fabian Keil from comment #7)
I think the only needed part of the change is the move of n calculation after
the error check.

In head, cluster_read() and bread() relibably reset bp to NULL on error, _and_
brelse ignores NULL argument.  So it may be argued that the fix also could
remobe brelse() call from the error path.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-29 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

Fabian Keil  changed:

   What|Removed |Added

 CC||freebsd-curr...@freebsd.org

--- Comment #7 from Fabian Keil  ---
Great, thanks for testing the patch.

I believe that's all the information needed.

CC'ing freebsd-current@ to see if a committer has time for this.

FYI, when copying discs with lots of corrupt sectors, reducing
kern.cam.cd.retry_count can significantly speed things up.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-29 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

--- Comment #6 from b...@haps.ca ---
With the patch applied my machine happily worked at copying most of the
evening.  Since this was a reliable way to panic the kernel, this patch is a
great success. I've attached a /var/log/messages with about an hour's worth of
kernel complaints regarding the media, if that's helpful.  Let me know if
there's any more information needed.

Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-29 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

--- Comment #5 from b...@haps.ca ---
Created attachment 168755
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=168755&action=edit
/var/log/messages kernel output on a bad dvd read

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-28 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

Fabian Keil  changed:

   What|Removed |Added

 CC||f...@fabiankeil.de

--- Comment #4 from Fabian Keil  ---
Created attachment 168724
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=168724&action=edit
cd9660_read(): In case of read errors, don't dereference bp which may be NULL

Thanks for the report. Can you test the attached patch?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-24 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

--- Comment #3 from b...@haps.ca ---
Never mind, I couldn't add crash.txt.0 because it was read only by root.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-24 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

--- Comment #2 from b...@haps.ca ---
Created attachment 168592
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=168592&action=edit
/var/crash/core.txt.0

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-24 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

--- Comment #1 from b...@haps.ca ---
So I can't actually add a second file as an attachment (the core.txt.0 file). 
I'm guessing it's the most useful of the bunch but clicking on the 'submit'
button on the add an attachment page doesn't do anything (firefox on freebsd). 
I'll mail it to the list instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd

2016-03-24 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208275

Bug ID: 208275
   Summary: Kernel panic when reading from /dev/cd0 with a damaged
dvd
   Product: Base System
   Version: 11.0-CURRENT
  Hardware: amd64
OS: Any
Status: New
  Severity: Affects Only Me
  Priority: ---
 Component: misc
  Assignee: freebsd-bugs@FreeBSD.org
  Reporter: b...@haps.ca
CC: freebsd-am...@freebsd.org
CC: freebsd-am...@freebsd.org

Created attachment 168591
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=168591&action=edit
dmesg

When I mount_cd9660 /dev/cd0 /mnt and then cp -Rv /mnt/ ., I reliably get a
kernel panic.  The cd is a bit scratched and old, there are some read timeout
debug messages, and the it just reboots.

The machine is a Thinkpad T440p.
The version of freebsd is 11-current, FreeBSD 11.0-CURRENT #0 r297046

I initially thought it might be drm2/i915kms related, but it panics if those
modules are loaded or not.

I've attached dmesg, and /var/crash/core.txt.0.
/var/crash/info.0 is:
Dump header from device: /dev/ada0p3
  Architecture: amd64
  Architecture Version: 2
  Dump Length: 856309760
  Blocksize: 512
  Dumptime: Thu Mar 24 22:11:03 2016
  Hostname: t440p.example.com
  Magic: FreeBSD Kernel Dump
  Version String: FreeBSD 11.0-CURRENT #0 r297046: Sat Mar 19 02:16:14 EDT 2016
r...@t440p.example.com:/usr/obj/usr/src/sys/GENERIC
  Panic String: page fault
  Dump Parity: 1773259869
  Bounds: 0
  Dump Status: good

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"