Re: [PATCH] libata: fix length validation of ATAPI-relayed SCSI commands

2018-02-12 Thread Tejun Heo
On Sat, Feb 03, 2018 at 08:30:56PM -0800, Eric Biggers wrote: > From: Eric Biggers > > syzkaller reported a crash in ata_bmdma_fill_sg() when writing to > /dev/sg1. The immediate cause was that the ATA command's scatterlist > was not DMA-mapped, which causes 'pi - 1' to underflow, resulting in a

[PATCH] libata: fix length validation of ATAPI-relayed SCSI commands

2018-02-03 Thread Eric Biggers
From: Eric Biggers syzkaller reported a crash in ata_bmdma_fill_sg() when writing to /dev/sg1. The immediate cause was that the ATA command's scatterlist was not DMA-mapped, which causes 'pi - 1' to underflow, resulting in a write to 'qc->ap->bmdma_prd[0x]'. Strangely though, the flag A