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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 10 Aug 2016 18:56:07 +0800
From:	Tom Yan <tom.ty89@...il.com>
To:	Shaun Tancheff <shaun@...cheff.com>
Cc:	linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org,
	Christoph Hellwig <hch@....de>, Tejun Heo <tj@...nel.org>,
	Josh Bingaman <josh.bingaman@...gate.com>,
	Shaun Tancheff <shaun.tancheff@...gate.com>
Subject: Re: [PATCH v5 1/2] Use kmap_atomic when rewriting attached page

On 10 August 2016 at 09:00, Shaun Tancheff <shaun@...cheff.com> wrote:
>  static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
>  {
>         struct ata_taskfile *tf = &qc->tf;
>         struct scsi_cmnd *scmd = qc->scsicmd;
>         struct ata_device *dev = qc->dev;
>         const u8 *cdb = scmd->cmnd;
> +       struct scatterlist *sg;
>         u64 block;
>         u32 n_block;
> +       const u32 trmax = ATA_MAX_TRIM_RNUM;
>         u32 size;
> -       void *buf;
>         u16 fp;
>         u8 bp = 0xff;
>
> @@ -3319,10 +3363,9 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
>         if (!scsi_sg_count(scmd))
>                 goto invalid_param_len;
>
> -       buf = page_address(sg_page(scsi_sglist(scmd)));
> -
> -       if (n_block <= 65535 * ATA_MAX_TRIM_RNUM) {
> -               size = ata_set_lba_range_entries(buf, ATA_MAX_TRIM_RNUM, block, n_block);
> +       sg = scsi_sglist(scmd);
> +       if (n_block <= 0xffff * cmax) {

Although this got moved and corrected in the next patch, but perhaps
you should still correct the `cmax` here, which should be `trmax`.

> +               size = ata_format_dsm_trim_descr(sg, trmax, block, n_block);
>         } else {
>                 fp = 2;
>                 goto invalid_fld;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ