[cygwin] DD bug fails to wipe last 48 sectors of a disk

Hashim Aziz hashaziz@hotmail.com
Sat Jun 20 17:31:15 GMT 2020


To reproduce simply run the following command on a drive (obviously, this will irreversibly wipe all data):

dd if=/dev/zero of=/dev/sdX bs=4M status=progress

Both drives were attached via internal SATA (by way of a PCIE to SATA Host Bus Adapter).

Cygwin was running in an elevated window as dd cannot run in Cygwin without administrator access, at least not on Windows 10 and not when dealing with raw disks. I was running Avast the first time I discovered this, and am currently running Windows Defender, so doubt that the AV is the cause of this.

The hard drives are a Western Digital WD10PURX-64E5EY0 (Serial: WD-WCC4J6HX189U) and a Kingston SV200S3128G (Serial: 12BA315PKAWK).

I just ran DD for Windows 0.6beta3 with variations of the following command:

dd.exe if=/dev/zero of=\\.\PHYSICALDRIVEX --progress bs=4M

...and can confirm that the bug also manifests here, but in a slightly different way - irrespective of the disk or block size, it fails to wipe the last 176 sectors of the drive.

Hashim

________________________________
From: Jason Pyeron <jpyeron@pdinc.us>
Sent: 19 June 2020 9:25 PM
To: 'Hashim Aziz' <hashaziz@hotmail.com>
Subject: RE: [cygwin] DD bug fails to wipe last 48 sectors of a disk

> -----Original Message-----
> From: Hashim Aziz via Cygwin
> Sent: Friday, June 19, 2020 2:19 PM
>
> I first came across this bug last year, and wrote up my findings in a detailed answer to the
> StackExchange network:
>
> https://superuser.com/questions/1505715/why-does-dd-give-me-an-error-at-the-end-of-zero-writing-a-disk
>
> I didn’t then have the time to report it to this mailing list, but have just tested it using the
> latest version of Cygwin on the same two disks as I did then, and can confirm that the problem still
> persists. It’s also of note that I was running Windows 7 back then and am currently running 10, so
> this is now confirmed to manifest on both of the last two Windows OSes. I’m happy to work with the
> team to get this fixed, as I frequently need to make use of Cygwin dd to zero out drives for both
> security and regulatory compliance reasons, and failing to wipe the last 48 sectors of all drives is a
> pretty significant security risk.

Hmm, never had that issue.

Steps to reproduce please.

Running as Admin?
Antivirus?
How is the drive attached (USB, SATA, other)?
What are the drive models (is there a known firmware issue on windows)?

Does the non-cygwin http://www.chrysocome.net/dd work?

-Jason



More information about the Cygwin mailing list