Thread (14 messages) flat view 14 messages, 3 authors, 2016-08-25

Re: [PATCH] ata: do not hard code limit in ata_set_lba_range_entries()

From: Shaun Tancheff <hidden>
Date: 2016-08-22 20:32:45
Also in: linux-scsi

On Mon, Aug 22, 2016 at 3:07 PM, Tom Yan [off-list ref] wrote:
I don't see how that's possible. count / n_block will always be
smaller than 65535 * ATA_MAX_TRIM_RNUM(64) = 4194240. Not to mention
that isn't even a "buffer limit" anyway. By SG_IO do you mean like
SCSI Write Same commands that issued with sg_write_same or so? If
that's the case, that's what exactly commit 5c79097a28c2
("libata-scsi: reject WRITE SAME (16) with n_block that exceeds
limit") is for.
Ah, I see. You are guarding the only user of ata_set_lba_range_entries().
Still if you are going to do that you have to alert any new user that they
must have an appropriately sized buffer to be overwriting.

Better to move it out of ata.h then the limit the scope of accidental
misuse?

Regards,
Shaun
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help