Skip to content
Commit 9173e5e8 authored by Eric Biggers's avatar Eric Biggers Committed by Tejun Heo
Browse files

libata: remove WARN() for DMA or PIO command without data

syzkaller hit a WARN() in ata_qc_issue() when writing to /dev/sg0.  This
happened because it issued a READ_6 command with no data buffer.

Just remove the WARN(), as it doesn't appear indicate a kernel bug.  The
expected behavior is to fail the command, which the code does.

Here's a reproducer that works in QEMU when /dev/sg0 refers to a disk of
the default type ("82371SB PIIX3 IDE"):

    #include <fcntl.h>
    #include <unistd.h>

    int main()
    {
            char buf[42] = { [36] = 0x8 /* READ_6 */ };

            write(open("/dev/sg0", O_RDWR), buf, sizeof(buf));
    }

Fixes: f92a2636

 ("libata: change ATA_QCFLAG_DMAMAP semantics")
Reported-by: default avatar <syzbot+f7b556d1766502a69d85071d2ff08bd87be53d0f@syzkaller.appspotmail.com>
Cc: <stable@vger.kernel.org> # v2.6.25+
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 058f58e2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment