Bug 47011

Summary: /dev/one character device
Product: Drivers Reporter: Robin Bankhead (kernel)
Component: OtherAssignee: drivers_other
Status: RESOLVED WILL_NOT_FIX    
Severity: enhancement CC: alan
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.5.3 Subsystem:
Regression: No Bisected commit-id:
Attachments: Patch to drivers/char/mem.c to create a /dev/one device

Description Robin Bankhead 2012-09-04 12:54:25 UTC
Created attachment 79221 [details]
Patch to drivers/char/mem.c to create a /dev/one device

Apologies if this has been discussed and vetoed already, couldn't find anything here or on LKML.

I think it would be useful for the kernel to have a /dev/one device (supplying a stream of binary 1) to complement /dev/zero. The primary use-case would be for implementation of certain state- and guru-endorsed disk erasure algorithms, including

- Canadian RCMP TSSIT OPS-II (7 passes)
- German VSITR (7 passes)
- Bruce Schneier (7 passes)

Other uses may present themselves, but this alone seems compelling.

The attached patch is only minimally my work, I adapted it from an old one I found here:
http://www.linuxquestions.org/questions/linux-newbie-8/is-there-a-dev-one-like-dev-zero-619626/

Hope this is of some interest.
Comment 1 Alan 2012-09-04 14:56:22 UTC
This was rejected - you can do it lots of other ways. The zero on the other hand is very useful for mappings when handling memory allocation so has a kernel side use.

Also note that because of bad sector remapping on any vaguely modern rotating disk , and because SSDs work entirely differently no number of passes of writing data are guaranteed to erase a disk. You should be using the disk level secure erase feature and command set via hdparm or similar tools. Your drive vendor should be able to confirm the certifications they meet.