From: Christoph Hellwig Date: Tue, 25 Apr 2017 11:39:54 +0000 (+0200) Subject: libata: reject passthrough WRITE SAME requests X-Git-Tag: v3.2.92~16 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d34a500e77add127cdee5b4778079596a9ebabe;p=pandora-kernel.git libata: reject passthrough WRITE SAME requests commit c6ade20f5e50e188d20b711a618b20dd1d50457e upstream. The WRITE SAME to TRIM translation rewrites the DATA OUT buffer. While the SCSI code accomodates for this by passing a read-writable buffer userspace applications don't cater for this behavior. In fact it can be used to rewrite e.g. a readonly file through mmap and should be considered as a security fix. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Signed-off-by: Tejun Heo [bwh: Backported to 3.2: - Open-code blk_rq_is_passthrough() - We don't distinguish which field is invaid so goto invalid_fld - Adjust context] Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed