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, 07 Jan 2015 22:45:11 +0800
From:	Chen Gang S <gang.chen@...rus.com.cn>
To:	Martin Schwidefsky <schwidefsky@...ibm.com>
CC:	Heiko Carstens <heiko.carstens@...ibm.com>, linux390@...ibm.com,
	holzheu@...ux.vnet.ibm.com, linux-s390@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] s390: include: timex: Use macro CLOCK_STORE_SIZE instead
 of hard code number

On 01/05/2015 04:59 PM, Martin Schwidefsky wrote:
> On Sat, 03 Jan 2015 11:44:04 +0800
> Chen Gang <gang.chen@...rus.com.cn> wrote:
> 
>>
>> Thank you for your work.
>>
>> In honest, originally, I was not sure whether it would cause bug (do not
>> know gcc would generic incorrect code for it). :-)
> 
> Even if the code happened to be correct it does not matter. The intention
> of the sizeof() has been to get to the correct 16, not 8. The fix is
> fine as it is.
> 

Excuse me, my English is not quite well, I am not quite sure about what
you said (might misunderstand what you said), so I provide the related
information below for confirmation, please check, thanks.

sizeof(clk) is for a pointer, not for an array (for C language, it
treats array parameter as a pointer), the related demo is below:

  [root@...alhost test]# cat ./test.c
  #include <stdio.h>
  
  static inline void get_tod_clock_ext(char clk[16])
  {
  	typedef struct { char _[sizeof(clk)]; } addrtype;
  
  	printf("\nsize: %ld\n", sizeof(addrtype));
  }
  
  int main()
  {
  	char clk[16];
  
  	get_tod_clock_ext(clk);
  	return 0;
  }
  [root@...alhost test]# cc -Wall -O2 -o test test.c
  [root@...alhost test]# ./test 
  
  size: 8
  [root@...alhost test]# cc -v
  Using built-in specs.
  COLLECT_GCC=cc
  COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.3/lto-wrapper
  Target: x86_64-redhat-linux
  Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-isl=/builddir/build/BUILD/gcc-4.8.3-20140624/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140624/obj-x86_64-redhat-linux/cloog-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
  Thread model: posix
  gcc version 4.8.3 20140624 (Red Hat 4.8.3-1) (GCC) 
  [root@...alhost test]# 


Thanks.
-- 
Open, share, and attitude like air, water, and life which God blessed.
--
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