bin/176953: [patch] fix Floating Exception in recoverdisk

r4721 at tormail.org r4721 at tormail.org
Thu Mar 14 10:00:01 UTC 2013


>Number:         176953
>Category:       bin
>Synopsis:       [patch] fix Floating Exception in recoverdisk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 14 10:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     r4721 at tormail.org
>Release:        9.1 stable amd64
>Organization:
>Environment:
>Description:
the change to recoverdisk to optionally use stripesize causes Floating Exception.

http://svnweb.freebsd.org/base/stable/9/sbin/recoverdisk/recoverdisk.c?r1=225736&r2=247254&view=patch

pid 96884 (recoverdisk), uid 0: exited on signal 8

sectorsize and stripesize are both defined as u_int (32 bits), but the call to ioctl of DIOCGSTRIPESIZE returns a 64-bit number, overwriting the memory of sectorsize with 0, which is then used in a divison, causing a divide by zero error.

attached patch simply increases stripesize to 64 bits.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: sbin/recoverdisk/recoverdisk.c
===================================================================
--- sbin/recoverdisk/recoverdisk.c	(revision 247608)
+++ sbin/recoverdisk/recoverdisk.c	(working copy)
@@ -156,7 +153,7 @@
 	int error, state;
 	u_char *buf;
 	u_int sectorsize;
-	u_int stripesize;
+	u_long stripesize;
 	time_t t1, t2;
 	struct stat sb;
 	u_int n, snapshot = 60;


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list