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:	Sat, 1 Jan 2011 18:28:34 +0100
From:	Torsten Kaiser <just.for.lkml@...glemail.com>
To:	Matthew Wilcox <matthew@....cx>
Cc:	roel kluin <roel.kluin@...il.com>, nick.cheng@...ca.com.tw,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>, James.Bottomley@...e.de,
	linux-scsi@...r.kernel.org
Subject: Re: [PATCH] [SCSI] arcmsr: &/| confusion in arcmsr_build_ccb()

On Sat, Jan 1, 2011 at 6:08 PM, Matthew Wilcox <matthew@....cx> wrote:
> On Sat, Jan 01, 2011 at 05:45:11PM +0100, roel kluin wrote:
>> The WRITE_{6,10,12} are defined numbers, so the branch was always taken.
>
> You're right, but even this will basically always set the write flag,
> since some bits will be set the same, even for reads.  Eg:
>
> #define READ_10               0x28
> #define WRITE_10              0x2a
>
> It should instead be:
>
>> +     if (pcmd->cmnd[0] == WRITE_6 || pcmd->cmnd[0] == WRITE_10 ||
>> +                     pcmd->cmnd[0] == WRITE_12 ){
>
> That will of course miss other commands which do writes, such as UNMAP
> and WRITE_32.  So we should do it properly:
>
>        if (pcmd->sc_data_direction == DMA_TO_DEVICE)
>                arcmsr_cdb->Flags |= ARCMSR_CDB_FLAG_WRITE;
>

<http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ae52e7f09ff509df11cd408eabe90132b6be1231;hp=f034260db330bb3ffc815fcb682b1c84aca09591#patch2>
@@ -1034,10 +1075,10 @@ static int arcmsr_build_ccb(struct
AdapterControlBlock *acb,
                }
                arcmsr_cdb->sgcount = (uint8_t)cdb_sgcount;
                arcmsr_cdb->DataLength = scsi_bufflen(pcmd);
+       arcmsr_cdb->msgPages = arccdbsize/0x100 + (arccdbsize % 0x100 ? 1 : 0);
                if ( arccdbsize > 256)
                        arcmsr_cdb->Flags |= ARCMSR_CDB_FLAG_SGL_BSIZE;
-       }
-       if (pcmd->sc_data_direction == DMA_TO_DEVICE ) {
+       if (pcmd->cmnd[0]|WRITE_6 || pcmd->cmnd[0] | WRITE_10 ||
pcmd->cmnd[0]|WRITE_12) {
                arcmsr_cdb->Flags |= ARCMSR_CDB_FLAG_WRITE;
                ccb->ccb_flags |= CCB_FLAG_WRITE;
        }

Until June 2010 it was that way...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ