Index: sw/release/Makefile =================================================================== RCS file: /home/routefree/ng/depot/sw/release/Makefile,v retrieving revision 1.2 retrieving revision 1.2.24.1 diff -r1.2 -r1.2.24.1 3c3 < SUBDIRS = flash sdk --- > SUBDIRS = flash sdk rm Index: sw/rvl/boot/compat/Makefile =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/boot/compat/Makefile,v retrieving revision 1.16 retrieving revision 1.16.6.1 diff -r1.16 -r1.16.6.1 18,21c18,23 < LCDEFS += -DBOOT1_DISABLE_DCACHE < LCDEFS += -DBOOT1_DISABLE_EFUSE < LCDEFS += -DBOOT1_DISABLE_EEPROM < LLDLIBS += -lsys -lcsl -lioslibc #-lee --- > > LLDLIBS += -lsys -lioslibc > #Don't link -lee if EEPROM is disabled > DEVEL_LIBS = -lcsl_dev > PROD_LIBS = -lcsl -lee > 47c49 < $(CC) -c -DRVL_DEVEL_PKI $(CFLAGS) -o $@ $^ --- > $(CC) -c -DRVL_DEVEL_PKI -DBOOT1_DISABLE_EEPROM $(CFLAGS) -o $@ $^ 50c52 < $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) --- > $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(DEVEL_LIBS) $(LDLIBS) 75c77 < $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) --- > $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(PROD_LIBS) $(LDLIBS) 105c107 < mini_ios.mrg: $(ROOT)/usr/bin/rvl/mini_ios.elf $(ROOT)/usr/bin/rvl/mini_ohci1.elf $(NG_ADDR_MAP) --- > mini_ios.mrg: $(ROOT)/usr/bin/rvl/mini_ios.elf $(NG_ADDR_MAP) 111d112 < -v $(ROOT)/usr/bin/rvl/mini_ohci1.elf Index: sw/rvl/boot/compat/load_boot2.c =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/boot/compat/load_boot2.c,v retrieving revision 1.4 retrieving revision 1.4.12.1 diff -r1.4 -r1.4.12.1 51a52 > #define NAPA_BUFFER_SIZE (16*1024) 68a70,77 > /* > * String limiting for cert names; > * each piece is a two-char name followed by 8 digits; > * we build up ROOT plus up to 3 pieces, for a total of 4; > * sizeof(IOSCName) is 64, divide by 4 is 16 for each piece; > */ > #define SIZE_LIMCNAME (sizeof(IOSCName) / 4) > 167c176 < * a reason code alternating with zero. --- > * a reason code alternating with its bitwise NOT. 175c184 < outputLed(0); --- > outputLed(~reason); 217a227,230 > if (base & (ALIGN_SZ - 1)) { > rc = REASON_HASH; > goto runHashAsync_out; > } 308,310d320 < < < 568a579 > * - Assert that all header values do not point outside the flash block 571c582,586 < (wadHdr->hdrSize > FL_PAGE_SIZE) || --- > (wadHdr->certSize != (sizeof(IOSCRsa4096RsaCert) > + (2 * sizeof(IOSCRsa2048RsaCert)))) || > (wadHdr->ticketSize != sizeof(ESTicket)) || > (wadHdr->tmdSize != (sizeof(IOSCSigRsa2048) > + sizeof(ESTitleMetaHeader) + sizeof(ESContentMeta))) || 575c590 < // printf("load wad header failed: BAD HEADER\n"); --- > // printf("load wad header failed: BAD HEADER\n"); 604c619 < verifySig(void *p, IOSCName *issuer, void *pubKey, CSLOSRsaExponent *exp, --- > verifySig( u32 base, void *p, IOSCName *issuer, void *pubKey, CSLOSRsaExponent *exp, 608c623,624 < u32 base, hashSize, ctx; --- > void *bp; > u32 hashSize, ctx; 616a633,649 > /* memcpy() could be abused for attacks if not checked; > * some of the wad header sizes have been checked to stay within the > * flash block, but some are combined, so we need to check p again; > * assert that copied size fits into 32k NAPA_BUFFER_2 > */ > bp = (void *)base; > rc = REASON_BADHEADER; > if (p < bp) { > goto verifySig_out; /* obvious violation */ > } > if (p > (bp + FL_BLOCK_SIZE)) { > goto verifySig_out; /* something is outside flash block */ > } > if (size >= NAPA_BUFFER_SIZE) { > goto verifySig_out; /* size too big */ > } > 652a686,691 > /* hashSize could still be bad if corrupted size is passed in > * it is unsigned, so can't be < 0, but roll over > */ > if (hashSize >= NAPA_BUFFER_SIZE) { > goto verifySig_out; > } 750,752d788 < #ifndef BOOT1_DISABLE_EFUSE < u32 i; < #endif 782c818 < strncpy(issuerName, ES_ROOT_NAME, sizeof (IOSCName)); --- > strncpy(issuerName, ES_ROOT_NAME, SIZE_LIMCNAME); 785c821 < rc = verifySig(caCert, &issuerName, pubKey4096, exp, TYPE_CERT4096, --- > rc = verifySig(base, caCert, &issuerName, pubKey4096, exp, TYPE_CERT4096, 799,800c835,836 < strncat(issuerName, "-", sizeof (IOSCName)); < strncat(issuerName, *entityName, sizeof (IOSCName)); --- > strncat(issuerName, "-", 2); > strncat(issuerName, *entityName, SIZE_LIMCNAME); 803c839 < rc = verifySig(cpCert, &issuerName, pubKey2048, exp, TYPE_CERT2048, --- > rc = verifySig(base, cpCert, &issuerName, pubKey2048, exp, TYPE_CERT2048, 820,821c856,857 < strncat(issuerName, "-", sizeof (IOSCName)); < strncat(issuerName, *entityName, sizeof (IOSCName)); --- > strncat(issuerName, "-", 2); > strncat(issuerName, *entityName, SIZE_LIMCNAME); 824c860 < rc = verifySig(tmd, &issuerName, pubKey2048, exp, TYPE_TMD, --- > rc = verifySig(base, tmd, &issuerName, pubKey2048, exp, TYPE_TMD, 838c874 < rc = verifySig(xsCert, &issuerName, pubKey2048, exp, TYPE_CERT2048, --- > rc = verifySig(base, xsCert, &issuerName, pubKey2048, exp, TYPE_CERT2048, 851,852c887,888 < strncat(issuerName, "-", sizeof (IOSCName)); < strncat(issuerName, *entityName, sizeof (IOSCName)); --- > strncat(issuerName, "-", 2); > strncat(issuerName, *entityName, SIZE_LIMCNAME); 855c891 < rc = verifySig(ticket, &issuerName, pubKey2048, exp, TYPE_TICKET, --- > rc = verifySig(base, ticket, &issuerName, pubKey2048, exp, TYPE_TICKET, 861c897 < #ifdef BOOT1_DISABLE_EFUSE --- > /* Efuse use always disabled */ 863,877d898 < #else < /* Read the common key from eFuse */ < readEfuse(NV_RVL_COMMON_AES_KEY_OFF / sizeof (u32), (u8 *) commonKey, < NV_RVL_COMMON_AES_KEY_SIZE); < < /* If the common key is not programmed, use the default key */ < for (i = 0; i < NV_RVL_COMMON_AES_KEY_SIZE; i++) { < if (commonKey[i] != 0) { < break; < } < } < if (i == NV_RVL_COMMON_AES_KEY_SIZE) { < memcpy(commonKey, commonAesKey, sizeof (CSLOSAesKey)); < } < #endif 904a926,927 > #ifdef BOOT1_DISABLE_EEPROM > printf("boot2 version not checked. EEPROM use disabled\n"); 905a929,932 > #else > ver = EE_GetOsVersion(); > printf("boot2 version read from EEPROM: %d\n", ver); > #endif 908a936 > printf("boot1_compat failed: bad boot2 version\n"); 910a939 > printf("boot1_compat boot2 version check passed\n"); 927d955 < 1140c1168 < static void --- > void 1187c1215,1216 < /* setupEfuse ? */ --- > #ifndef BOOT1_DISABLE_EEPROM > /* GPIO for EEPROM access */ 1188a1218,1219 > EE_GPIOSetup(); > #endif 1193d1223 < // printf("load block map done\n"); 1209d1238 < // printf("skip bad blocks done\n"); 1213d1241 < // printf("load wad header failed: rc = 0x%x (%d)\n", rc, rc); 1216d1243 < // printf("load wad header done\n"); 1221d1247 < // printf("verify bundle failed: rc = %d\n", rc); 1224d1249 < // printf("verify bundle done\n"); 1235d1259 < // printf("loadboot2: base = 0x%x skipBytes = 0x%x\n", base, skipBytes); 1239d1262 < // printf("---- loadBoot2 dir: %u base: 0x%x returns \n", dir, base); Index: sw/rvl/include/iop.h =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/include/iop.h,v retrieving revision 1.34 retrieving revision 1.34.4.1 diff -r1.34 -r1.34.4.1 329a330,332 > > #define NAPA_BASE 0x00000000 > #define NAPA_SIZE 0x01800000 Index: sw/rvl/os/di/dvd_driver.c =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/di/dvd_driver.c,v retrieving revision 1.49 retrieving revision 1.49.4.1 diff -r1.49 -r1.49.4.1 1c1 < #ident "$Id: dvd_driver.c,v 1.49 2007/05/12 00:07:10 craig Exp $" --- > #ident "$Id: dvd_driver.c,v 1.49.4.1 2008/04/29 18:05:51 cnguyen Exp $" 847a848,851 > #if !defined(BOOT_CACHE) > return(DVD_INTTYPE_CALLER); > #endif > 922a927,930 > #if !defined(BOOT_CACHE) > return(DVD_INTTYPE_CALLER); > #endif > 1046a1055,1058 > #if !defined(BOOT_CACHE) > return(DVD_INTTYPE_CALLER); > #endif > Index: sw/rvl/os/ios/Makefile =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/ios/Makefile,v retrieving revision 1.44 retrieving revision 1.44.2.4 diff -r1.44 -r1.44.2.4 12a13 > OS_CSL = ios_csl.elf 13a15 > OS_REAL_CSL = ios_real_csl.elf 24c26,27 < $(OS_SKIPEF) $(PROD_OS_REAL) $(PROD_BOOT2_OS_REAL) --- > $(OS_SKIPEF) $(PROD_OS_REAL) $(PROD_BOOT2_OS_REAL) \ > $(OS_CSL) $(OS_REAL_CSL) 72d74 < 112a115,126 > # cslrsa_dev.o - Development version for CSL_VerifyRsaSig() > cslrsa_dev.o: $(CSL_DEV_LIB) > $(AR) x $(CSL_DEV_LIB) $@ > rm -f crypto_tmp/cslrsa*.o > mv $@ crypto_tmp/. > > # cslrsa.o - Production version for CSL_VerifyRsaSig() > cslrsa.o: $(CSL_LIB) > $(AR) x $(CSL_LIB) $@ > rm -f crypto_tmp/cslrsa*.o > mv $@ crypto_tmp/. > 133a148 > CSL_DEV_LIB =$(ROOT)/usr/lib/rvl/libcsl_dev.a 155a171 > rm crypto_tmp/cslrsa.o 191c207 < $(OS_CRYPTO): $(CRYPTO_LINKER_FILE) crypto_objs shell_objs $(CRYPTO_OBJS) --- > $(OS_CRYPTO): $(CRYPTO_LINKER_FILE) crypto_objs cslrsa_dev.o shell_objs $(CRYPTO_OBJS) 196a213,216 > # Real image with crypto, cslrsa and shell > $(OS_CSL): $(CRYPTO_LINKER_FILE) crypto_objs cslrsa.o shell_objs $(CRYPTO_OBJS) > $(CC) $(CFLAGS) -o $(OS_CSL) $(CRYPTO_OBJS) crypto_tmp/*.o shell_tmp/*.o $(LDFLAGS) $(LDLIBS) -T $(CRYPTO_LINKER_FILE) > 209c229 < $(OS_REAL): $(CRYPTO_LINKER_FILE) crypto_objs $(REAL_OBJS) --- > $(OS_REAL): $(CRYPTO_LINKER_FILE) crypto_objs cslrsa_dev.o $(REAL_OBJS) 211a232,235 > # Real image with crypto, cslrsa and no shell > $(OS_REAL_CSL): $(CRYPTO_LINKER_FILE) crypto_objs cslrsa.o $(REAL_OBJS) > $(CC) $(CFLAGS) -o $(OS_REAL_CSL) $(REAL_OBJS) crypto_tmp/*.o $(LDFLAGS) $(LDLIBS) -T $(CRYPTO_LINKER_FILE) > 214c238 < $(OS_SKIPEF): $(CRYPTO_LINKER_FILE) crypto_objs $(SKIPEF_OBJS) --- > $(OS_SKIPEF): $(CRYPTO_LINKER_FILE) crypto_objs cslrsa.o $(SKIPEF_OBJS) 219c243 < $(BOOT2_OS_REAL): crypto_objs $(BOOT2_REAL_OBJS) --- > $(BOOT2_OS_REAL): crypto_objs cslrsa.o $(BOOT2_REAL_OBJS) 224c248 < $(PROD_OS_REAL): $(CRYPTO_LINKER_FILE) crypto_objs $(PROD_REAL_OBJS) --- > $(PROD_OS_REAL): $(CRYPTO_LINKER_FILE) crypto_objs cslrsa.o $(PROD_REAL_OBJS) 229c253 < $(PROD_BOOT2_OS_REAL): crypto_objs $(PROD_BOOT2_REAL_OBJS) --- > $(PROD_BOOT2_OS_REAL): crypto_objs cslrsa.o $(PROD_BOOT2_REAL_OBJS) Index: sw/rvl/os/sdi/sdi_mgr.c =================================================================== RCS file: /home/routefree/ng/depot/sw/rvl/os/sdi/sdi_mgr.c,v retrieving revision 1.38 retrieving revision 1.38.8.2 diff -r1.38 -r1.38.8.2 16c16 < #ident "$Id: sdi_mgr.c,v 1.38 2007/01/26 18:27:11 cnguyen Exp $" --- > #ident "$Id: sdi_mgr.c,v 1.38.8.2 2008/05/06 21:16:21 cnguyen Exp $" 22a23 > #include 24a26 > #include 40a43,44 > static u32 __sdiPpcReq = 0; /* set to 1 if request comes from PPC */ > 224a229,237 > /* The open request is coming from PPC */ > if (args->uid >= ES_SYS_APP_UID) { > SDPrint(SD_DEBUG_INFO, "IOS_OPEN: request from PPC: uid=0x%x\n", > args->uid); > __sdiPpcReq = 1; > } > else > __sdiPpcReq = 0; > 328a342,365 > /* > * Check for valid address range: > * - Less than IOP GDDR3 region (which includes PPC GDDR3 + Napa) > * - Inside the shared heap region OR SD region only if the request is > * NOT from PPC > */ > static int > verifyAddr(u32 addr, u32 len) > { > u32 startAddr, endAddr; > > startAddr = addr & 0x1FFFFFFF; > endAddr = startAddr + len; > > if ((endAddr <= IOP_GDDR3_START) || ((!__sdiPpcReq) && > (((startAddr >= SHARED_SP_START) && (endAddr <= SHARED_SP_END)) || > ((startAddr >= SD0_SP_START) && (endAddr <= SD0_SP_END))))) { > return(1); > } > else > return(0); > } > > 475a513,524 > /* Check for valid system buffer address in write */ > if ((cmd_op->command == 24) || (cmd_op->command == 25)) { > if (!verifyAddr(cmd_op->sys_addr, > cmd_op->blk_count*cmd_op->blk_size)) { > SDPrint(SD_DEBUG_ERROR, > "SD: Illegal write - bad addr 0x%x of len %d\n", > cmd_op->sys_addr, cmd_op->blk_count*cmd_op->blk_size); > rv = IOS_ERROR_INVALID; > break; > } > } > Index: sw/server/rsync.libs =================================================================== RCS file: /home/routefree/ng/depot/sw/server/rsync.libs,v retrieving revision 1.4 retrieving revision 1.4.22.1 diff -r1.4 -r1.4.22.1 2a3 > libcsl_dev.a