Date: Thu, 14 Mar 2013 09:56:48 GMT From: "r4721@tormail.org" <r4721@tormail.org> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/176953: [patch] fix Floating Exception in recoverdisk Message-ID: <201303140956.r2E9umKB044235@red.freebsd.org> Resent-Message-ID: <201303141000.r2EA01Rv023364@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303140956.r2E9umKB044235>