Commit f140d262 authored by Natanael Copa's avatar Natanael Copa

main/xorg-server: security fix (CVE-2011-4029)

fixes #884
parent 18359640
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xorg-server
pkgver=1.9.5
pkgrel=0
pkgrel=1
pkgdesc="X.Org X servers"
url="http://xorg.freedesktop.org"
license="custom"
......@@ -59,6 +59,7 @@ makedepends="
source="http://xorg.freedesktop.org/releases/individual/xserver/$pkgname-$pkgver.tar.bz2
xorg-redhat-die-ugly-pattern-die-die-die.patch
cve-2011-4029.patch
"
depends_dev="pixman-dev libpciaccess-dev xproto randrproto renderproto
......@@ -148,4 +149,5 @@ xephyr() {
}
md5sums="662566559f4f27638658b50632ce98de xorg-server-1.9.5.tar.bz2
222de594206d1148a90eddfda4f7a11a xorg-redhat-die-ugly-pattern-die-die-die.patch"
222de594206d1148a90eddfda4f7a11a xorg-redhat-die-ugly-pattern-die-die-die.patch
09ecdf3b4e49bd2490946ac15b464535 cve-2011-4029.patch"
From b67581cf825940fdf52bf2e0af4330e695d724a4 Mon Sep 17 00:00:00 2001
From: Matthieu Herrb <matthieu.herrb@laas.fr>
Date: Mon, 17 Oct 2011 20:27:35 +0000
Subject: Fix CVE-2011-4029: File permission change vulnerability.
Use fchmod() to change permissions of the lock file instead
of chmod(), thus avoid the race that can be exploited to set
a symbolic link to any file or directory in the system.
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
---
diff --git a/os/utils.c b/os/utils.c
index fe49254..07cf4c2 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -297,7 +297,7 @@ LockServer(void)
FatalError("Could not create lock file in %s\n", tmp);
(void) sprintf(pid_str, "%10ld\n", (long)getpid());
(void) write(lfd, pid_str, 11);
- (void) chmod(tmp, 0444);
+ (void) fchmod(lfd, 0444);
(void) close(lfd);
/*
--
cgit v0.9.0.2-2-gbebe
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment