Bug 1752332: Remove the blocklisting check in ::OnPreferenceChange r=KrisWright

Now that we send everything (except sometimes the user value
is sanitized) we should no longer perform this check.

This is also good because it eliminates security code you
have to have (and thus accidently omitting it is a
vulnerability) and changes it to security code that happens
automatically, and is enforced by the compiler (via mandatory
ctor argument.)

Depends on D141414

Differential Revision: https://phabricator.services.mozilla.com/D141415
This commit is contained in:
Tom Ritter 2022-04-27 12:57:36 +00:00
Родитель 8fd70bf701
Коммит 981a623dfe
5 изменённых файлов: 0 добавлений и 23 удалений

Просмотреть файл

@ -3639,12 +3639,6 @@ ContentParent::Observe(nsISupports* aSubject, const char* aTopic,
// We know prefs are ASCII here. // We know prefs are ASCII here.
NS_LossyConvertUTF16toASCII strData(aData); NS_LossyConvertUTF16toASCII strData(aData);
// A pref changed. If it is useful to do so, inform child processes.
if (ShouldSanitizePreference(strData.Data(),
/* will be fixed later */ false)) {
return NS_OK;
}
Pref pref(strData, /* isLocked */ false, Pref pref(strData, /* isLocked */ false,
/* isSanitized */ false, Nothing(), Nothing()); /* isSanitized */ false, Nothing(), Nothing());

Просмотреть файл

@ -96,10 +96,6 @@ void RDDProcessManager::OnPreferenceChange(const char16_t* aData) {
// We know prefs are ASCII here. // We know prefs are ASCII here.
NS_LossyConvertUTF16toASCII strData(aData); NS_LossyConvertUTF16toASCII strData(aData);
// A pref changed. If it is useful to do so, inform child processes.
if (ShouldSanitizePreference(strData.Data(), false)) {
return;
}
mozilla::dom::Pref pref(strData, /* isLocked */ false, mozilla::dom::Pref pref(strData, /* isLocked */ false,
/* isSanitized */ false, Nothing(), Nothing()); /* isSanitized */ false, Nothing(), Nothing());

Просмотреть файл

@ -163,10 +163,6 @@ void GPUProcessManager::OnPreferenceChange(const char16_t* aData) {
// We know prefs are ASCII here. // We know prefs are ASCII here.
NS_LossyConvertUTF16toASCII strData(aData); NS_LossyConvertUTF16toASCII strData(aData);
// A pref changed. If it is useful to do so, inform child processes.
if (ShouldSanitizePreference(strData.Data(), false)) {
return;
}
mozilla::dom::Pref pref(strData, /* isLocked */ false, mozilla::dom::Pref pref(strData, /* isLocked */ false,
/* isSanitized */ false, Nothing(), Nothing()); /* isSanitized */ false, Nothing(), Nothing());

Просмотреть файл

@ -216,10 +216,6 @@ void VRProcessManager::OnPreferenceChange(const char16_t* aData) {
// We know prefs are ASCII here. // We know prefs are ASCII here.
NS_LossyConvertUTF16toASCII strData(aData); NS_LossyConvertUTF16toASCII strData(aData);
// A pref changed. If it is useful to do so, inform child processes.
if (ShouldSanitizePreference(strData.Data(), false)) {
return;
}
mozilla::dom::Pref pref(strData, /* isLocked */ false, mozilla::dom::Pref pref(strData, /* isLocked */ false,
/* isSanitized */ false, Nothing(), Nothing()); /* isSanitized */ false, Nothing(), Nothing());

Просмотреть файл

@ -94,11 +94,6 @@ void UtilityProcessManager::OnPreferenceChange(const char16_t* aData) {
// We know prefs are ASCII here. // We know prefs are ASCII here.
NS_LossyConvertUTF16toASCII strData(aData); NS_LossyConvertUTF16toASCII strData(aData);
// A pref changed. If it is useful to do so, inform child processes.
if (ShouldSanitizePreference(strData.Data(), false)) {
return;
}
mozilla::dom::Pref pref(strData, /* isLocked */ false, mozilla::dom::Pref pref(strData, /* isLocked */ false,
/* isSanitized */ false, Nothing(), Nothing()); /* isSanitized */ false, Nothing(), Nothing());
Preferences::GetPreference(&pref, GeckoProcessType_Utility, Preferences::GetPreference(&pref, GeckoProcessType_Utility,