17191153 ld: warning: symbol '_init' not found but .init section exists on s12_26
authorMisaki Miyashita <Misaki.Miyashita@Oracle.COM>
Mon, 22 Jul 2013 07:17:26 -0700
changeset 1401 367855861774
parent 1400 4e54fb56a064
child 1402 f225f89a0538
17191153 ld: warning: symbol '_init' not found but .init section exists on s12_26 17193314 ssh dumps core when using aes128-cbc cipher on T4
components/openssl/openssl-1.0.1/patches/32_aes_cbc_len_check.patch
components/openssl/openssl-1.0.1/patches/openssl-t4-inline.sparc-patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/openssl/openssl-1.0.1/patches/32_aes_cbc_len_check.patch	Mon Jul 22 07:17:26 2013 -0700
@@ -0,0 +1,14 @@
+--- openssl-1.0.1e/crypto/evp/e_aes.c        Tue Jul  2 11:03:12 2013
++++ openssl-1.0.1e/crypto/evp/e_aes.c.new    Tue Jul  2 11:04:56 2013
[email protected]@ -574,8 +574,11 @@
+ static int aes_cbc_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out,
+ 	const unsigned char *in, size_t len)
+ {
++	size_t	bl = ctx->cipher->block_size;
+ 	EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data;
+ 
++	if (len<bl)	return 1;
++
+ 	if (dat->stream.cbc)
+ 		(*dat->stream.cbc)(in,out,len,&dat->ks,ctx->iv,ctx->encrypt);
+ 	else if (ctx->encrypt)
--- a/components/openssl/openssl-1.0.1/patches/openssl-t4-inline.sparc-patch	Fri Jul 19 14:00:49 2013 -0700
+++ b/components/openssl/openssl-1.0.1/patches/openssl-t4-inline.sparc-patch	Mon Jul 22 07:17:26 2013 -0700
@@ -103,11 +103,10 @@
  .global	OPENSSL_cleanse
  .align	32
  OPENSSL_cleanse:
[email protected]@ -397,11 +432,102 @@
- .type	OPENSSL_cleanse,#function
[email protected]@ -398,6 +433,102 @@
  .size	OPENSSL_cleanse,.-OPENSSL_cleanse
  
--#ifndef _BOOT
+ #ifndef _BOOT
 +.global	_sparcv9_vis1_instrument_bus
 +.align	8
 +_sparcv9_vis1_instrument_bus:
@@ -207,11 +206,6 @@
  .section	".init",#alloc,#execinstr
  	call	OPENSSL_cpuid_setup
  	nop
--#else
--	nop
--	nop
--#endif
-
 Index: crypto/sparcv9cap.c
 ===================================================================
 diff -ru openssl-1.0.1e/crypto/sparcv9cap.c openssl-1.0.1e/crypto/sparcv9cap.c
@@ -286,15 +280,17 @@
  	}
  
  unsigned long	_sparcv9_rdtick(void);
[email protected]@ -36,11 +60,16 @@
[email protected]@ -36,11 +60,18 @@
  unsigned long	_sparcv9_vis1_instrument(void);
  void		_sparcv9_vis2_probe(void);
  void		_sparcv9_fmadd_probe(void);
 +unsigned long	_sparcv9_rdcfr(void);
 +void		_sparcv9_vis3_probe(void);
 +unsigned long	_sparcv9_random(void);
-+size_t 		_sparcv9_vis1_instrument_bus(unsigned int *,size_t);
++#ifndef _BOOT
++size_t 	_sparcv9_vis1_instrument_bus(unsigned int *,size_t);
 +size_t		_sparcv9_vis1_instrument_bus2(unsigned int *,size_t,size_t);
++#endif
  
  #ifndef _BOOT
  unsigned long OPENSSL_rdtsc(void)
@@ -304,10 +300,11 @@
  #if defined(__sun) && defined(__SVR4)
  		return gethrtime();
  #else
[email protected]@ -51,6 +81,25 @@
[email protected]@ -49,6 +80,24 @@
+ 	else
+ 		return _sparcv9_rdtick();
  	}
- #endif
- 
++
 +size_t OPENSSL_instrument_bus(unsigned int *out,size_t cnt)
 +	{
 +	if ((OPENSSL_sparcv9cap_P[0]&(SPARCV9_TICK_PRIVILEGED|SPARCV9_BLK)) ==
@@ -325,12 +322,10 @@
 +	else
 +		return 0;
 +	}
-+
-+
+ #endif
+
  #if defined(_BOOT)
- /*
-  * Hardcoding sparc capabilities for wanboot.
[email protected]@ -58,7 +106,7 @@
[email protected]@ -58,7 +107,7 @@
   */
  void OPENSSL_cpuid_setup(void)
  	{
@@ -2208,7 +2203,7 @@
  		dat->block	= (block128_f)AES_encrypt;
  		dat->stream.cbc	= mode==EVP_CIPH_CBC_MODE ?
  					(cbc128_f)AES_cbc_encrypt :
[email protected]@ -825,7 +1199,7 @@
[email protected]@ -828,7 +1202,7 @@
  #ifdef BSAES_CAPABLE
  		if (BSAES_CAPABLE)
  			{
@@ -2217,7 +2212,7 @@
  			CRYPTO_gcm128_init(&gctx->gcm,&gctx->ks,
  					(block128_f)AES_encrypt);
  			gctx->ctr = (ctr128_f)bsaes_ctr32_encrypt_blocks;
[email protected]@ -836,7 +1210,7 @@
[email protected]@ -839,7 +1213,7 @@
  #ifdef VPAES_CAPABLE
  		if (VPAES_CAPABLE)
  			{
@@ -2226,7 +2221,7 @@
  			CRYPTO_gcm128_init(&gctx->gcm,&gctx->ks,
  					(block128_f)vpaes_encrypt);
  			gctx->ctr = NULL;
[email protected]@ -843,7 +1217,7 @@
[email protected]@ -846,7 +1220,7 @@
  			break;
  			}
  #endif
@@ -2235,7 +2230,7 @@
  		CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, (block128_f)AES_encrypt);
  #ifdef AES_CTR_ASM
  		gctx->ctr = (ctr128_f)AES_ctr32_encrypt;
[email protected]@ -1074,17 +1448,17 @@
[email protected]@ -1077,17 +1451,17 @@
  		    {
  		    if (enc)
  			{
@@ -2256,7 +2251,7 @@
  		xctx->xts.block2 = (block128_f)vpaes_encrypt;
  
  		xctx->xts.key1 = &xctx->ks1;
[email protected]@ -1093,17 +1467,17 @@
[email protected]@ -1096,17 +1470,17 @@
  #endif
  		if (enc)
  			{
@@ -2277,7 +2272,7 @@
  		xctx->xts.block2 = (block128_f)AES_encrypt;
  
  		xctx->xts.key1 = &xctx->ks1;
[email protected]@ -1214,7 +1588,7 @@
[email protected]@ -1217,7 +1591,7 @@
  #ifdef VPAES_CAPABLE
  		if (VPAES_CAPABLE)
  			{
@@ -2286,7 +2281,7 @@
  			CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L,
  					&cctx->ks, (block128_f)vpaes_encrypt);
  			cctx->str = NULL;
[email protected]@ -1222,7 +1596,7 @@
[email protected]@ -1225,7 +1599,7 @@
  			break;
  			}
  #endif
@@ -2295,7 +2290,7 @@
  		CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L,
  					&cctx->ks, (block128_f)AES_encrypt);
  		cctx->str = NULL;
[email protected]@ -1310,5 +1684,4 @@
[email protected]@ -1313,5 +1687,4 @@
  BLOCK_CIPHER_custom(NID_aes,192,1,12,ccm,CCM,EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS)
  BLOCK_CIPHER_custom(NID_aes,256,1,12,ccm,CCM,EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS)