Re: [PATCH] pageinspect: validate line pointers before using them

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Yilin Zhang <jiezhilove(at)126(dot)com>
Cc: Greg Burd <gregburd(at)protonmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] pageinspect: validate line pointers before using them
Date: 2026-10-22 03:49:45
Message-ID: CAGRkXqTV5wo=1O-2VKy5jR8bfXujvVJg_ix3=p6kWhvt12he4g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Yilin,

Thanks, I can reproduce it on v3. The BRIN tuple says its data starts
at byte 31, but the tuple is only 5 bytes long.

v4 checks that the data offset, the null bitmap and each stored value
fit inside the tuple before decoding it. It does not check what the
values contain. gist_page_items() had the same problem, so it gets the
same check. 0001 also fixes an overread of a btree posting list. All
come with tests, and I added you as Reported-by.

Thanks,
Shihao

Attachment Content-Type Size
v4-0002-pageinspect-validate-page-headers-and-BRIN-GIN-an.patch application/octet-stream 21.5 KB
v4-0001-pageinspect-validate-line-pointers-before-using-t.patch application/octet-stream 14.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message shihao zhong 2026-10-22 03:46:05 Re: [PATCH] pg_upgrade: add --initdb option to create the new cluster automatically