lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 05 Oct 2011 18:30:22 -0600
From:	Chris Friesen <chris.friesen@...band.com>
To:	Mark Mielke <mark@...k.mielke.cc>
CC:	linux-kernel@...r.kernel.org
Subject: Re: Appropriate use of sync() from user space?

On 10/05/2011 05:57 PM, Mark Mielke wrote:

> The vendor stated that sync() is integral to their synchronization
> process to ensure all files reach disk before they are accessed, and
> that this is not a defect in their product. We have a work around - run
> "sync" before calling their command, and this generally avoids the
> failures.
>
> I think the use of sync() in this regard is a hack. According to POSIX.1
> and the Linux man pages, it seems clear to me that sync() does not
> guarantee data integrity (bytes guaranteed to have reached disk) - and
> it also seems clear that forcing all system data to flush out in
> response to a minor command is over kill. Like cutting down the forest
> to harvest fruit from a single tree.
>
> I'm wondering what you think.

Totally agree.

The susv3 man page for sync() is pretty clear:  "The writing, although 
scheduled, is not necessarily complete upon return from sync()."

They should probably be using msync()/fsync()/fdatasync() which only 
affect the specified files and are supposed to wait for the data to hit 
the storage device.  Of course this would require them to do something 
for each file they touch rather than once at the end of the whole operation.

Chris

-- 
Chris Friesen
Software Developer
GENBAND
chris.friesen@...band.com
www.genband.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ