forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd7f8d26
committed
Add security checks to the multivariate MCV estimation code.
The multivariate MCV estimation code may run user-defined operators onthe values in the MCV list, which means that those operators maypotentially leak the values from the MCV list. Guard against leakingdata to unprivileged users by checking that the user has SELECTprivileges on the table or all of the columns referred to by thestatistics.Additionally, if there are any securityQuals on the RTE (either due toRLS policies on the table, or accessing the table via a securitybarrier view), not all rows may be visible to the current user, evenif they have table or column privileges. Thus we further insist thatthe operator be leakproof in this case.Dean Rasheed, reviewed by Tomas Vondra.Discussion:https://postgr.es/m/CAEZATCUhT9rt7Ui=Vdx4N==VV5XOK5dsXfnGgVOz_JhAicB=ZA@mail.gmail.com1 parent89ff7c0 commitd7f8d26
File tree
3 files changed
+186
-8
lines changed- src
- backend/statistics
- test/regress
- expected
- sql
3 files changed
+186
-8
lines changedLines changed: 66 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
27 | 28 |
| |
28 | 29 |
| |
29 | 30 |
| |
| |||
760 | 761 |
| |
761 | 762 |
| |
762 | 763 |
| |
763 |
| - | |
| 764 | + | |
| 765 | + | |
764 | 766 |
| |
765 | 767 |
| |
766 | 768 |
| |
| |||
791 | 793 |
| |
792 | 794 |
| |
793 | 795 |
| |
| 796 | + | |
794 | 797 |
| |
795 | 798 |
| |
796 | 799 |
| |
| |||
833 | 836 |
| |
834 | 837 |
| |
835 | 838 |
| |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
836 | 853 |
| |
837 | 854 |
| |
838 |
| - | |
| 855 | + | |
| 856 | + | |
839 | 857 |
| |
840 | 858 |
| |
841 | 859 |
| |
| |||
866 | 884 |
| |
867 | 885 |
| |
868 | 886 |
| |
869 |
| - | |
| 887 | + | |
| 888 | + | |
870 | 889 |
| |
871 | 890 |
| |
872 | 891 |
| |
| |||
886 | 905 |
| |
887 | 906 |
| |
888 | 907 |
| |
889 |
| - | |
| 908 | + | |
| 909 | + | |
890 | 910 |
| |
891 | 911 |
| |
892 | 912 |
| |
| |||
909 | 929 |
| |
910 | 930 |
| |
911 | 931 |
| |
912 |
| - | |
| 932 | + | |
| 933 | + | |
913 | 934 |
| |
| 935 | + | |
914 | 936 |
| |
| 937 | + | |
915 | 938 |
| |
916 | 939 |
| |
917 | 940 |
| |
| |||
924 | 947 |
| |
925 | 948 |
| |
926 | 949 |
| |
927 |
| - | |
928 |
| - | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
929 | 987 |
| |
930 | 988 |
| |
931 | 989 |
| |
| |||
1027 | 1085 |
| |
1028 | 1086 |
| |
1029 | 1087 |
| |
1030 |
| - | |
| 1088 | + | |
1031 | 1089 |
| |
1032 | 1090 |
| |
1033 | 1091 |
| |
|
Lines changed: 60 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
696 | 696 |
| |
697 | 697 |
| |
698 | 698 |
| |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + |
Lines changed: 60 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
446 | 446 |
| |
447 | 447 |
| |
448 | 448 |
| |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + |
0 commit comments
Comments
(0)