Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-06-01 Thread Kees Cook via Gcc-patches
On Tue, Jun 01, 2021 at 04:35:53PM -0400, David Malcolm wrote: > [...] > Did this patch get reviewed/approved? It's still under review, but I think it's close. > Is the latest version still this one: > https://gcc.gnu.org/pipermail/gcc-patches/2021-February/565581.html > or is there a more

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-06-01 Thread David Malcolm via Gcc-patches
On Mon, 2021-03-15 at 12:14 -0500, Qing Zhao via Gcc-patches wrote: > (CC’ing gcc-patch alias). > > Hi, Kees, > > > > On Mar 12, 2021, at 3:55 PM, Kees Cook wrote: > > > > On Fri, Mar 12, 2021 at 03:35:28PM -0600, Qing Zhao wrote: > > > Hi, Kees, > > > > > > I am looking at the structure

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-03-15 Thread Qing Zhao via Gcc-patches
(CC’ing gcc-patch alias). Hi, Kees, > On Mar 12, 2021, at 3:55 PM, Kees Cook wrote: > > On Fri, Mar 12, 2021 at 03:35:28PM -0600, Qing Zhao wrote: >> Hi, Kees, >> >> I am looking at the structure padding initialization issue. And also have >> some questions: >> >> >>> On Feb 24, 2021, at

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-03-12 Thread Kees Cook via Gcc-patches
On Fri, Mar 12, 2021 at 03:35:28PM -0600, Qing Zhao wrote: > Hi, Kees, > > I am looking at the structure padding initialization issue. And also have > some questions: > > > > On Feb 24, 2021, at 10:41 PM, Kees Cook wrote: > > > > It looks like there is still some issues with padding and

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-03-12 Thread Qing Zhao via Gcc-patches
Hi, Kees, I am looking at the structure padding initialization issue. And also have some questions: > On Feb 24, 2021, at 10:41 PM, Kees Cook wrote: > > It looks like there is still some issues with padding and pre-case > switch variables. Here's the test output, FWIW: > > >

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-03-12 Thread Qing Zhao via Gcc-patches
> On Mar 11, 2021, at 6:46 PM, Kees Cook wrote: > > On Thu, Mar 11, 2021 at 03:47:17PM -0600, Qing Zhao wrote: >> Hi, Kees, >> >> Sorry for the late reply (I have been busy with other work recently). >> >> Currently, I am working on the issue of flexible length array as the last >> field

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-03-11 Thread Kees Cook via Gcc-patches
On Thu, Mar 11, 2021 at 03:47:17PM -0600, Qing Zhao wrote: > Hi, Kees, > > Sorry for the late reply (I have been busy with other work recently). > > Currently, I am working on the issue of flexible length array as the last > field of the structure. > > In order to fix it correctly, I have the

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-03-11 Thread Qing Zhao via Gcc-patches
Hi, Kees, Sorry for the late reply (I have been busy with other work recently). Currently, I am working on the issue of flexible length array as the last field of the structure. In order to fix it correctly, I have the following question: > On Feb 26, 2021, at 3:42 PM, Kees Cook wrote: > >

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-02-26 Thread Qing Zhao via Gcc-patches
Thanks. I will take a look and fix this issue. BTW, could you please also re-test -ftrivial-auto-var-init=zero -fauto-var-init-approach=D too? And let me know are there new issues for -ftrivial-auto-var-init=zero? (FYI, I have tested -ftrivial-auto-var-init=zero -fauto-var-init-approach=D and

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-02-26 Thread Kees Cook via Gcc-patches
On Thu, Feb 25, 2021 at 05:56:38PM -0600, Qing Zhao wrote: > Just noticed that you didn’t add -fauto-var-init-approach=D to the command > line. Ah-ha! I didn't realize that was needed; thanks. However, now some of the sources crash in a different way. Here's the reproducer: $ cat poc.i struct

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-02-25 Thread Qing Zhao via Gcc-patches
Hi, Kees, Just noticed that you didn’t add -fauto-var-init-approach=D to the command line. [qinzhao@localhost uninit]$ cat t8.c a() { char b[1]; } [qinzhao@localhost uninit]$ sh t /home/qinzhao/Install/latest/bin/gcc -ftrivial-auto-var-init=pattern -fauto-var-init-approach=D t8.c -S t8.c:1:1:

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-02-25 Thread Kees Cook via Gcc-patches
On Thu, Feb 25, 2021 at 12:15:01PM -0600, Qing Zhao wrote: > > On Feb 24, 2021, at 10:41 PM, Kees Cook wrote: > > [...] > > test_stackinit: trailing_hole_none ok > > test_stackinit: packed_none ok > > test_stackinit: user ok > > test_stackinit: failures: 8 > > Does the above testing include

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-02-25 Thread Qing Zhao via Gcc-patches
Hi, Kees, Thanks a lot for your testings on linux kernel. I am happy to know that the initial implementation works fine. I will study the padding case and the switch case to fix the issues there. > On Feb 24, 2021, at 10:41 PM, Kees Cook wrote: > > (please keep me in CC, I'm not

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-02-24 Thread Kees Cook via Gcc-patches
(please keep me in CC, I'm not subscribed...) On Thu Feb 18, 2021 Qing Zhao said: > Initialize automatic variables with new first class option > -ftrivial-auto-var-init=[uninitialized|pattern|zero] Yay! I'm really excited to see this. Thank you for working on it! I've built GCC with this

Re: [RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-02-19 Thread Martin Jambor
On Thu, Feb 18 2021, Qing Zhao via Gcc-patches wrote: > (CC’ing Kees Cook on this topic) > > Hi, > > This is the first version of the complete patch for the new security feature > for GCC: > > Initialize automatic variables with new first class option >

[RFC][patch for gcc12][version 1] add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-02-18 Thread Qing Zhao via Gcc-patches
(CC’ing Kees Cook on this topic) Hi, This is the first version of the complete patch for the new security feature for GCC: Initialize automatic variables with new first class option -ftrivial-auto-var-init=[uninitialized|pattern|zero] and a new variable attribute “uninitialized” to