Enforce validation on the selected delete method via sysctl.
This prevents users from selecting a delete method which may cause corruption e.g. MPS WS16 on pre P14 firmware. Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 2 days
This commit is contained in:
parent
537cc627d7
commit
190b967447
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=250967
@ -1780,7 +1780,8 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS)
|
|||||||
if (error != 0 || req->newptr == NULL)
|
if (error != 0 || req->newptr == NULL)
|
||||||
return (error);
|
return (error);
|
||||||
for (i = 0; i <= DA_DELETE_MAX; i++) {
|
for (i = 0; i <= DA_DELETE_MAX; i++) {
|
||||||
if (strcmp(buf, da_delete_method_names[i]) != 0)
|
if (!(softc->delete_available & (1 << i)) ||
|
||||||
|
strcmp(buf, da_delete_method_names[i]) != 0)
|
||||||
continue;
|
continue;
|
||||||
dadeletemethodset(softc, i);
|
dadeletemethodset(softc, i);
|
||||||
return (0);
|
return (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user