From: Marc Fiuczynski Date: Thu, 17 Feb 2005 16:32:55 +0000 (+0000) Subject: Patched to 2.6.10-1.14_FC2. X-Git-Tag: before-fedora-2_6_18-1_2239_FC5-vs2_0_2_2-rc6-merge~249 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=17a8f298a974b79549792030d6a79ab6b34065bd;p=linux-2.6.git Patched to 2.6.10-1.14_FC2. --- diff --git a/Makefile b/Makefile index 5133b8b16..effcf26e0 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 10 -EXTRAVERSION = -1.12_FC2.1.planetlab +EXTRAVERSION = -1.14_FC2.1.planetlab NAME=AC 1 # *DOCUMENTATION* diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c index c2888acdb..812b50a1f 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/i386/kernel/smp.c @@ -23,6 +23,7 @@ #include #include +#include #include /* @@ -327,6 +328,8 @@ fastcall void smp_invalidate_interrupt(struct pt_regs *regs) unsigned long cpu; cpu = get_cpu(); + if (current->active_mm) + load_user_cs_desc(cpu, current->active_mm); if (!cpu_isset(cpu, flush_cpumask)) goto out; diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index 7a67e3b63..7211494cc 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c @@ -568,7 +568,10 @@ void __init paging_init(void) set_nx(); if (nx_enabled) printk("NX (Execute Disable) protection: active\n"); + else #endif + if (exec_shield) + printk("Using x86 segment limits to approximate NX protection\n"); pagetable_init(); diff --git a/arch/i386/mm/mmap.c b/arch/i386/mm/mmap.c index c5e0d0119..09a693d19 100644 --- a/arch/i386/mm/mmap.c +++ b/arch/i386/mm/mmap.c @@ -26,6 +26,7 @@ #include #include +#include /* * Top of mmap area (just below the process stack). @@ -38,13 +39,17 @@ static inline unsigned long mmap_base(struct mm_struct *mm) { unsigned long gap = current->signal->rlim[RLIMIT_STACK].rlim_cur; + unsigned long random_factor = 0; + + if (current->flags & PF_RELOCEXEC) + random_factor = get_random_int() % (1024*1024); if (gap < MIN_GAP) gap = MIN_GAP; else if (gap > MAX_GAP) gap = MAX_GAP; - return TASK_SIZE - (gap & PAGE_MASK); + return PAGE_ALIGN(TASK_SIZE - gap - random_factor); } /* @@ -57,15 +62,17 @@ void arch_pick_mmap_layout(struct mm_struct *mm) * Fall back to the standard layout if the personality * bit is set, or if the expected stack growth is unlimited: */ - if (sysctl_legacy_va_layout || + if ((exec_shield != 2) && (sysctl_legacy_va_layout || (current->personality & ADDR_COMPAT_LAYOUT) || - current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY) { + current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY)){ mm->mmap_base = TASK_UNMAPPED_BASE; mm->get_unmapped_area = arch_get_unmapped_area; mm->unmap_area = arch_unmap_area; } else { mm->mmap_base = mmap_base(mm); mm->get_unmapped_area = arch_get_unmapped_area_topdown; + if (current->flags & PF_RELOCEXEC) + mm->get_unmapped_exec_area = arch_get_unmapped_exec_area; mm->unmap_area = arch_unmap_area_topdown; } } diff --git a/configs/kernel-2.6.10-i586-smp.config b/configs/kernel-2.6.10-i586-smp.config index 062b2338c..9887d023a 100644 --- a/configs/kernel-2.6.10-i586-smp.config +++ b/configs/kernel-2.6.10-i586-smp.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-ac11 -# Thu Feb 3 14:51:24 2005 +# Linux kernel version: 2.6.10-ac12 +# Tue Feb 15 15:58:28 2005 # CONFIG_X86=y CONFIG_MMU=y @@ -583,7 +583,7 @@ CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # -# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y diff --git a/configs/kernel-2.6.10-i586.config b/configs/kernel-2.6.10-i586.config index 1172277d3..426934d4d 100644 --- a/configs/kernel-2.6.10-i586.config +++ b/configs/kernel-2.6.10-i586.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-ac11 -# Thu Feb 3 14:51:24 2005 +# Linux kernel version: 2.6.10-ac12 +# Tue Feb 15 15:58:28 2005 # CONFIG_X86=y CONFIG_MMU=y @@ -574,7 +574,7 @@ CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # -# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y diff --git a/configs/kernel-2.6.10-i686-planetlab.config b/configs/kernel-2.6.10-i686-planetlab.config index 9f954fad7..1fc0e1ead 100644 --- a/configs/kernel-2.6.10-i686-planetlab.config +++ b/configs/kernel-2.6.10-i686-planetlab.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.10-1.12_FC2.1.planetlab -# Wed Feb 16 09:23:46 2005 +# Wed Feb 16 17:28:06 2005 # CONFIG_X86=y CONFIG_MMU=y @@ -589,7 +589,7 @@ CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # -# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y diff --git a/configs/kernel-2.6.10-i686-smp.config b/configs/kernel-2.6.10-i686-smp.config index b020c0d56..f1837c10a 100644 --- a/configs/kernel-2.6.10-i686-smp.config +++ b/configs/kernel-2.6.10-i686-smp.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-ac11 -# Thu Feb 3 14:51:25 2005 +# Linux kernel version: 2.6.10-ac12 +# Tue Feb 15 15:58:29 2005 # CONFIG_X86=y CONFIG_MMU=y @@ -587,7 +587,7 @@ CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # -# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y diff --git a/configs/kernel-2.6.10-i686.config b/configs/kernel-2.6.10-i686.config index dcb618288..412fe0872 100644 --- a/configs/kernel-2.6.10-i686.config +++ b/configs/kernel-2.6.10-i686.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-ac11 -# Thu Feb 3 14:51:25 2005 +# Linux kernel version: 2.6.10-ac12 +# Tue Feb 15 15:58:29 2005 # CONFIG_X86=y CONFIG_MMU=y @@ -575,7 +575,7 @@ CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # -# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 19bacae29..367f12d6c 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -556,7 +556,7 @@ static int mxser_initbrd(int board, struct mxser_hwconf *hwconf) info = &mxvar_table[n]; /*if (verbose) */ { printk(KERN_DEBUG " ttyM%d - ttyM%d ", n, n + hwconf->ports - 1); - printk(KERN_DEBUG " max. baud rate = %d bps.\n", hwconf->MaxCanSetBaudRate[0]); + printk(" max. baud rate = %d bps.\n", hwconf->MaxCanSetBaudRate[0]); } for (i = 0; i < hwconf->ports; i++, n++, info++) { @@ -609,18 +609,12 @@ static int mxser_initbrd(int board, struct mxser_hwconf *hwconf) n = board * MXSER_PORTS_PER_BOARD; info = &mxvar_table[n]; - spin_lock_irqsave(&info->slock, flags); retval = request_irq(hwconf->irq, mxser_interrupt, IRQ_T(info), "mxser", info); if (retval) { - spin_unlock_irqrestore(&info->slock, flags); printk(KERN_ERR "Board %d: %s", board, mxser_brdname[hwconf->board_type - 1]); printk(" Request irq fail,IRQ (%d) may be conflit with another device.\n", info->irq); return retval; } - - spin_unlock_irqrestore(&info->slock, flags); - - return 0; } @@ -2144,10 +2138,9 @@ intr_old: mxvar_log.rxcnt[info->port] += cnt; info->mon_data.rxcnt += cnt; info->mon_data.up_rxcnt += cnt; - - tty->ldisc.receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count); spin_unlock_irqrestore(&info->slock, flags); - + + tty_flip_buffer_push(tty); } static void mxser_transmit_chars(struct mxser_struct *info) diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index a29dffd94..64a729419 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -1143,13 +1143,13 @@ static inline int copy_from_read_buf(struct tty_struct *tty, { int retval; - ssize_t n; + size_t n; unsigned long flags; retval = 0; spin_lock_irqsave(&tty->read_lock, flags); n = min(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail); - n = min((ssize_t)*nr, n); + n = min(*nr, n); spin_unlock_irqrestore(&tty->read_lock, flags); if (n) { mb(); diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index f61189f99..9935d1c93 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1156,8 +1156,8 @@ static inline void pty_line_name(struct tty_driver *driver, int index, char *p) int i = index + driver->name_base; /* ->name is initialized to "ttyp", but "tty" is expected */ sprintf(p, "%s%c%x", - driver->subtype == PTY_TYPE_SLAVE ? "tty" : driver->name, - ptychar[i >> 4 & 0xf], i & 0xf); + driver->subtype == PTY_TYPE_SLAVE ? "pty" : driver->name, + ptychar[i >> 4 & 0xf], i & 0xf); } static inline void tty_line_name(struct tty_driver *driver, int index, char *p) diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 7b5303bef..70cf37210 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c @@ -1100,15 +1100,18 @@ static void set_rx_mode(struct net_device *dev) entry = tp->cur_tx++ % TX_RING_SIZE; if (entry != 0) { - /* Avoid a chip errata by prefixing a dummy entry. */ - tp->tx_buffers[entry].skb = NULL; - tp->tx_buffers[entry].mapping = 0; - tp->tx_ring[entry].length = - (entry == TX_RING_SIZE-1) ? cpu_to_le32(DESC_RING_WRAP) : 0; - tp->tx_ring[entry].buffer1 = 0; - /* Must set DescOwned later to avoid race with chip */ - dummy = entry; - entry = tp->cur_tx++ % TX_RING_SIZE; + /* Avoid a chip errata by prefixing a dummy entry. Don't do + this on the ULI526X as it triggers a different problem */ + if (!(tp->chip_id == ULI526X && (tp->revision = 0x40 || tp->revision == 0x50))) { + tp->tx_buffers[entry].skb = NULL; + tp->tx_buffers[entry].mapping = 0; + tp->tx_ring[entry].length = + (entry == TX_RING_SIZE-1) ? cpu_to_le32(DESC_RING_WRAP) : 0; + tp->tx_ring[entry].buffer1 = 0; + /* Must set DescOwned later to avoid race with chip */ + dummy = entry; + entry = tp->cur_tx++ % TX_RING_SIZE; + } } tp->tx_buffers[entry].skb = NULL; diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index 9b340d991..4347594a6 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c @@ -121,7 +121,10 @@ static struct { {"3PARdata", "VV", NULL, BLIST_REPORTLUN2}, {"ADAPTEC", "AACRAID", NULL, BLIST_FORCELUN}, {"ADAPTEC", "Adaptec 5400S", NULL, BLIST_FORCELUN}, + {"AFT PRO", "-IX CF", "0.0>", BLIST_FORCELUN}, + {"BELKIN", "USB 2 HS-CF", "1.95", BLIST_FORCELUN | BLIST_INQUIRY_36}, {"CANON", "IPUBJD", NULL, BLIST_SPARSELUN}, + {"CBOX3", "USB Storage-SMC", "300A", BLIST_FORCELUN | BLIST_INQUIRY_36}, {"CMD", "CRA-7280", NULL, BLIST_SPARSELUN}, /* CMD RAID Controller */ {"CNSI", "G7324", NULL, BLIST_SPARSELUN}, /* Chaparral G7324 RAID */ {"CNSi", "G8324", NULL, BLIST_SPARSELUN}, /* Chaparral G8324 RAID */ @@ -142,6 +145,9 @@ static struct { {"EMC", "SYMMETRIX", NULL, BLIST_SPARSELUN | BLIST_LARGELUN | BLIST_FORCELUN}, {"EMULEX", "MD21/S2 ESDI", NULL, BLIST_SINGLELUN}, {"FSC", "CentricStor", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, + {"Generic", "USB SD Reader", "1.00", BLIST_FORCELUN | BLIST_INQUIRY_36}, + {"Generic", "USB Storage-SMC", "0180", BLIST_FORCELUN | BLIST_INQUIRY_36}, + {"Generic", "USB Storage-SMC", "0207", BLIST_FORCELUN | BLIST_INQUIRY_36}, {"HITACHI", "DF400", "*", BLIST_SPARSELUN}, {"HITACHI", "DF500", "*", BLIST_SPARSELUN}, {"HITACHI", "DF600", "*", BLIST_SPARSELUN}, @@ -172,17 +178,18 @@ static struct { {"NEC", "PD-1 ODX654P", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, {"NRC", "MBR-7", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, {"NRC", "MBR-7.4", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, - {"OTi", "CF CARD Reader", "2.00", BLIST_FORCELUN | BLIST_SINGLELUN}, {"PIONEER", "CD-ROM DRM-600", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, {"PIONEER", "CD-ROM DRM-602X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, {"PIONEER", "CD-ROM DRM-604X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, {"REGAL", "CDC-4X", NULL, BLIST_MAX5LUN | BLIST_SINGLELUN}, + {"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN}, {"SEAGATE", "ST34555N", "0930", BLIST_NOTQ}, /* Chokes on tagged INQUIRY */ {"SEAGATE", "ST3390N", "9546", BLIST_NOTQ}, {"SGI", "RAID3", "*", BLIST_SPARSELUN}, {"SGI", "RAID5", "*", BLIST_SPARSELUN}, {"SGI", "TP9100", "*", BLIST_REPORTLUN2}, {"SGI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, + {"SMSC", "USB 2 HS-CF", NULL, BLIST_SPARSELUN | BLIST_INQUIRY_36}, {"SONY", "CD-ROM CDU-8001", NULL, BLIST_BORKEN}, {"SONY", "TSL", NULL, BLIST_FORCELUN}, /* DDS3 & DDS4 autoloaders */ {"SUN", "T300", "*", BLIST_SPARSELUN}, @@ -190,48 +197,13 @@ static struct { {"TEXEL", "CD-ROM", "1.06", BLIST_BORKEN}, {"TOSHIBA", "CDROM", NULL, BLIST_ISROM}, {"TOSHIBA", "CD-ROM", NULL, BLIST_ISROM}, + {"USB2.0", "SMARTMEDIA/XD", NULL, BLIST_FORCELUN | BLIST_INQUIRY_36}, {"WangDAT", "Model 2600", "01.7", BLIST_SELECT_NO_ATN}, {"WangDAT", "Model 3200", "02.2", BLIST_SELECT_NO_ATN}, {"WangDAT", "Model 1300", "02.4", BLIST_SELECT_NO_ATN}, {"XYRATEX", "RS", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, {"Zzyzx", "RocketStor 500S", NULL, BLIST_SPARSELUN}, {"Zzyzx", "RocketStor 2000", NULL, BLIST_SPARSELUN}, - - /* - * USB multi card readers. - */ - {"AFT", "CF PRO-9XP", "9144", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"AFT PRO", "-IX CF", "0.0>", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"BELKIN", "USB 2 HS-CF", "1.95", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"CBOX3", "USB Storage-SMC", "300A", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"DMI", "MultiFlash", "3.00", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"eUSB", "Compact Flash", NULL, BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"GENERIC", "Card Reader CF", "v26F", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"General", "USB Disk Drive","1.00", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"Generic", "USB SD Reader", "1.00", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"Generic", "USB Storage-SMC", "0090", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"Generic", "USB Storage-SMC", "0180", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"Generic", "USB Storage-SMC", "0207", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"generic", "USB Storage-SMC", "0207", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"IC", "USB Storage-CFC", "322E", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"ICSI", "SD Card", "2.7C", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"IOI", "Media Bay", "*", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"Lexar", "Media Inc. SM/xD", "009E", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"Lexar", "USB Storage-SMC", "I18A", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"Medion", "Flash XL MMC/SD", "2.6D", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"OEI-USB", "CompactFlash", "1.01", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"OEI-USB2", "CompactFlash", "2.00", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"SMSC", "223 U HS-CF", "1.95", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"SMSC", "USB 2 HS-CF", NULL, BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"TwinMOS", "7-in-1 Card RWCF", "0100", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"USB2.0", "CardReader CF RW", "0.0>", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"USB2.0", "CardReader SM RW", "0814", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"USB2.0", "CF CardReader", NULL, BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"USB2.0", "SMARTMEDIA/XD", NULL, BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"Y-E DATA", "CF Card Reader", "1.03", BLIST_FORCELUN | BLIST_INQUIRY_36}, - {"Zynet", "USB Storage-SMC", "I03A", BLIST_FORCELUN | BLIST_INQUIRY_36}, - { NULL, NULL, NULL, 0 }, }; diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 161c52f2e..0d512de5a 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -75,7 +75,7 @@ module_param(old_scheme_first, bool, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(old_scheme_first, "start with the old device initialization scheme"); -static int use_both_schemes = 0; +static int use_both_schemes = 1; module_param(use_both_schemes, bool, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(use_both_schemes, "try the other device initialization scheme if the " diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 42de9c894..55235a69e 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -776,7 +776,7 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) * Turn off the CS limit completely if exec-shield disabled or * NX active: */ - if (!exec_shield || executable_stack != EXSTACK_DISABLE_X) + if (!exec_shield || executable_stack != EXSTACK_DISABLE_X || nx_enabled) arch_add_exec_range(current->mm, -1); #endif @@ -798,7 +798,8 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) /* Do this immediately, since STACK_TOP as used in setup_arg_pages may depend on the personality. */ SET_PERSONALITY(loc->elf_ex, ibcs2_interpreter); - if (elf_read_implies_exec(loc->elf_ex, have_pt_gnu_stack)) + if (exec_shield != 2 && + elf_read_implies_exec(loc->elf_ex, have_pt_gnu_stack)) current->personality |= READ_IMPLIES_EXEC; arch_pick_mmap_layout(current->mm); diff --git a/fs/proc/generic.c b/fs/proc/generic.c index f42a81260..2e8592653 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -63,7 +63,7 @@ proc_file_read(struct file *file, char __user *buf, size_t nbytes, return -ENOMEM; while ((nbytes > 0) && !eof) { - count = min_t(ssize_t, PROC_BLOCK_SIZE, nbytes); + count = min_t(size_t, PROC_BLOCK_SIZE, nbytes); start = NULL; if (dp->get_info) { diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 36a4ce1a6..def2511df 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -23,9 +23,6 @@ char *task_mem(struct mm_struct *mm, char *buffer) "StaBrk:\t%08lx kB\n" "Brk:\t%08lx kB\n" "StaStk:\t%08lx kB\n" -#if __i386__ - "ExecLim:\t%08lx\n" -#endif , (mm->total_vm - mm->reserved_vm) << (PAGE_SHIFT-10), mm->locked_vm << (PAGE_SHIFT-10), @@ -33,11 +30,12 @@ char *task_mem(struct mm_struct *mm, char *buffer) data << (PAGE_SHIFT-10), mm->stack_vm << (PAGE_SHIFT-10), text, lib, (PTRS_PER_PTE*sizeof(pte_t)*mm->nr_ptes) >> 10, - mm->start_brk, mm->brk, mm->start_stack + mm->start_brk, mm->brk, mm->start_stack); #if __i386__ - , mm->context.exec_limit + if (!nx_enabled) + buffer += sprintf(buffer, + "ExecLim:\t%08lx\n", mm->context.exec_limit); #endif - ); return buffer; } @@ -59,6 +57,9 @@ int task_statm(struct mm_struct *mm, int *shared, int *text, static int show_map(struct seq_file *m, void *v) { +#ifdef __i386__ + struct task_struct *task = m->private; +#endif struct vm_area_struct *map = v; struct file *file = map->vm_file; int flags = map->vm_flags; @@ -77,7 +78,13 @@ static int show_map(struct seq_file *m, void *v) map->vm_end, flags & VM_READ ? 'r' : '-', flags & VM_WRITE ? 'w' : '-', - flags & VM_EXEC ? 'x' : '-', + (flags & VM_EXEC +#ifdef __i386__ + || (!nx_enabled && + (map->vm_start < task->mm->context.exec_limit)) +#endif + ) + ? 'x' : '-', flags & VM_MAYSHARE ? 's' : 'p', map->vm_pgoff << PAGE_SHIFT, MAJOR(dev), MINOR(dev), ino, &len); diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index f17713ed8..9424c0511 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c @@ -588,7 +588,7 @@ error_exit: /* Unlock pages prepared by reiserfs_prepare_file_region_for_write */ void reiserfs_unprepare_pages(struct page **prepared_pages, /* list of locked pages */ - int num_pages /* amount of pages */) { + size_t num_pages /* amount of pages */) { int i; // loop counter for (i=0; i < num_pages ; i++) { @@ -619,7 +619,7 @@ int reiserfs_copy_from_user_to_file_region( int offset; // offset in page for ( i = 0, offset = (pos & (PAGE_CACHE_SIZE-1)); i < num_pages ; i++,offset=0) { - int count = min_t(int,PAGE_CACHE_SIZE-offset,write_bytes); // How much of bytes to write to this page + size_t count = min_t(size_t,PAGE_CACHE_SIZE-offset,write_bytes); // How much of bytes to write to this page struct page *page=prepared_pages[i]; // Current page we process. fault_in_pages_readable( buf, count); @@ -718,8 +718,8 @@ int reiserfs_submit_file_region_for_write( struct reiserfs_transaction_handle *th, struct inode *inode, loff_t pos, /* Writing position offset */ - int num_pages, /* Number of pages to write */ - int write_bytes, /* number of bytes to write */ + size_t num_pages, /* Number of pages to write */ + size_t write_bytes, /* number of bytes to write */ struct page **prepared_pages /* list of pages */ ) { @@ -854,9 +854,9 @@ int reiserfs_check_for_tail_and_convert( struct inode *inode, /* inode to deal w int reiserfs_prepare_file_region_for_write( struct inode *inode /* Inode of the file */, loff_t pos, /* position in the file */ - int num_pages, /* number of pages to + size_t num_pages, /* number of pages to prepare */ - int write_bytes, /* Amount of bytes to be + size_t write_bytes, /* Amount of bytes to be overwritten from @pos */ struct page **prepared_pages /* pointer to array @@ -1252,10 +1252,9 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ while ( count > 0) { /* This is the main loop in which we running until some error occures or until we write all of the data. */ - int num_pages;/* amount of pages we are going to write this iteration */ - int write_bytes; /* amount of bytes to write during this iteration */ - int blocks_to_allocate; /* how much blocks we need to allocate for - this iteration */ + size_t num_pages;/* amount of pages we are going to write this iteration */ + size_t write_bytes; /* amount of bytes to write during this iteration */ + size_t blocks_to_allocate; /* how much blocks we need to allocate for this iteration */ /* (pos & (PAGE_CACHE_SIZE-1)) is an idiom for offset into a page of pos*/ num_pages = !!((pos+count) & (PAGE_CACHE_SIZE - 1)) + /* round up partial @@ -1269,7 +1268,7 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ /* If we were asked to write more data than we want to or if there is not that much space, then we shorten amount of data to write for this iteration. */ - num_pages = min_t(int, REISERFS_WRITE_PAGES_AT_A_TIME, reiserfs_can_fit_pages(inode->i_sb)); + num_pages = min_t(size_t, REISERFS_WRITE_PAGES_AT_A_TIME, reiserfs_can_fit_pages(inode->i_sb)); /* Also we should not forget to set size in bytes accordingly */ write_bytes = (num_pages << PAGE_CACHE_SHIFT) - (pos & (PAGE_CACHE_SIZE-1)); @@ -1295,7 +1294,7 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ // But overwriting files on absolutelly full volumes would not // be very efficient. Well, people are not supposed to fill // 100% of disk space anyway. - write_bytes = min_t(int, count, inode->i_sb->s_blocksize - (pos & (inode->i_sb->s_blocksize - 1))); + write_bytes = min_t(size_t, count, inode->i_sb->s_blocksize - (pos & (inode->i_sb->s_blocksize - 1))); num_pages = 1; // No blocks were claimed before, so do it now. reiserfs_claim_blocks_to_be_allocated(inode->i_sb, 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits)); diff --git a/include/asm-x86_64/mmu_context.h b/include/asm-x86_64/mmu_context.h index 671e7573b..8f80f1570 100644 --- a/include/asm-x86_64/mmu_context.h +++ b/include/asm-x86_64/mmu_context.h @@ -54,10 +54,9 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, out_of_line_bug(); if(!test_and_set_bit(cpu, &next->cpu_vm_mask)) { /* We were in lazy tlb mode and leave_mm disabled - * tlb flush IPI delivery. We must reload CR3 - * to make sure to use no freed page tables. + * tlb flush IPI delivery. We must flush our tlb. */ - asm volatile("movq %0,%%cr3" :: "r" (__pa(next->pgd)) : "memory"); + local_flush_tlb(); load_LDT_nolock(&next->context, cpu); } } diff --git a/mm/mmap.c b/mm/mmap.c index 5fc8e0128..9c2e112e4 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1440,8 +1440,7 @@ int expand_stack(struct vm_area_struct * vma, unsigned long address) address &= PAGE_MASK; grow = (address - vma->vm_end) >> PAGE_SHIFT; - /* Someone beat us to it */ - if (grow <= 0) { + if (address < vma->vm_end) { anon_vma_unlock(vma); return 0; } @@ -1517,8 +1516,7 @@ int expand_stack(struct vm_area_struct *vma, unsigned long address) address &= PAGE_MASK; grow = (vma->vm_start - address) >> PAGE_SHIFT; - /* Someone beat us to it */ - if (grow <= 0) { + if (address >= vma->vm_start) { anon_vma_unlock(vma); return 0; }