Date: Tue, 27 Dec 2005 12:20:00 GMT From: "Justin T. Gibbs" <gibbs@tumnus.scsiguy.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: docs/91149: read(2) can return EINVAL for unaligned access to block devices Message-ID: <200512271220.jBRCK0S9021884@tumnus.scsiguy.org> Resent-Message-ID: <200512311810.jBVIA4UX098118@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 91149 >Category: docs >Synopsis: read(2) can return EINVAL for unaligned access to block devices >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sat Dec 31 18:10:03 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Justin T. Gibbs >Release: FreeBSD 7.0-CURRENT i386 >Organization: >Environment: System: FreeBSD tumnus.scsiguy.org 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Thu Dec 22 18:09:55 UTC 2005 gibbs@:/usr/src/sys/i386/compile/TUMNUS i386 >Description: The read system call will return EINVAL if the current file offset is not a multiple of the block size. The read(2) man page should be updated to reflect this. >How-To-Repeat: Run /usr/ports/security/bcwipe. It attempts to determine a block device's size vi a binary lseek search. The current code does not round down the address passed to lseek to a multiple of the device block size. Notice that subsequent read calls fail with EINVAL. >Fix: Update man page so an examination of kernel code is not required to determine why EINVAL is being returned. :-) >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512271220.jBRCK0S9021884>