You are not logged in.

#1 2012-10-20 11:24:41

mmix
Member
Registered: 2012-10-03
Posts: 42

[TIP] git-sources-3.9-rc8 & nvidia-304.88

# emerge git-sources
# eselect kernel list
# eselect kernel set <N>
//# genkernel all                      //first time
# genkernel --splash --no-mrproper --no-clean --no-menuconfig all //next time.
# vi /etc/boot.conf                //genkernel, only once. optional.
# boot-update
# ln -s /usr/src/linux-3.9-rc8/include/generated/uapi/linux/version.h /usr/src/linux-3.9-rc8/include/linux/

reboot

# chmod +x NVIDIA-Linux-x86_64-304.88.run
# ./NVIDIA-Linux-x86_64-304.88.run

--
/etc/boot.conf

boot {
        generate grub
        default "Funtoo Linux genkernel"
        timeout 3
}

"Funtoo Linux" {
        kernel bzImage[-v]
}

"Funtoo Linux genkernel" {
        kernel kernel[-v]
        initrd initramfs[-v]
        params = quiet rootfstype=ext4
        params += real_root=auto
}

"Funtoo Linux dracut" {
        kernel vmlinuz[-v]
        ## this is the better-initramfs generated initrd
        initrd initramfs[-v]
        params  = quiet rootfstype=ext4
        params += real_root=auto
}

Last edited by mmix (2013-04-25 03:16:38)

Offline

#2 2013-01-04 10:30:34

mmix
Member
Registered: 2012-10-03
Posts: 42

Re: [TIP] git-sources-3.9-rc8 & nvidia-304.88

# cp 3.7/.config 3.8/

# cd 3.8 && make oldconfig

# genkernel --splash --no-mrproper --no-clean --no-menuconfig all

--

//add --keep-going option for Nvidia 313.xx version installation failure of old nvidia vga
# emerge --sync && emerge -auvDN --keep-going world

Last edited by mmix (2013-01-19 13:36:43)

Offline

#3 2013-02-16 07:09:57

mmix
Member
Registered: 2012-10-03
Posts: 42

Re: [TIP] git-sources-3.9-rc8 & nvidia-304.88

http://seclists.org/oss-sec/2013/q1/326

Linux kernel stack corruption due to race condition with PTRACE_SETREGS
-----------------------------------------------------------------------

A race conditon in ptrace can lead to kernel stack corruption and arbitrary
kernel-mode code execution.

Kernel patch for easy reproduction:

diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index b629bbe..e22617e 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -24,6 +24,7 @@
#include <linux/rcupdate.h>
#include <linux/module.h>
#include <linux/context_tracking.h>
+#include <linux/delay.h>

#include <asm/uaccess.h>
#include <asm/pgtable.h>
@@ -902,6 +903,12 @@ long arch_ptrace(struct task_struct *child, long request,
datap);

case PTRACE_SETREGS: /* Set all gp regs in the child. */
+ if (!strcmp(current->comm, "ptrace_death")) {
+ int i;
+ WARN_ON_ONCE(1);
+ for (i = 0 ; i < 15; i++)
+ mdelay(10);
+ }
return copy_regset_from_user(child,
task_user_regset_view(current),
REGSET_GENERAL,

Offline

#4 2013-03-06 14:07:59

mmix
Member
Registered: 2012-10-03
Posts: 42

Re: [TIP] git-sources-3.9-rc8 & nvidia-304.88

Nvidia 304.64 is deprecated.

this is just backup for old vga card:

# NVIDIA-Linux-x86_64-304.64.run -x
# cd NVIDIA-Linux-x86_64-304.64/kernel
# do some patch(see below)
# cd .. && ./nvidia-installer

http://www.nvnews.net/vbulletin/showthread.php?t=194465

--- conftest.sh.dist    2012-10-11 19:18:22.704848496 -0400
+++ conftest.sh 2012-10-12 20:35:55.707213868 -0400
@@ -20,6 +20,7 @@
 ISYSTEM=`$CC -print-file-name=include 2> /dev/null`
 SOURCES=$4
 HEADERS=$SOURCES/include
+HEADERSA=$SOURCES/include/uapi
 OUTPUT=$5
 XEN_PRESENT=1

@@ -118,7 +119,7 @@
         fi
     fi

-    CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"
+    CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS -I$HEADERSA $AUTOCONF_CFLAGS"

     test_xen

@@ -146,10 +147,10 @@
         fi
     fi

-    CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"
+    CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS -I$HEADERSA $AUTOCONF_CFLAGS"

     if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
-        CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$OUTPUT/arch/x86/include/generated"
+        CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$SOURCES/arch/x86/include/uapi -I$OUTPUT/arch/x86/include/generated -I$OUTPUT/arch/x86/include/generated/uapi"
     elif [ "$ARCH" = "arm" ]; then
         CFLAGS="$CFLAGS -I$SOURCES/arch/arm/include -I$OUTPUT/arch/arm/include/generated"
     fi
--- nv-mmap.c.dist 2012-08-08 22:52:53.000000000 -0400
+++ nv-mmap.c 2012-08-14 23:52:41.257235863 -0400
@@ -450,7 +450,7 @@
NV_PRINT_AT(NV_DBG_MEMINFO, at);
nv_vm_list_page_count(&at->page_table[i], pages);

- vma->vm_flags |= (VM_IO | VM_LOCKED | VM_RESERVED);
+ vma->vm_flags |= (VM_IO | VM_LOCKED | (VM_DONTEXPAND | VM_DONTDUMP));

Offline

Board footer

Powered by FluxBB