Thread
Commits
-
Make fallback MD5 implementation thread-safe on big-endian systems
- 7696b2ea5241 14.14 landed
- a38f5f880d1e 15.9 landed
- 0583863e9e6e 16.5 landed
- ffac8ac48e40 17.0 landed
- 2676040df0b2 18.0 landed
-
Refactor MD5 implementations according to new cryptohash infrastructure
- b67b57a966af 14.0 cited
-
Thread-unsafe MD5 on big-endian systems with no OpenSSL
Heikki Linnakangas <hlinnaka@iki.fi> — 2024-08-06T12:23:26Z
While browsing through all our global variables for the multithreading effort, I noticed that our MD5 implementation in src/common/md5.c uses a static buffer on big-endian systems, which makes it not thread-safe. That's a bug because that function is also used in libpq. This was introduced in commit b67b57a966, which replaced the old MD5 fallback implementation with the one from pgcrypto. The thread-safety didn't matter for pgcrypto, but for libpq it does. This only affects big-endian systems that are compiled without OpenSSL. -- Heikki Linnakangas Neon (https://neon.tech)
-
Re: Thread-unsafe MD5 on big-endian systems with no OpenSSL
Robert Haas <robertmhaas@gmail.com> — 2024-08-06T14:04:58Z
On Tue, Aug 6, 2024 at 8:23 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote: > While browsing through all our global variables for the multithreading > effort, I noticed that our MD5 implementation in src/common/md5.c uses a > static buffer on big-endian systems, which makes it not thread-safe. > That's a bug because that function is also used in libpq. > > This was introduced in commit b67b57a966, which replaced the old MD5 > fallback implementation with the one from pgcrypto. The thread-safety > didn't matter for pgcrypto, but for libpq it does. > > This only affects big-endian systems that are compiled without OpenSSL. LGTM. -- Robert Haas EDB: http://www.enterprisedb.com
-
Re: Thread-unsafe MD5 on big-endian systems with no OpenSSL
Michael Paquier <michael@paquier.xyz> — 2024-08-06T15:11:23Z
> On Aug 6, 2024, at 23:05, Robert Haas <robertmhaas@gmail.com> wrote: > On Tue, Aug 6, 2024 at 8:23 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote: >> >> This only affects big-endian systems that are compiled without OpenSSL. > > LGTM. Nice catch, looks fine to me as well. -- Michael
-
Re: Thread-unsafe MD5 on big-endian systems with no OpenSSL
Heikki Linnakangas <hlinnaka@iki.fi> — 2024-08-07T07:51:36Z
On 06/08/2024 18:11, Michael Paquier wrote: > >> On Aug 6, 2024, at 23:05, Robert Haas <robertmhaas@gmail.com> wrote: >> On Tue, Aug 6, 2024 at 8:23 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote: >>> >>> This only affects big-endian systems that are compiled without OpenSSL. >> >> LGTM. > > Nice catch, looks fine to me as well. Committed, thanks -- Heikki Linnakangas Neon (https://neon.tech)