Repository navigation
Commit 4a8c31a
xen/blkback: rework connect_ring() to avoid inconsistent xenstore 'ring-page-order' set by malicious blkfront
The xenstore 'ring-page-order' is used globally for each blkback queue and
therefore should be read from xenstore only once. However, it is obtained
in read_per_ring_refs() which might be called multiple times during the
initialization of each blkback queue.
If the blkfront is malicious and the 'ring-page-order' is set in different
value by blkfront every time before blkback reads it, this may end up at
the "WARN_ON(i != (XEN_BLKIF_REQS_PER_PAGE * blkif->nr_ring_pages));" in
xen_blkif_disconnect() when frontend is destroyed.
This patch reworks connect_ring() to read xenstore 'ring-page-order' only
once.
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>1 parent 5b8e432 commit 4a8c31a
1 file changed
Lines changed: 43 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
926 | 926 | | |
927 | 927 | | |
928 | 928 | | |
929 | | - | |
| 929 | + | |
930 | 930 | | |
931 | 931 | | |
932 | 932 | | |
| |||
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
939 | | - | |
940 | | - | |
941 | | - | |
942 | | - | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
943 | 953 | | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
944 | 957 | | |
945 | | - | |
| 958 | + | |
| 959 | + | |
946 | 960 | | |
947 | 961 | | |
948 | | - | |
949 | | - | |
950 | | - | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
951 | 966 | | |
952 | | - | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
953 | 970 | | |
954 | | - | |
955 | | - | |
956 | | - | |
| 971 | + | |
957 | 972 | | |
958 | 973 | | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | 974 | | |
975 | | - | |
976 | 975 | | |
977 | 976 | | |
978 | 977 | | |
| |||
1031 | 1030 | | |
1032 | 1031 | | |
1033 | 1032 | | |
| 1033 | + | |
1034 | 1034 | | |
1035 | 1035 | | |
1036 | 1036 | | |
| |||
1076 | 1076 | | |
1077 | 1077 | | |
1078 | 1078 | | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1079 | 1093 | | |
1080 | 1094 | | |
1081 | 1095 | | |
| |||
0 commit comments