Re: UBSan pointer overflow in xlogreader.c

2023-12-08 Thread Robert Haas
On Thu, Dec 7, 2023 at 10:18 PM Thomas Munro wrote: > On Fri, Dec 8, 2023 at 3:57 AM Robert Haas wrote: > > On Tue, Dec 5, 2023 at 4:01 PM Nathan Bossart > > wrote: > > > +1 > > > > So, Thomas ... any chance you could commit this? So that my patch > > stops making cfbot sad? > > Done. Thanks

Re: UBSan pointer overflow in xlogreader.c

2023-12-07 Thread Thomas Munro
On Fri, Dec 8, 2023 at 3:57 AM Robert Haas wrote: > On Tue, Dec 5, 2023 at 4:01 PM Nathan Bossart > wrote: > > +1 > > So, Thomas ... any chance you could commit this? So that my patch > stops making cfbot sad? Done. Thanks both for the reviews.

Re: UBSan pointer overflow in xlogreader.c

2023-12-07 Thread Robert Haas
On Tue, Dec 5, 2023 at 4:01 PM Nathan Bossart wrote: > +1 So, Thomas ... any chance you could commit this? So that my patch stops making cfbot sad? -- Robert Haas EDB: http://www.enterprisedb.com

Re: UBSan pointer overflow in xlogreader.c

2023-12-05 Thread Nathan Bossart
On Tue, Dec 05, 2023 at 03:48:33PM -0500, Robert Haas wrote: > The patch LGTM, too. Thanks for investigating and writing the code. > The part about how the reserved kernel memory prevents the bug from > appearing on 32-bit systems but not 64-bit systems running in 32-bit > mode is pretty

Re: UBSan pointer overflow in xlogreader.c

2023-12-05 Thread Robert Haas
On Tue, Dec 5, 2023 at 1:04 PM Nathan Bossart wrote: > On Wed, Dec 06, 2023 at 12:03:53AM +1300, Thomas Munro wrote: > > xlogreader.c has a pointer overflow bug, as revealed by the > > combination of -fsanitize=undefined -m32, the new 039_end_of_wal.pl > > test and Robert's incremental backup

Re: UBSan pointer overflow in xlogreader.c

2023-12-05 Thread Nathan Bossart
On Wed, Dec 06, 2023 at 12:03:53AM +1300, Thomas Munro wrote: > xlogreader.c has a pointer overflow bug, as revealed by the > combination of -fsanitize=undefined -m32, the new 039_end_of_wal.pl > test and Robert's incremental backup patch[1]. The bad code tests > whether an object could fit using

UBSan pointer overflow in xlogreader.c

2023-12-05 Thread Thomas Munro
Hi, xlogreader.c has a pointer overflow bug, as revealed by the combination of -fsanitize=undefined -m32, the new 039_end_of_wal.pl test and Robert's incremental backup patch[1]. The bad code tests whether an object could fit using something like base + size <= end, which can be converted to