HomeFreeBSD

Add object type checking to zap_lockdir()

Description

Add object type checking to zap_lockdir()

If a non-ZAP object is passed to zap_lockdir() it will be treated
as a valid ZAP object. This can result in zap_lockdir() attempting
to read what it believes are leaf blocks from invalid disk locations.
The SCSI layer will eventually generate errors for these bogus IOs
but the caller will hang in zap_get_leaf_byblk().

The good news is that is a situation which can not occur unless the
pool has been damaged. The bad news is that there are reports from
both FreeBSD and Solaris of damaged pools. Specifically, there are
normal files in the filesystem which reference another normal file
as their parent.

Since pools like this are known to exist the zap_lockdir() function
has been updated to verify the type of the object. If a non-ZAP
object has been passed it EINVAL will be returned immediately.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #2597
Issue #2602

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Aug 29 2014, 7:24 PM
Parents
rGcd3939c5f069: Linux AIO Support
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGceb49b0acd21: Add object type checking to zap_lockdir() (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Sep 8 2014, 4:15 PM