Date: 14 May 1998
Click here for printable version
Click here for PGP verifiable version
-----BEGIN PGP SIGNED MESSAGE-----
===========================================================================
AUSCERT External Security Bulletin Redistribution
ESB-98.071 -- NetBSD Security Advisory NetBSD-SA1998-003
mmap(2) of append-only files may result in corrupted data
14 May 1998
===========================================================================
The NetBSD Foundation, Inc. has released the following advisory concerning
possible corruption of append-only files in memory due to a bug in the
mmap(2) system call. The on-disk copy of the files are not affected.
The following security bulletin is provided as a service to AusCERT's
members. As AusCERT did not write this document, AusCERT has had no
control over its content. As such, the decision to use any or all of this
information is the responsibility of each user or organisation, and should
be done so in accordance with site policies and procedures.
NOTE: This is only the original release of the security bulletin. It will
not be updated when the original bulletin is. If downloading at a later
date, it is recommended that the bulletin is retrieved from the original
authors to ensure that the information is still current.
Contact information for NetBSD is included in the Security Bulletin below.
If you have any questions or need further information, please contact them
directly.
Previous advisories and external security bulletins can be retrieved from:
http://www.auscert.org.au/Information/advisories.html
If you believe that your system has been compromised, contact AusCERT or
your representative in FIRST (Forum of Incident Response and Security
Teams).
Internet Email: auscert@auscert.org.au
Facsimile: (07) 3365 7031
Telephone: (07) 3365 4417 (International: +61 7 3365 4417)
AusCERT personnel answer during Queensland business hours
which are GMT+10:00 (AEST).
On call after hours for emergencies.
- --------------------------BEGIN INCLUDED TEXT--------------------
- -----BEGIN PGP SIGNED MESSAGE-----
NetBSD Security Advisory 1998-003
---------------------------------
Topic: mmap(2) of append-only files may result in corrupted data.
Version: NetBSD 1.3.1 and prior.
Severity: Possible data corruption.
Abstract
- - --------
Files that have the append-only flag set are erroneously allowed to
be memory mapped shared, causing other processes to see changes made
to the file. While the on-disk copy is not updated, any other process
using memory mapping will see this change, causing data corruption.
Technical Details
- - -----------------
4.4BSD added several new concepts to the system security, including a
system `securelevel', and the ability to mark FFS files as append-only
or immutable. These flags are settable at any time, but can only be
removed when the securelevel is zero, or less. The securelevel of a
running system can only be lowered by the /sbin/init process, which
typically only does this when entering single user mode. This ensures
that the even the super-user can not tamper with the file flags.
Due to a bug in the mmap(2) system call, files that are marked
append-only, may be opened with append, read and write flags, as normal
for append-only files, and then mmap(2)'ed shared with write protection.
When the data mapped is changed, other processes that use mmap(2) on
this file will also see the changes, defeating the purpose of the
append-only flag. The actual on-disk copy of the file is not updated.
Solutions and Workarounds
- - -------------------------
NetBSD has changed the mmap(2) system call to fail when creating a shared,
writable file mapping if the file is marked immutable or append-only.
A patch has been made available for NetBSD 1.3 and 1.3.1, and can be
found on the NetBSD FTP server:
ftp://ftp.NetBSD.ORG/pub/NetBSD/misc/security/patches/19980509-mmap
Thanks To
- - ---------
Thanks to Darren Reed <darrenr@pobox.com.au>, Luke Mewburn
<lukem@netbsd.org>, Charles Hannum <mycroft@mit.edu>, Chris Demetriou
<cgd@netbsd.org> and Matthew Green <mrg@eterna.com.au> for finding
this problem and/or providing input towards fixing the problem.
More Information
- - ----------------
Information about NetBSD and NetBSD security can be found at
http://www.NetBSD.ORG/ and http://www.NetBSD.ORG/Security/.
Copyright 1998, The NetBSD Foundation. All Rights Reserved.
- -----BEGIN PGP SIGNATURE-----
Version: 2.6.1
iQCVAwUBNVWbGD5Ru2/4N2IFAQEVfwP+K2y+wGyf4VEuAfwkqApSA473pT4OnVVD
phsQXz68xlH9plYnlhockMuOYGb2BA70CPSlewQwZ4dUR1VVXaXld+f0j5HT2cTP
UNuix68ebsCgrJzlgWM6wM0YABpcwJJWevvC4d5XByFugE6gQbOop03WlJbOe0iC
ufqesO+uFCU=
=QSVA
- -----END PGP SIGNATURE-----
- --------------------------END INCLUDED TEXT--------------------
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
Comment: ftp://ftp.auscert.org.au/pub/auscert/AUSCERT_PGP.key
iQCVAwUBNWWV2Sh9+71yA2DNAQFgLgQAjb+8P637J/uVPmKeV2UtstkXp02DB02U
d7JwUFQLCSZTXKN+RTdW5lbdKU46CqwosHvb685o2yY39WOn7iMWuKbbb5BqAOa/
yu/hApV/B3NyqCn+4zdy4qr59va6IWdXlaZQ/fhgGmY/YusoEqg5/yyN4A4E9BZz
QuACphXSzBg=
=FoZT
-----END PGP SIGNATURE-----
|