[PATCH] hdparm: "Bad address" fix
Bernhard Fischer
rep.dot.nop at gmail.com
Sat Jan 19 11:28:59 UTC 2008
On Sat, Jan 12, 2008 at 03:33:42PM -0800, John Brandwood wrote:
>Hi, guys. This is my first post, so please let me know if I'm doing this
>wrong.
>
>There seems to be a bug in the current busybox "hdparm" applet.
>
>Here is an example of the problem ...
>
> root at linux:/usr/src/busybox-1.8.2/_install/bin# ./busybox hdparm
>/dev/hda
>
> /dev/hda:
> multcount = 0 (off)
> IO_support = 0 (default 16-bit)
> hdparm: HDIO_GET_UNMASKINTR: Bad address
> using_dma = 1 (on)
> hdparm: HDIO_GET_KEEPSETTINGS: Bad address
> hdparm: BLKROGET: Bad address
> hdparm: BLKRAGET: Bad address
> geometry = 30515/255/63, sectors = 490234752, start = 0
>
>I?ve tracked it down to a bunch of calls in miscutils/hdparm.c like ...
>
> if(!ioctl_or_warn(fd, HDIO_GET_UNMASKINTR, (unsigned long *)parm))
>
>instead of ...
>
> if(!ioctl_or_warn(fd, HDIO_GET_UNMASKINTR, &parm))
>
>I've patched all the suspect function calls, and now get the proper result
>...
>
> root at linux:/usr/src/busybox-1.8.2/_install/bin# ./busybox hdparm
>/dev/hda
>
> /dev/hda:
> multcount = 0 (off)
> IO_support = 0 (default 16-bit)
> unmaskirq = 0 (off)
> using_dma = 1 (on)
> keepsettings = 0 (off)
> readonly = 0 (off)
> readahead = 256 (on)
> geometry = 30515/255/63, sectors = 490234752, start = 0
>
>I've looked back as far as the busybox 1.6.2 release, and the problem goes
>back at least that long.
I've applied it to trunk and the 1_9_stable branch.
Thanks for the fix!
cheers,
Bernhard
More information about the busybox
mailing list