freebsd-dev/sys
Andriy Gapon 6ce374aa94 geom_disk / scsi_da: deny opening write-protected disks for writing
Ths change consists of two parts.

geom_disk: deny opening a disk for writing if it's marked as
write-protected.  A new disk(9) flag is added to mark write protected
disks.  A possible alternative could be to add another parameter to d_open,
so that the open mode could be passed to it and the disk drivers could
make the decision internally, but the flag required less churn.

scsi_da: add a new phase of disk probing to query the all pages mode
sense page.  We can determine if the disk is write protected using bit 7
of the device specific field in the mode parameter header returned by
MODE SENSE.

PR:		224037
Reviewed by:	mav
MFC after:	4 weeks
Differential Revision: https://reviews.freebsd.org/D13360
2018-01-15 11:20:00 +00:00
..
amd64 Add STAC and CLAC instructions wrappers. 2018-01-14 12:39:50 +00:00
arm allwinner: mmc: Multiple improvement 2018-01-14 22:05:29 +00:00
arm64 Add support for NUMA domains to bus dma tags. This causes all memory 2018-01-12 23:34:16 +00:00
bsm sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
cam geom_disk / scsi_da: deny opening write-protected disks for writing 2018-01-15 11:20:00 +00:00
cddl Use the thread's ucred struct when fetching jid or jailname. 2018-01-14 17:55:40 +00:00
compat Regenerate auto-generated files 2018-01-12 23:06:35 +00:00
conf Move VM_NUMA_ALLOC and DEVICE_NUMA under the single global config option NUMA. 2018-01-14 03:36:03 +00:00
contrib zstd: Use mallocarray(9) for calloc macro. 2018-01-13 19:02:51 +00:00
crypto Merge ^/head r327624 through r327885. 2018-01-12 18:23:35 +00:00
ddb Implement 'domainset', a cpuset based NUMA policy mechanism. This allows 2018-01-12 22:48:23 +00:00
dev When re-evaluating cpu_features, also re-print CPU identification. 2018-01-14 12:33:05 +00:00
dts Add a rudimentary PWM driver for the RaspberryPi. 2018-01-14 20:36:21 +00:00
fs Add metadata_csum feature support. 2018-01-14 20:46:39 +00:00
gdb sys/gdb: further adoption of SPDX licensing ID tags. 2017-11-27 15:16:59 +00:00
geom geom_disk / scsi_da: deny opening write-protected disks for writing 2018-01-15 11:20:00 +00:00
gnu Introduce bwn(4) support for the bhnd(4) bus. 2017-12-02 02:21:27 +00:00
i386 Enable VIMAGE in i386 GENERIC (revert r327840) 2018-01-14 16:04:51 +00:00
isa On further testing on actual machines with this hardware, we should 2017-12-30 08:16:31 +00:00
kern Add RTC clock conversions for BCD values, with non-panic validation. 2018-01-14 17:01:37 +00:00
kgssapi sys/kgssapi: general adoption of SPDX licensing ID tags. 2017-11-27 15:49:00 +00:00
libkern SPDX: fix wrong license ID tag in libkern. 2017-12-28 01:20:30 +00:00
mips Add support for NUMA domains to bus dma tags. This causes all memory 2018-01-12 23:34:16 +00:00
modules Add a rudimentary PWM driver for the RaspberryPi. 2018-01-14 20:36:21 +00:00
net Disabled the use of flowid for lagg by default 2018-01-04 20:05:47 +00:00
net80211 net80211: sanitize input for ieee80211_output() 2017-12-30 00:40:34 +00:00
netgraph sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
netinet libalias: small memory allocation cleanups. 2018-01-12 23:12:30 +00:00
netinet6 Fix some typos. 2017-12-28 20:40:56 +00:00
netipsec Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
netpfil Implement 'domainset', a cpuset based NUMA policy mechanism. This allows 2018-01-12 22:48:23 +00:00
netsmb sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
nfs Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
nfsclient sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
nfsserver sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
nlm Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
ofed sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
opencrypto Change the type of 'crp_opaque' from caddr_t to void *. 2018-01-11 18:09:24 +00:00
powerpc Move the pmap-specific code in copyinout.c that gets pointers to userland 2018-01-15 06:46:33 +00:00
riscv Implement NUMA support in uma(9) and malloc(9). Allocations from specific 2018-01-12 23:25:05 +00:00
rpc Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
security Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
sparc64 Implement NUMA support in uma(9) and malloc(9). Allocations from specific 2018-01-12 23:25:05 +00:00
sys Add RTC clock conversions for BCD values, with non-panic validation. 2018-01-14 17:01:37 +00:00
teken sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
tests
tools embed_mfs: correctly test grep return value 2018-01-03 19:22:10 +00:00
ufs Softlink inodes can own buffers with dependencies. 2018-01-11 13:37:45 +00:00
vm Move VM_NUMA_ALLOC and DEVICE_NUMA under the single global config option NUMA. 2018-01-14 03:36:03 +00:00
x86 Enumerate and print Intel CPU features for Speculative Execution Side 2018-01-14 12:36:23 +00:00
xdr sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
xen sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
Makefile Move sys/boot to stand. Fix all references to new location 2017-11-14 23:02:19 +00:00