Skip to content

Guard AOCS vpinfo decoding against malformed data - #2444

Open
reshke wants to merge 1 commit into
apache:mainfrom
reshke:fix-aocs-vpinfo-decode-bounds
Open

reshke wants to merge 1 commit into
apache:mainfrom
reshke:fix-aocs-vpinfo-decode-bounds

Conversation

@reshke

@reshke reshke commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Check the fixed header length and declared entry count against the bytes available before indexing AOCSVPInfo entries.

The pre-fix backend crashed on this input:

SELECT aocsvpinfo_decode(decode('00000000ffffff7f', 'hex'), 2147483646, 0);

Top of the SIGSEGV stack:

postgres StandardHandlerForSigillSigsegvSigbus_OnMainThread + 0x177
libc.so.6 <symbol not found> + 0x2286a330
postgres aocsvpinfo_decode + 0x44
postgres <symbol not found> + 0x73fb1f5
postgres evaluate_expr + 0x88
postgres <symbol not found> + 0x75a0da4

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context


Check the fixed header length and declared entry count against the bytes
available before indexing AOCSVPInfo entries.

The pre-fix backend crashed on this input:

    SELECT aocsvpinfo_decode(decode('00000000ffffff7f', 'hex'), 2147483646, 0);

Top of the SIGSEGV stack:

    postgres StandardHandlerForSigillSigsegvSigbus_OnMainThread + 0x177
    libc.so.6 <symbol not found> + 0x2286a330
    postgres aocsvpinfo_decode + 0x44
    postgres <symbol not found> + 0x73fb1f5
    postgres evaluate_expr + 0x88
    postgres <symbol not found> + 0x75a0da4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant