2011-01-16 5 views
1

동료, 내가 ATA에 대한 지원을 구현하고 있습니다ATA 신뢰할 수있는 명령은

는 자체 암호화 드라이브를 지원하는 명령

0x5C, TRUSTED RECEIVE, 
0x5D, TRUSTED RECEIVE DMA, 
0x5E, TRUSTED SEND 
0x5F, TRUSTED SEND DMA, 
Linux 용

(두 호스트, 페도라 12, 14)을 믿었습니다. 이 페이지의 코드 http://www.jukie.net/bart/blog/ata-via-scsi을 기본 코드로 사용했습니다. 받을 신뢰를 들어 (이 층에는 0xEC를 식별하기 위해 동일) :

sg_io.interface_id = 'S'; 
sg_io.cmdp   = cdb; 
sg_io.cmd_len   = sizeof(cdb); 
sg_io.dxferp   = data_in_buffer; 
sg_io.dxfer_len  = data_in_length;   // multiple of 512 
sg_io.dxfer_direction = SG_DXFER_FROM_DEV; 
sg_io.sbp    = sense; 
sg_io.mx_sb_len  = sizeof(sense); 
sg_io.timeout   = 5000;     // 5 seconds 


cdb[0] = 0x85;   // pass-through ATA16 command (no translation) 
cdb[1] = (4 << 1);  // data-in 
cdb[2] = 0x2e;   // data-in 
cdb[4] = feature_id;  // ATA feature ID 
cdb[6] = 1;    // number of sectors 
cdb[7] = lba_low >> 8; 
cdb[8] = lba_low; 
cdb[9] = lba_mid >> 8; 
cdb[10] = lba_mid; 
cdb[11] = lba_high >> 8; 
cdb[12] = lba_high; 
cdb[14] = 0x5C;   // TRUSTED RECEIVE 

rc = ioctl (fd, SG_IO, &sg_io); 

그것은 신뢰할 수있는 명령에 대해 확인하고 다른 모든 명령에 대해 완벽하게 작동,하지만. 프로토콜 분석기를 연결하면 이러한 명령이 SATA 버스로 전송되지 않습니다. 그들은 Windows에서 (내 코드가 아닌,하지만 난 ATA_PASS_THROUGH를 사용하는 것 같아) 괜찮아오고 있기 때문에 어댑터는 그들을 보낼 수 있습니다. 그리고 네, 저는이 코드를 루트로 실행하고 있습니다.

+0

무엇 lba_low, lba_mid 및 lba_high .. 어떻게 이러한 변수를 설정하는 방법에 대한 정보를 찾을 수 있습니까? – Nick

답변

4

/usr/src/linux/drivers/ata/libata-scsi.c를 참조하십시오이 비밀을 :) 해결하기 위해 도와주세요 :

/* 
* Filter TPM commands by default. These provide an 
* essentially uncontrolled encrypted "back door" between 
* applications and the disk. Set libata.allow_tpm=1 if you 
* have a real reason for wanting to use them. This ensures 
* that installed software cannot easily mess stuff up without 
* user intent. DVR type users will probably ship with this enabled 
* for movie content management. 
* 
* Note that for ATA8 we can issue a DCS change and DCS freeze lock 
* for this and should do in future but that it is not sufficient as 
* DCS is an optional feature set. Thus we also do the software filter 
* so that we comply with the TC consortium stated goal that the user 
* can turn off TC features of their system. 
*/ 
if (tf->command >= 0x5C && tf->command <= 0x5F && !libata_allow_tpm) 
     goto invalid_fld; 
+0

고마워요, 감사합니다, Ephemient! –

+0

"modprobe libata allow_tpm = 1"이 내 Fedora 14에서 작동하지 않는 것 같습니다. –

+0

@Dmitry :'libata'가 이미로드되어 있으면 작동하지 않습니다. 커널 명령 행에서'libata.allow_tpm = 1' 또는'/ etc/modprobe.conf' 또는'/etc/modprobe.d/ * .conf'에서'options libata allow_tpm = 1'로 부팅해야합니다 시스템 설정 방법에 따라 다릅니다. – ephemient

관련 문제