Re: Fix memset usage in pgcrypto

Lists: pgsql-hackers
From: Marko Kreen <markokr(at)gmail(dot)com>
To: Postgres Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Fix memset usage in pgcrypto
Date: 2013-12-26 13:42:12
Message-ID: 20131226134212.GB17885@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

http://www.viva64.com/en/b/0227/ reported that on-stack memset()s
might be optimized away by compilers. Fix it.

* Replace memset() with px_memset()
* Add px_memset to copy_crlf()
* ADd px_memset to pgp-s2k.c

--
marko

Attachment Content-Type Size
pgcrypto-memset.diff text/x-diff 17.9 KB

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Marko Kreen <markokr(at)gmail(dot)com>
Cc: Postgres Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix memset usage in pgcrypto
Date: 2014-01-20 21:49:21
Message-ID: 20140120214921.GE10723@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Marko Kreen escribió:
> http://www.viva64.com/en/b/0227/ reported that on-stack memset()s
> might be optimized away by compilers. Fix it.

Just to clarify, this needs to be applied to all branches, right? If
so, does the version submitted apply cleanly to all of them?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Marko Kreen <markokr(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Postgres Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix memset usage in pgcrypto
Date: 2014-01-21 12:07:51
Message-ID: 20140121120751.GA23428@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Jan 20, 2014 at 06:49:21PM -0300, Alvaro Herrera wrote:
> Marko Kreen escribió:
> > http://www.viva64.com/en/b/0227/ reported that on-stack memset()s
> > might be optimized away by compilers. Fix it.
>
> Just to clarify, this needs to be applied to all branches, right? If
> so, does the version submitted apply cleanly to all of them?

It does apply cleanly. It is not critical fix, but it's simple,
so I think it should be back-patched.

--
marko


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Marko Kreen <markokr(at)gmail(dot)com>
Cc: Postgres Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix memset usage in pgcrypto
Date: 2014-04-01 01:03:41
Message-ID: 20140401010341.GA10316@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Dec 26, 2013 at 03:42:12PM +0200, Marko Kreen wrote:
> http://www.viva64.com/en/b/0227/ reported that on-stack memset()s
> might be optimized away by compilers. Fix it.
>
> * Replace memset() with px_memset()
> * Add px_memset to copy_crlf()
> * ADd px_memset to pgp-s2k.c

Where are we on this patch? Seems it needs backpatching too.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Marko Kreen <markokr(at)gmail(dot)com>
Cc: Postgres Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix memset usage in pgcrypto
Date: 2014-04-17 16:38:13
Message-ID: 20140417163813.GH7443@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Mar 31, 2014 at 09:03:41PM -0400, Bruce Momjian wrote:
> On Thu, Dec 26, 2013 at 03:42:12PM +0200, Marko Kreen wrote:
> > http://www.viva64.com/en/b/0227/ reported that on-stack memset()s
> > might be optimized away by compilers. Fix it.
> >
> > * Replace memset() with px_memset()
> > * Add px_memset to copy_crlf()
> > * ADd px_memset to pgp-s2k.c
>
> Where are we on this patch? Seems it needs backpatching too.

Patch backpatched through 8.4. Thanks.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +