pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Clear padding of PgStat_HashKey when handling pgstats entries
4+ messages / 1 participants
[nested] [flat]

* pgsql: Clear padding of PgStat_HashKey when handling pgstats entries
@ 2024-11-05 00:41  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Paquier @ 2024-11-05 00:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Clear padding of PgStat_HashKey when handling pgstats entries

PgStat_HashKey is currently initialized in a way that could result in
random data if the structure has any padding bytes.  The structure
has no padding bytes currently, fortunately, but it could become a
problem should the structure change at some point in the future.

The code is changed to use some memset(0) so as any padding would be
handled properly, as it would be surprising to see random failures in
the pgstats entry lookups.  PgStat_HashKey is a structure internal to
pgstats, and an ABI change could be possible in the scope of a bug fix,
so backpatch down to 15 where this has been introduced.

Author: Bertrand Drouvot
Reviewed-by: Jelte Fennema-Nio, Michael Paquier
Discussion: https://postgr.es/m/Zyb7RW1y9dVfO0UH@ip-10-97-1-34.eu-west-3.compute.internal
Backpatch-through: 15

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7f3b41ce48a58f090da94dbcc737483c217ce9c3

Modified Files
--------------
src/backend/utils/activity/pgstat.c       |  3 +++
src/backend/utils/activity/pgstat_shmem.c | 18 ++++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Clear padding of PgStat_HashKey when handling pgstats entries
@ 2024-11-05 00:41  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Paquier @ 2024-11-05 00:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Clear padding of PgStat_HashKey when handling pgstats entries

PgStat_HashKey is currently initialized in a way that could result in
random data if the structure has any padding bytes.  The structure
has no padding bytes currently, fortunately, but it could become a
problem should the structure change at some point in the future.

The code is changed to use some memset(0) so as any padding would be
handled properly, as it would be surprising to see random failures in
the pgstats entry lookups.  PgStat_HashKey is a structure internal to
pgstats, and an ABI change could be possible in the scope of a bug fix,
so backpatch down to 15 where this has been introduced.

Author: Bertrand Drouvot
Reviewed-by: Jelte Fennema-Nio, Michael Paquier
Discussion: https://postgr.es/m/Zyb7RW1y9dVfO0UH@ip-10-97-1-34.eu-west-3.compute.internal
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/925b3aa85700f35f6ca861ea6a25abee606d3c14

Modified Files
--------------
src/backend/utils/activity/pgstat.c       |  3 +++
src/backend/utils/activity/pgstat_shmem.c | 18 ++++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Clear padding of PgStat_HashKey when handling pgstats entries
@ 2024-11-05 00:41  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Paquier @ 2024-11-05 00:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Clear padding of PgStat_HashKey when handling pgstats entries

PgStat_HashKey is currently initialized in a way that could result in
random data if the structure has any padding bytes.  The structure
has no padding bytes currently, fortunately, but it could become a
problem should the structure change at some point in the future.

The code is changed to use some memset(0) so as any padding would be
handled properly, as it would be surprising to see random failures in
the pgstats entry lookups.  PgStat_HashKey is a structure internal to
pgstats, and an ABI change could be possible in the scope of a bug fix,
so backpatch down to 15 where this has been introduced.

Author: Bertrand Drouvot
Reviewed-by: Jelte Fennema-Nio, Michael Paquier
Discussion: https://postgr.es/m/Zyb7RW1y9dVfO0UH@ip-10-97-1-34.eu-west-3.compute.internal
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7d85d87f4d5c35fd5b2d38adaef63dfbfa542ccc

Modified Files
--------------
src/backend/utils/activity/pgstat.c       |  3 +++
src/backend/utils/activity/pgstat_shmem.c | 18 ++++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Clear padding of PgStat_HashKey when handling pgstats entries
@ 2024-11-05 00:41  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Paquier @ 2024-11-05 00:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Clear padding of PgStat_HashKey when handling pgstats entries

PgStat_HashKey is currently initialized in a way that could result in
random data if the structure has any padding bytes.  The structure
has no padding bytes currently, fortunately, but it could become a
problem should the structure change at some point in the future.

The code is changed to use some memset(0) so as any padding would be
handled properly, as it would be surprising to see random failures in
the pgstats entry lookups.  PgStat_HashKey is a structure internal to
pgstats, and an ABI change could be possible in the scope of a bug fix,
so backpatch down to 15 where this has been introduced.

Author: Bertrand Drouvot
Reviewed-by: Jelte Fennema-Nio, Michael Paquier
Discussion: https://postgr.es/m/Zyb7RW1y9dVfO0UH@ip-10-97-1-34.eu-west-3.compute.internal
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6d5e6693ee6bd08ed47713c808dbd281cf9cf9cd

Modified Files
--------------
src/backend/utils/activity/pgstat.c       |  3 +++
src/backend/utils/activity/pgstat_shmem.c | 18 ++++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2024-11-05 00:41 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-11-05 00:41 pgsql: Clear padding of PgStat_HashKey when handling pgstats entries Michael Paquier <michael@paquier.xyz>
2024-11-05 00:41 pgsql: Clear padding of PgStat_HashKey when handling pgstats entries Michael Paquier <michael@paquier.xyz>
2024-11-05 00:41 pgsql: Clear padding of PgStat_HashKey when handling pgstats entries Michael Paquier <michael@paquier.xyz>
2024-11-05 00:41 pgsql: Clear padding of PgStat_HashKey when handling pgstats entries Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox