diff options
author | smh <smh@FreeBSD.org> | 2013-05-24 11:27:06 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2013-05-24 11:27:06 +0000 |
commit | 21ad41e520fe46e7a1e543179051cdcd9b6d2943 (patch) | |
tree | 2b08b0b7e8b9574e8ca5a46c14799aa6c8d1bcb9 /sys/cam/scsi | |
parent | 6023beb9dec8d71f3007154d4092db0eca926383 (diff) | |
download | FreeBSD-src-21ad41e520fe46e7a1e543179051cdcd9b6d2943.zip FreeBSD-src-21ad41e520fe46e7a1e543179051cdcd9b6d2943.tar.gz |
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
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index de11028..661c059 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -1780,7 +1780,8 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) if (error != 0 || req->newptr == NULL) return (error); 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; dadeletemethodset(softc, i); return (0); |