LinuxSecurity.com
Share your story
The central voice for Linux and Open Source security news
Home News Topics Advisories HOWTOs Features Newsletters About Register

Welcome!
Sign up!
EnGarde Community
Login
Polls
What is the most important Linux security technology?
 
Advisories
Community
Linux Events
Linux User Groups
Link to Us
Security Center
Book Reviews
Security Dictionary
Security Tips
SELinux
White Papers
Featured Blogs
All About Linux
DanWalsh LiveJournal
Securitydistro
Latest Newsletters
Linux Advisory Watch: November 21st, 2014
Linux Security Week: November 17th, 2014
Subscribe
LinuxSecurity Newsletters
E-mail:
Choose Lists:
About our Newsletters
RSS Feeds
Get the LinuxSecurity news you want faster with RSS
Powered By

  
NetBSD-SA1998-003 mmap(2) and append-only files vulnerabilities Print E-mail
User Rating:      How can I rate this item?
Posted by LinuxSecurity.com Team   
NetBSD 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.
-----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 , Luke Mewburn
, Charles Hannum , Chris Demetriou
 and Matthew Green  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-----
 
< Prev   Next >
    
Partner

 

Latest Features
Peter Smith Releases Linux Network Security Online
Securing a Linux Web Server
Password guessing with Medusa 2.0
Password guessing as an attack vector
Squid and Digest Authentication
Squid and Basic Authentication
Demystifying the Chinese Hacking Industry: Earning 6 Million a Night
Free Online security course (LearnSIA) - A Call for Help
What You Need to Know About Linux Rootkits
Review: A Practical Guide to Fedora and Red Hat Enterprise Linux - Fifth Edition
Yesterday's Edition
Partner Sponsor

Community | HOWTOs | Blogs | Features | Book Reviews | Networking
 Security Projects |  Latest News |  Newsletters |  SELinux |  Privacy |  Home
 Hardening |   About Us |   Advertise |   Legal Notice |   RSS |   Guardian Digital
(c)Copyright 2014 Guardian Digital, Inc. All rights reserved.