From owner-freebsd-announce@FreeBSD.ORG Fri Jan 30 08:07:27 2004 Return-Path: Delivered-To: freebsd-announce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 619EC16A4CE; Fri, 30 Jan 2004 08:07:27 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F45243D53; Fri, 30 Jan 2004 08:07:12 -0800 (PST) (envelope-from security-advisories@freebsd.org) Received: from freefall.freebsd.org (nectar@localhost [127.0.0.1]) i0UG7CFR082198; Fri, 30 Jan 2004 08:07:12 -0800 (PST) (envelope-from security-advisories@freebsd.org) Received: (from nectar@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i0UG7CO5082197; Fri, 30 Jan 2004 08:07:12 -0800 (PST) (envelope-from security-advisories@freebsd.org) Date: Fri, 30 Jan 2004 08:07:12 -0800 (PST) Message-Id: <200401301607.i0UG7CO5082197@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: nectar set sender to security-advisories@freebsd.org using -f From: FreeBSD Security Advisories To: FreeBSD Security Advisories Precedence: bulk Subject: [FreeBSD-Announce] FreeBSD Security Advisory FreeBSD-SA-04:01.mksnap_ffs X-BeenThere: freebsd-announce@freebsd.org X-Mailman-Version: 2.1.1 Reply-To: security-advisories@freebsd.org List-Id: Project Announcements [moderated] List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 16:07:27 -0000 -----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 Wiktor Niesiobedzki 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 . 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----- From owner-freebsd-announce@FreeBSD.ORG Thu Feb 5 10:41:09 2004 Return-Path: Delivered-To: freebsd-announce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BEF116A4CF; Thu, 5 Feb 2004 10:41:09 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41A2743D5A; Thu, 5 Feb 2004 10:40:35 -0800 (PST) (envelope-from security-advisories@freebsd.org) Received: from freefall.freebsd.org (nectar@localhost [127.0.0.1]) i15IeZFR041243; Thu, 5 Feb 2004 10:40:35 -0800 (PST) (envelope-from security-advisories@freebsd.org) Received: (from nectar@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i15IeZw4041238; Thu, 5 Feb 2004 10:40:35 -0800 (PST) (envelope-from security-advisories@freebsd.org) Date: Thu, 5 Feb 2004 10:40:35 -0800 (PST) Message-Id: <200402051840.i15IeZw4041238@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: nectar set sender to security-advisories@freebsd.org using -f From: FreeBSD Security Advisories To: FreeBSD Security Advisories Precedence: bulk Subject: [FreeBSD-Announce] FreeBSD Security Advisory FreeBSD-SA-04:02.shmat X-BeenThere: freebsd-announce@freebsd.org X-Mailman-Version: 2.1.1 Reply-To: security-advisories@freebsd.org List-Id: Project Announcements [moderated] List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 18:41:09 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 ============================================================================= FreeBSD-SA-04:02.shmat Security Advisory The FreeBSD Project Topic: shmat reference counting bug Category: core Module: kernel Announced: 2004-02-05 Credits: Joost Pol Affects: All FreeBSD releases Corrected: 2004-02-04 18:00:40 UTC (RELENG_4) 2004-02-04 18:00:47 UTC (RELENG_5_2, 5.2-RELEASE-p2) 2004-02-04 18:00:55 UTC (RELENG_5_1, 5.1-RELEASE-p14) 2004-02-04 18:01:03 UTC (RELENG_5_0, 5.0-RELEASE-p20) 2004-02-04 18:01:10 UTC (RELENG_4_9, 4.9-RELEASE-p2) 2004-02-04 18:01:18 UTC (RELENG_4_8, 4.8-RELEASE-p15) 2004-02-04 18:01:25 UTC (RELENG_4_7, 4.7-RELEASE-p25) CVE Name: CAN-2004-0114 FreeBSD only: NO I. Background The System V Shared Memory interface provides primitives for sharing memory segments between separate processes. FreeBSD supports this interface when the kernel is built with SYSVSHM option, or the sysvshm module is loaded. By default, the FreeBSD kernel is built with the SYSVSHM option. The shmat(2) system call, which is part of the System V Shared Memory interface, is used to attach a shared memory segment to the calling process's address space. II. Problem Description A programming error in the shmat(2) system call can result in a shared memory segment's reference count being erroneously incremented. III. Impact It may be possible to cause a shared memory segment to reference unallocated kernel memory, but remain valid. This could allow a local attacker to gain read or write access to a portion of kernel memory, resulting in sensitive information disclosure, bypass of access control mechanisms, or privilege escalation. IV. Workaround NOTE: These workarounds could cause applications that use shared memory, such as the X Window System, to exhibit erratic behavior or to fail completely. Do one of the following: 1) Disable the System V Shared Memory interface entirely by following these steps: - Remove or comment out any lines mentioning `SYSVSHM' from your kernel configuration file, and recompile your kernel as described in . - Remove or comment out any lines mentioning `sysvshm' from /boot/loader.conf and /etc/rc.conf. - On FreeBSD 5.x systems only , System V Shared Memory support may be provided as a kld(4). To be absolutely safe, remove any files named `sysvshm.ko' in /modules, /boot, and any subdirectories. - Finally, reboot your system. OR 2) Configure the System V Shared Memory parameters so that no new shared memory segments may be created, terminate all processes using shared memory, and delete all existing shared memory segments. Run the following commands as root: # sysctl -w kern.ipc.shmmax=0 # echo 'kern.ipc.shmmax=0' >> /etc/sysctl.conf # ipcs | awk '/^m/ { print $2 }' | xargs -n 1 ipcrm -m V. Solution Do one of the following: 1) Upgrade your vulnerable system to 4-STABLE, or to the RELENG_5_2, RELENG_5_1, RELENG_4_9, or RELENG_4_8 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-p2) also includes numerous other critical bug fixes, most of which are not security related. Please read src/UPDATING for details on these changes. OR 2) Patch your present system: The following patch has been verified to apply to FreeBSD 4.x and 5.x systems. a) Download the relevant patch from the location below, and verify the detached PGP signature using your PGP utility. # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-04:02/shmat.patch # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-04:02/shmat.patch.asc b) Apply the patch. # cd /usr/src # patch < /path/to/patch c) Recompile your kernel as described in and reboot the system. VI. Correction details The following list contains the revision numbers of each file that was corrected in FreeBSD. Path Revision Branch - ------------------------------------------------------------------------- RELENG_4 src/sys/kern/sysv_shm.c 1.45.2.8 RELENG_5_2 src/UPDATING 1.282.2.5 src/sys/conf/newvers.sh 1.56.2.5 src/sys/kern/sysv_shm.c 1.89.2.1 RELENG_5_1 src/UPDATING 1.251.2.15 src/sys/conf/newvers.sh 1.50.2.15 src/sys/kern/sysv_shm.c 1.83.2.1 RELENG_5_0 src/UPDATING 1.229.2.26 src/sys/conf/newvers.sh 1.48.2.21 src/sys/kern/sysv_shm.c 1.74.2.1 RELENG_4_9 src/UPDATING 1.73.2.89.2.3 src/sys/conf/newvers.sh 1.44.2.32.2.3 src/sys/kern/sysv_shm.c 1.45.2.6.4.1 RELENG_4_8 src/UPDATING 1.73.2.80.2.18 src/sys/conf/newvers.sh 1.44.2.29.2.16 src/sys/kern/sysv_shm.c 1.45.2.6.2.1 RELENG_4_7 src/UPDATING 1.73.2.74.2.29 src/sys/conf/newvers.sh 1.44.2.26.2.27 src/sys/kern/sysv_shm.c 1.45.2.5.6.1 - ------------------------------------------------------------------------- VII. References -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAIocaFdaIBMps37IRAtO8AJ9pP86snAwE67qdkwsat1CoJ+gFGACeJLtU PjD0jexX+1QaN7q2JvgVXmc= =IEvj -----END PGP SIGNATURE-----