[Bug 205806] [patch] bsdinstall(8): partedit can hang/crash on read/lseek/malloc failures

2022-11-08 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205806

Graham Perrin  changed:

   What|Removed |Added

   Keywords||install

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug 205806] [patch] bsdinstall(8): partedit can hang/crash on read/lseek/malloc failures

2019-09-17 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205806

Li-Wen Hsu  changed:

   What|Removed |Added

 CC||lw...@freebsd.org
URL||https://reviews.freebsd.org
   ||/D14573

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


[Bug 205806] [patch] bsdinstall(8): partedit can hang/crash on read/lseek/malloc failures

2018-03-03 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205806

--- Comment #1 from w...@worrbase.com ---
https://reviews.freebsd.org/D14573

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


[Bug 205806] [patch] bsdinstall(8): partedit can hang/crash on read/lseek/malloc failures

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

w...@worrbase.com changed:

   What|Removed |Added

   Severity|Affects Only Me |Affects Some People

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


[Bug 205806] [patch] bsdinstall(8): partedit can hang/crash on read/lseek/malloc failures

2016-01-02 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205806

Bug ID: 205806
   Summary: [patch] bsdinstall(8): partedit can hang/crash on
read/lseek/malloc failures
   Product: Base System
   Version: 10.2-STABLE
  Hardware: amd64
OS: Any
Status: New
  Keywords: patch
  Severity: Affects Only Me
  Priority: ---
 Component: bin
  Assignee: freebsd-b...@freebsd.org
  Reporter: w...@worrbase.com
CC: freebsd-amd64@FreeBSD.org
  Keywords: patch
CC: freebsd-amd64@FreeBSD.org

Created attachment 164966
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=164966=edit
malloc + read in a loop -> mmap

The current code for reading in the bootcode from a file has a few problems.

https://svnweb.freebsd.org/base/head/usr.sbin/bsdinstall/partedit/gpart_ops.c?revision=285679=markup#l408

408: if lseek(2) fails, bootsize underflows to SIZE_T_MAX, making the resulting
allocation dangerous
409: if malloc(3) fails, we end up with a null pointer deref later
413: if read(2) fails, the installer will hang trying to read(2) boot loader
code

I've replaced this with a call to mmap(2), which will give us what we want, and
also contains more error-handling if something goes wrong.

Tested on FreeBSD 10.2-STABLE on amd64.

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