]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
libata: remove WARN() for DMA or PIO command without data
authorEric Biggers <ebiggers@google.com>
Sun, 4 Feb 2018 04:33:27 +0000 (20:33 -0800)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 28 Mar 2018 19:05:54 +0000 (14:05 -0500)
commit1feb7e2a439620216d77bd091184d2fa87629b98
tree38250f47a40556e63a43af40b90d40d9ca5f45fd
parentc185ee81ad4acd1675318ecb5add2cb9587ad60c
libata: remove WARN() for DMA or PIO command without data

BugLink: http://bugs.launchpad.net/bugs/1759655
commit 9173e5e80729c8434b8d27531527c5245f4a5594 upstream.

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: f92a26365a72 ("libata: change ATA_QCFLAG_DMAMAP semantics")
Reported-by: syzbot+f7b556d1766502a69d85071d2ff08bd87be53d0f@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org> # v2.6.25+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/ata/libata-core.c