lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <yq1lgvrqnmw.fsf@sermon.lab.mkp.net>
Date:   Wed, 07 Dec 2016 19:18:31 -0500
From:   "Martin K. Petersen" <martin.petersen@...cle.com>
To:     Nicolai Stange <nicstange@...il.com>
Cc:     "Martin K. Petersen" <martin.petersen@...cle.com>,
        Jens Axboe <axboe@...nel.dk>,
        "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        Shaun Tancheff <shaun.tancheff@...gate.com>,
        Chaitanya Kulkarni <chaitanya.kulkarni@...t.com>,
        Christoph Hellwig <hch@...radead.org>,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sd: make ->no_write_same independent of reported ->max_ws_blocks

>>>>> "Nicolai" == Nicolai Stange <nicstange@...il.com> writes:

Nicolai,

Nicolai> 1.) Do these older SCSI devices have a way to report
Nicolai>     ->max_ws_blocks?

I'm afraid not.

Nicolai> 3.) Those older devices that have ->max_ws_blocks >
Nicolai>     SD_MAX_WS10_BLOCKS but ->ws16 == ->ws10 == 0, i.e. the
Nicolai>     heuristicated ones would always be given WRITE_SAME, not
Nicolai>     WRITE_SAME_16 commands?  C.f. sd_setup_write_same_cmnd():
Nicolai>     if ->ws16 is not set, do WRITE_SAME. Isn't this a little
Nicolai>     bit odd given that the reported -> max_ws_blocks would be
Nicolai>     greater than SD_MAX_WS10_BLOCKS?

The check looks confusing because it caps the number of blocks to 0xFFFF
(the WRITE SAME(10) limit) for WRITE SAME(16) commands. Several older
devices accept the 16-byte command which allows for a bigger block range
but they only actually check the lower two bytes. This will cause data
corruption as parts of a block range may not be zeroed as requested.

FWIW, I'm in agreement with your patch to disable write same in libata
as a quick fix for 4.9.

-- 
Martin K. Petersen	Oracle Linux Engineering

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ