public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: DD bug fails to wipe last 48 sectors of a disk
@ 2020-09-14 15:44 Hamish McIntyre-Bhatty
  2020-09-14 15:55 ` Erik Soderquist
  0 siblings, 1 reply; 9+ messages in thread
From: Hamish McIntyre-Bhatty @ 2020-09-14 15:44 UTC (permalink / raw)
  To: Cygwin General Mailing List


[-- Attachment #1.1.1: Type: text/plain, Size: 169 bytes --]

Was this ever resolved? I could have sworn I saw some discussion about
this but I can't find it in the archives.

It might also affect ddrescue, I feel.

Hamish


[-- Attachment #1.1.2: 0x87B761FE07F548D6.asc --]
[-- Type: application/pgp-keys, Size: 3235 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: DD bug fails to wipe last 48 sectors of a disk
  2020-09-14 15:44 DD bug fails to wipe last 48 sectors of a disk Hamish McIntyre-Bhatty
@ 2020-09-14 15:55 ` Erik Soderquist
  2020-09-14 16:32   ` [cygwin] " Jason Pyeron
  0 siblings, 1 reply; 9+ messages in thread
From: Erik Soderquist @ 2020-09-14 15:55 UTC (permalink / raw)
  To: Cygwin General Mailing List

On Mon, Sep 14, 2020 at 11:45 AM Hamish McIntyre-Bhatty via Cygwin wrote:
>
> Was this ever resolved? I could have sworn I saw some discussion about
> this but I can't find it in the archives.

I still have the thread in my local email; a couple viable work
arounds were provided, but the issue's root cause is on the Windows
side, so I believe the only real route to a true fix would be via
Microsoft altering their code.

> It might also affect ddrescue, I feel.

I believe you are accurate in this feeling.

-- Erik

(op bcc'ed)

--
"I do not think any of us are truly sane, Caleb. Not even you. Courage
is not sanity. Being willing to die for someone else is not sanity."
... "Love is not sane, nor is faith." ... "If sanity lacks those
things, Caleb, I want no part of it."

-- Alexandria Terri in "Weaving the Wyvern" by Alexis Desiree Thorne

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [cygwin] Re: DD bug fails to wipe last 48 sectors of a disk
  2020-09-14 15:55 ` Erik Soderquist
@ 2020-09-14 16:32   ` Jason Pyeron
  2020-09-14 16:34     ` Hamish McIntyre-Bhatty
  0 siblings, 1 reply; 9+ messages in thread
From: Jason Pyeron @ 2020-09-14 16:32 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: Erik Soderquist
> Sent: Monday, September 14, 2020 11:55 AM
> Subject: [cygwin] Re: DD bug fails to wipe last 48 sectors of a disk
> 
> On Mon, Sep 14, 2020 at 11:45 AM Hamish McIntyre-Bhatty via Cygwin wrote:
> >
> > Was this ever resolved? I could have sworn I saw some discussion about
> > this but I can't find it in the archives.
> 
> I still have the thread in my local email; a couple viable work
> arounds were provided, but the issue's root cause is on the Windows
> side, so I believe the only real route to a true fix would be via
> Microsoft altering their code.

When accessing with proper (aligned) block size and count I do not encounter the problem - happy to test again.

> 
> > It might also affect ddrescue, I feel.
> 
> I believe you are accurate in this feeling.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cygwin] Re: DD bug fails to wipe last 48 sectors of a disk
  2020-09-14 16:32   ` [cygwin] " Jason Pyeron
@ 2020-09-14 16:34     ` Hamish McIntyre-Bhatty
  2020-09-14 17:09       ` Jason Pyeron
  0 siblings, 1 reply; 9+ messages in thread
From: Hamish McIntyre-Bhatty @ 2020-09-14 16:34 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1.1: Type: text/plain, Size: 1303 bytes --]

Could you perhaps try with ddrescue for me please (also has a block size
option)? I could try and reproduce myself but without the email thread
that will be a challenge.

Hamish

On 14/09/2020 17:32, Jason Pyeron wrote:
>> -----Original Message-----
>> From: Erik Soderquist
>> Sent: Monday, September 14, 2020 11:55 AM
>> Subject: [cygwin] Re: DD bug fails to wipe last 48 sectors of a disk
>>
>> On Mon, Sep 14, 2020 at 11:45 AM Hamish McIntyre-Bhatty via Cygwin wrote:
>>> Was this ever resolved? I could have sworn I saw some discussion about
>>> this but I can't find it in the archives.
>> I still have the thread in my local email; a couple viable work
>> arounds were provided, but the issue's root cause is on the Windows
>> side, so I believe the only real route to a true fix would be via
>> Microsoft altering their code.
> When accessing with proper (aligned) block size and count I do not encounter the problem - happy to test again.
>
>>> It might also affect ddrescue, I feel.
>> I believe you are accurate in this feeling.
>
>
> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

[-- Attachment #1.1.2: 0x87B761FE07F548D6.asc --]
[-- Type: application/pgp-keys, Size: 3235 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [cygwin] Re: DD bug fails to wipe last 48 sectors of a disk
  2020-09-14 16:34     ` Hamish McIntyre-Bhatty
@ 2020-09-14 17:09       ` Jason Pyeron
  2020-09-14 17:58         ` Thomas Wolff
  2020-09-16  8:19         ` Hamish McIntyre-Bhatty
  0 siblings, 2 replies; 9+ messages in thread
From: Jason Pyeron @ 2020-09-14 17:09 UTC (permalink / raw)
  To: cygwin

> From: Hamish McIntyre-Bhatty
> Sent: Monday, September 14, 2020 12:34 PM
> 
> On 14/09/2020 17:32, Jason Pyeron wrote:
> >> -----Original Message-----
> >> From: Erik Soderquist
> >> Sent: Monday, September 14, 2020 11:55 AM
> >>
> >> On Mon, Sep 14, 2020 at 11:45 AM Hamish McIntyre-Bhatty via Cygwin wrote:
> >>> Was this ever resolved? I could have sworn I saw some discussion about
> >>> this but I can't find it in the archives.
> >> I still have the thread in my local email; a couple viable work
> >> arounds were provided, but the issue's root cause is on the Windows
> >> side, so I believe the only real route to a true fix would be via
> >> Microsoft altering their code.
> > When accessing with proper (aligned) block size and count I do not encounter the problem - happy to
> test again.
> >
> >>> It might also affect ddrescue, I feel.
> >> I believe you are accurate in this feeling.

(next time, please attempt to bottom post on this mailing list, moved it where it belongs)

> Could you perhaps try with ddrescue for me please (also has a block size
> option)? I could try and reproduce myself but without the email thread
> that will be a challenge.

Yes, I observed the same result with ddrescue before (bad input = bad behavior, good input = good behavior). The issue, as I have observed it, is if Windows is asked to write a string of blocks, past the end of the drive it will silently fail and not write some of those block BEFORE the end of the drive.

If block size (bs) is a multiple of 4096 (or 512 for most drives) and the count * bs = drive size exactly (as reported by windows) no error.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cygwin] Re: DD bug fails to wipe last 48 sectors of a disk
  2020-09-14 17:09       ` Jason Pyeron
@ 2020-09-14 17:58         ` Thomas Wolff
  2020-09-16  8:19         ` Hamish McIntyre-Bhatty
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Wolff @ 2020-09-14 17:58 UTC (permalink / raw)
  To: cygwin

Am 14.09.2020 um 19:09 schrieb Jason Pyeron:
>> From: Hamish McIntyre-Bhatty
>> Sent: Monday, September 14, 2020 12:34 PM
>>
>> On 14/09/2020 17:32, Jason Pyeron wrote:
>>>> -----Original Message-----
>>>> From: Erik Soderquist
>>>> Sent: Monday, September 14, 2020 11:55 AM
>>>>
>>>> On Mon, Sep 14, 2020 at 11:45 AM Hamish McIntyre-Bhatty via Cygwin wrote:
>>>>> Was this ever resolved? I could have sworn I saw some discussion about
>>>>> this but I can't find it in the archives.
>>>> I still have the thread in my local email; a couple viable work
>>>> arounds were provided, but the issue's root cause is on the Windows
>>>> side, so I believe the only real route to a true fix would be via
>>>> Microsoft altering their code.
>>> When accessing with proper (aligned) block size and count I do not encounter the problem - happy to
>> test again.
>>>>> It might also affect ddrescue, I feel.
>>>> I believe you are accurate in this feeling.
> (next time, please attempt to bottom post on this mailing list, moved it where it belongs)
>
>> Could you perhaps try with ddrescue for me please (also has a block size
>> option)? I could try and reproduce myself but without the email thread
>> that will be a challenge.
> Yes, I observed the same result with ddrescue before (bad input = bad behavior, good input = good behavior). The issue, as I have observed it, is if Windows is asked to write a string of blocks, past the end of the drive it will silently fail and not write some of those block BEFORE the end of the drive.
>
> If block size (bs) is a multiple of 4096 (or 512 for most drives) and the count * bs = drive size exactly (as reported by windows) no error.
Where in the code is that handled? Wouldn't it be easy to limit the 
count according to the disk size as a workaround?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cygwin] Re: DD bug fails to wipe last 48 sectors of a disk
  2020-09-14 17:09       ` Jason Pyeron
  2020-09-14 17:58         ` Thomas Wolff
@ 2020-09-16  8:19         ` Hamish McIntyre-Bhatty
  1 sibling, 0 replies; 9+ messages in thread
From: Hamish McIntyre-Bhatty @ 2020-09-16  8:19 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1.1: Type: text/plain, Size: 2050 bytes --]

Ah good, thanks for clarifying this for me. I don't think my program
will be affected by this bug.

Hamish

On 14/09/2020 18:09, Jason Pyeron wrote:
>> From: Hamish McIntyre-Bhatty
>> Sent: Monday, September 14, 2020 12:34 PM
>>
>> On 14/09/2020 17:32, Jason Pyeron wrote:
>>>> -----Original Message-----
>>>> From: Erik Soderquist
>>>> Sent: Monday, September 14, 2020 11:55 AM
>>>>
>>>> On Mon, Sep 14, 2020 at 11:45 AM Hamish McIntyre-Bhatty via Cygwin wrote:
>>>>> Was this ever resolved? I could have sworn I saw some discussion about
>>>>> this but I can't find it in the archives.
>>>> I still have the thread in my local email; a couple viable work
>>>> arounds were provided, but the issue's root cause is on the Windows
>>>> side, so I believe the only real route to a true fix would be via
>>>> Microsoft altering their code.
>>> When accessing with proper (aligned) block size and count I do not encounter the problem - happy to
>> test again.
>>>>> It might also affect ddrescue, I feel.
>>>> I believe you are accurate in this feeling.
> (next time, please attempt to bottom post on this mailing list, moved it where it belongs)
>
>> Could you perhaps try with ddrescue for me please (also has a block size
>> option)? I could try and reproduce myself but without the email thread
>> that will be a challenge.
> Yes, I observed the same result with ddrescue before (bad input = bad behavior, good input = good behavior). The issue, as I have observed it, is if Windows is asked to write a string of blocks, past the end of the drive it will silently fail and not write some of those block BEFORE the end of the drive.
>
> If block size (bs) is a multiple of 4096 (or 512 for most drives) and the count * bs = drive size exactly (as reported by windows) no error.
>
>
> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

[-- Attachment #1.1.2: 0x87B761FE07F548D6.asc --]
[-- Type: application/pgp-keys, Size: 3235 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: DD bug fails to wipe last 48 sectors of a disk
  2020-06-19 18:19 Hashim Aziz
@ 2020-08-04 22:42 ` Hashim Aziz
  0 siblings, 0 replies; 9+ messages in thread
From: Hashim Aziz @ 2020-08-04 22:42 UTC (permalink / raw)
  To: cygwin


________________________________
From: Hashim Aziz <hashaziz@hotmail.com>
Sent: 19 June 2020 7:19 PM
To: cygwin <cygwin@cygwin.com>
Subject: DD bug fails to wipe last 48 sectors of a disk


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.



Thanks,

Hashim



---


Apologies for the late reply, I've just finished going through the responses. While the code solutions given are useful and very interesting, they seem to be largely hacks and workarounds. As someone who wipes many drives for security purposes, from a security point of view it's a huge problem for dd to be silently and consistently failing to wipe the last sector of a drive, and 64KB is still plenty of space to contain sensitive documents. Is it planned for this to be fixed at some point?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* DD bug fails to wipe last 48 sectors of a disk
@ 2020-06-19 18:19 Hashim Aziz
  2020-08-04 22:42 ` Hashim Aziz
  0 siblings, 1 reply; 9+ messages in thread
From: Hashim Aziz @ 2020-06-19 18:19 UTC (permalink / raw)
  To: cygwin

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.

Thanks,
Hashim



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-09-16  8:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14 15:44 DD bug fails to wipe last 48 sectors of a disk Hamish McIntyre-Bhatty
2020-09-14 15:55 ` Erik Soderquist
2020-09-14 16:32   ` [cygwin] " Jason Pyeron
2020-09-14 16:34     ` Hamish McIntyre-Bhatty
2020-09-14 17:09       ` Jason Pyeron
2020-09-14 17:58         ` Thomas Wolff
2020-09-16  8:19         ` Hamish McIntyre-Bhatty
  -- strict thread matches above, loose matches on Subject: below --
2020-06-19 18:19 Hashim Aziz
2020-08-04 22:42 ` Hashim Aziz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).