Commit 4766dce
committed
Fix choice of comparison operators for cross-type hashed subplans.
Commit bf6c614 rearranged the lookup of the comparison operators
needed in a hashed subplan, and in so doing, broke the cross-type
case: it caused the original LHS-vs-RHS operator to be used to compare
hash table entries too (which of course are all of the RHS type).
This leads to C functions being passed a Datum that is not of the
type they expect, with the usual hazards of crashes and unauthorized
server memory disclosure.
For the set of hashable cross-type operators present in v11 core
Postgres, this bug is nearly harmless on 64-bit machines, which
may explain why it escaped earlier detection. But it is a live
security hazard on 32-bit machines; and of course there may be
extensions that add more hashable cross-type operators, which
would increase the risk.
Reported by Andreas Seltenreich. Back-patch to v11 where the
problem came in.
Security: CVE-2019-102091 parent ffa2d37 commit 4766dce
File tree
3 files changed
+44
-5
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+44
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
| 863 | + | |
863 | 864 | | |
864 | 865 | | |
865 | 866 | | |
| |||
923 | 924 | | |
924 | 925 | | |
925 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
926 | 930 | | |
927 | 931 | | |
928 | 932 | | |
| |||
952 | 956 | | |
953 | 957 | | |
954 | 958 | | |
955 | | - | |
| 959 | + | |
956 | 960 | | |
957 | 961 | | |
958 | 962 | | |
| |||
961 | 965 | | |
962 | 966 | | |
963 | 967 | | |
964 | | - | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
965 | 971 | | |
966 | 972 | | |
967 | 973 | | |
| |||
1003 | 1009 | | |
1004 | 1010 | | |
1005 | 1011 | | |
1006 | | - | |
| 1012 | + | |
1007 | 1013 | | |
1008 | 1014 | | |
1009 | 1015 | | |
1010 | 1016 | | |
1011 | 1017 | | |
1012 | | - | |
| 1018 | + | |
1013 | 1019 | | |
1014 | 1020 | | |
1015 | | - | |
1016 | 1021 | | |
1017 | 1022 | | |
1018 | 1023 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
767 | 791 | | |
768 | 792 | | |
769 | 793 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
455 | 465 | | |
456 | 466 | | |
457 | 467 | | |
| |||
0 commit comments