diff -u fglrx-installer-8.723.1/debian/dkms.conf.in fglrx-installer-8.723.1/debian/dkms.conf.in --- fglrx-installer-8.723.1/debian/dkms.conf.in +++ fglrx-installer-8.723.1/debian/dkms.conf.in @@ -11,0 +12 @@ +PATCH[2]="fix_alloc_user_space32.patch" diff -u fglrx-installer-8.723.1/debian/changelog fglrx-installer-8.723.1/debian/changelog --- fglrx-installer-8.723.1/debian/changelog +++ fglrx-installer-8.723.1/debian/changelog @@ -1,3 +1,11 @@ +fglrx-installer (2:8.723.1-0ubuntu5) lucid-proposed; urgency=low + + * Patch KCL_IOCTL_AllocUserSpace32 to work around + compat_alloc_user_space being newly GPL-only. This was causing a FTBFS + on kernels with the fix for CVE-2010-3081 (LP: #642518). + + -- Evan Broder Sat, 18 Sep 2010 22:51:51 -0700 + fglrx-installer (2:8.723.1-0ubuntu4) lucid-proposed; urgency=low * Remove /etc/ati only after calling the fglrx-uninstall.sh only in patch2: unchanged: --- fglrx-installer-8.723.1.orig/debian/dkms/patches/fix_alloc_user_space32.patch +++ fglrx-installer-8.723.1/debian/dkms/patches/fix_alloc_user_space32.patch @@ -0,0 +1,72 @@ +--- a/kcl_ioctl.c 2010-09-18 23:36:34.183148540 -0700 ++++ b/kcl_ioctl.c 2010-09-18 23:38:23.043412880 -0700 +@@ -193,7 +193,20 @@ + */ + void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size) + { +- return compat_alloc_user_space(size); ++ void __user *space; ++ ++#if ARCH_COMPAT_ALLOC_USER_SPACE ++ space = arch_compat_alloc_user_space(size); ++#else ++ space = compat_alloc_user_space(size); ++#endif ++ ++ /* Avoid CVE-2010-3081 by checking access_ok ourselves */ ++ if (!access_ok(VERIFY_WRITE, space, size)) { ++ return NULL; ++ } ++ ++ return space; + } + + #endif // __x86_64__ +--- a/make.sh 2010-09-19 01:11:22.000000000 -0700 ++++ b/make.sh 2010-09-19 01:20:29.000000000 -0700 +@@ -382,6 +382,26 @@ + fi + + # ============================================================== ++# resolve if we have compat_alloc_user_space is in linux/compat.h ++ ++ARCH_COMPAT_ALLOC_USER_SPACE=0 ++ ++src_file=$linuxincludes/linux/compat.h ++if [ ! -e $src_file ]; ++then ++ echo "Warning:" >> $logfile ++ echo "kernel includes at $linuxincludes not found or incomplete" >> $logfile ++ echo "file: $src_file" >> $logfile ++ echo "" >> $logfile ++else ++ if grep -q compat_alloc_user_space $src_file; ++ then ++ ARCH_COMPAT_ALLOC_USER_SPACE=1 ++ echo "file $src_file says: ARCH_COMPAT_ALLOC_USER_SPACE=$ARCH_COMPAT_ALLOC_USER_SPACE" >> $logfile ++ fi ++fi ++ ++# ============================================================== + # break down OsRelease string into its components + + major=`echo $OsRelease | sed -n -e s/"^\([[:digit:]]*\)\.\([[:digit:]]*\)\.\([[:digit:]]*\)\(.*\)"/"\\1"/p` +@@ -420,6 +440,7 @@ + MODFLAGS="-DMODULE -DATI -DFGL -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX $def_smp $def_modversions" \ + KVER=${uname_r} \ + PAGE_ATTR_FIX=$PAGE_ATTR_FIX \ ++ ARCH_COMPAT_ALLOC_USER_SPACE=$ARCH_COMPAT_ALLOC_USER_SPACE \ + > tlog 2>&1 + + res=$? +--- a/2.6.x/Makefile 2010-09-19 01:20:50.000000000 -0700 ++++ b/2.6.x/Makefile 2010-09-19 01:21:21.000000000 -0700 +@@ -66,6 +66,8 @@ + -DFGL_GART_RESERVED_SLOT \ + -DFGL_LINUX253P1_VMA_API \ + -DPAGE_ATTR_FIX=$(PAGE_ATTR_FIX) \ ++ -DARCH_COMPAT_ALLOC_USER_SPACE=$(ARCH_COMPAT_ALLOC_USER_SPACE) \ ++ + + ifeq ($(KERNELRELEASE),) + # on first call from remote location we get into this path