Writing CD/DVD on devices opened for read-only. Is it bad?

From: Igor Zhbanov
Date: Wed Oct 19 2011 - 06:20:47 EST


Hello!

I have a question about permissions needed for CD/DVD writing.
As I see in source code user must have capability CAP_SYS_RAWIO for
CD/DVD writing
in 2.6 kernels (I'm not sure that it is needed for all types of disk writing),
but (it seems that) kernel ignores device file permissions. So you can
open /dev/cdrom
for read-only and use IOCTLs for blanking disks and CD/DVD writing.

I think that f_mode for device file should be checked. Isn't it bad to
permit "writable" IOCTLs
for devices opened read-only?

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/