-----BEGIN PGP SIGNED MESSAGE-----

===========================================================================
             AUSCERT External Security Bulletin Redistribution

               ESB-2004.0081 -- FreeBSD-SA-04:01.mksnap_ffs
                   mksnap_ffs clears file system options
                             02 February 2004

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:                mksnap_ffs(8)
Publisher:              FreeBSD
Operating System:       FreeBSD 5.2-RELEASE
                        FreeBSD 5.1-RELEASE
Impact:                 Modify Permissions
Access Required:        Existing Account
CVE Names:              CAN-2004-0099

- --------------------------BEGIN INCLUDED TEXT--------------------

- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

=============================================================================
FreeBSD-SA-04:01.mksnap_ffs                                 Security Advisory
                                                          The FreeBSD Project

Topic:          mksnap_ffs clears file system options

Category:       core
Module:         mksnap_ffs
Announced:      2004-01-30
Credits:        Kimura Fuyuki <fuyuki@nigredo.org>
                Wiktor Niesiobedzki <bsd@w.evip.pl>
Affects:        FreeBSD 5.1-RELEASE
                FreeBSD 5.2-RELEASE
Corrected:      2004-01-27 19:33:16 UTC (RELENG_5_1, 5.1-RELEASE-p12)
                2004-01-29 22:54:31 UTC (RELENG_5_2, 5.2-RELEASE-p1)
CVE Name:       CAN-2004-0099
FreeBSD only:   YES

For general information regarding FreeBSD Security Advisories,
including descriptions of the fields above, security branches, and the
following sections, please visit
<URL:http://www.freebsd.org/security/>.

I.   Background

Mounted filesystems can have a variety of flags set on them.  Some
flags affect performance and reliability, while others enable or
disable particular security-related features such as the ability to
execute a binary stored on the filesystem or the use of access control
lists to complement normal Unix file permissions.

The mksnap_ffs(8) command creates a `snapshot' of a filesystem.  A
`snapshot' is a static representation of the state of the filesystem
at a particular point in time.  Snapshots have a variety of uses,
but their primary purpose is to make it possible to run fsck(8) and
dump(8) on live filesystems.

II.  Problem Description

The kernel interface for creating a snapshot of a filesystem is the
same as that for changing the flags on that filesystem.  Due to an
oversight, the mksnap_ffs(8) command called that interface with only
the snapshot flag set, causing all other flags to be reset to the
default value.

III. Impact

A regularly scheduled backup of a live filesystem, or any other
process that uses the mksnap_ffs(8) command (for instance, to provide
a rough undelete functionality on a file server), will clear any flags
in effect on the filesystem being snapshot.  Possible consequences
depend on local usage, but can include disabling extended access
control lists or enabling the use of setuid executables stored on an
untrusted filesystem.

The mksnap_ffs(8) command is normally only available to the superuser
and members of the `operator' group.  There is therefore no risk
of a user gaining elevated privileges directly through use of the
mksnap_ffs(8) command unless it has been intentionally made available
to unprivileged users.

IV.  Workaround

Do not use the mksnap_ffs(8) command, nor the -L option of the dump(8)
command.

It is recommended that you delete the mksnap_ffs(8) command from your
system to prevent accidental use:

# rm /sbin/mksnap_ffs

V.   Solution

Do one of the following:

1) Upgrade your vulnerable system to the RELENG_5_1 or RELENG_5_2
security branch dated after the correction date.

NOTE WELL: Due to release engineering in progress at the time of this
           writing, the RELENG_5_2 security branch (5.2-RELEASE-p1)
           also includes numerous other critical bug fixes, most of
           which are not security related.  Please read src/UPDATING
           for details on these changes.

2) To patch your present system:

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

[FreeBSD 5.1 systems]
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-04:01/mksnap_ffs_5_1.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-04:01/mksnap_ffs_5_1.patch.asc

[FreeBSD 5.2 systems]
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-04:01/mksnap_ffs_5_2.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-04:01/mksnap_ffs_5_2.patch.asc

b) Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch
# cd /usr/src/sbin/mksnap_ffs
# make obj && make depend && make && make install

You are strongly encouraged to verify that all your filesystems have
the correct flags set.  The mount(8) command can list currently mounted
filesystems and flags.  Run the following command as root:

# mount

VI.  Correction details

The following list contains the revision numbers of each file that was
corrected in FreeBSD.

Branch                                                           Revision
  Path
- - -------------------------------------------------------------------------
RELENG_5_1
  src/sbin/mksnap_ffs/mksnap_ffs.c                                1.2.2.1
  src/sys/conf/newvers.sh                                       1.50.2.14
RELENG_5_2
  src/sbin/mksnap_ffs/mksnap_ffs.c                                1.5.2.1
  src/sys/conf/newvers.sh                                        1.56.2.3
- - -------------------------------------------------------------------------
- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAGn6pFdaIBMps37IRApSKAJ9XfweoblldFos1o7QlaDRVVIdFCACePueA
1jXllY/GB8cAeEQ8oaYYPTU=
=6qi5
- -----END PGP SIGNATURE-----

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  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/render.html?cid=1980

If you believe that your computer system has been compromised or attacked in 
any way, we encourage you to let us know by completing the secure National IT 
Incident Reporting Form at:

        http://www.auscert.org.au/render.html?it=3192

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 member emergencies only.
-----BEGIN PGP SIGNATURE-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQCVAwUBQB2U4Sh9+71yA2DNAQGurAP+K+3v/rI/PQBresRi6Imst0ZH3q8UZHMF
62+hS9W/XaOEYcivD4lVbBBvYGMVVZqTn5E0LVV7DWu1gAUkPChMyAzpYG8Ipcfs
knCPftw7qYYOboDsly4xxj9DHQpxljj/Kr9AYeQXAvuWoJ3rsyBJcijLPM+QvkqC
W81z69rirqU=
=p/34
-----END PGP SIGNATURE-----