From: Fred W. <fw...@us...> - 2006-01-24 04:40:43
|
Update of /cvsroot/linux-abi/linux-abi/linux-26/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2468/linux-26/kernel Modified Files: Makefile exec_domain.c fork.c syscall_ksyms.c Log Message: linux-26: patch to 2.6.14, incl. audit syscalls Index: Makefile =================================================================== RCS file: /cvsroot/linux-abi/linux-abi/linux-26/kernel/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Makefile 24 Jan 2006 00:28:19 -0000 1.3 --- Makefile 24 Jan 2006 04:40:18 -0000 1.4 *************** *** 8,17 **** signal.o sys.o kmod.o workqueue.o pid.o \ rcupdate.o intermodule.o extable.o params.o posix-timers.o \ ! kthread.o wait.o kfifo.o sys_ni.o syscall_ksyms.o posix-cpu-timers.o ! obj-$(CONFIG_FUTEX) += futex.o obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o obj-$(CONFIG_SMP) += cpu.o spinlock.o obj-$(CONFIG_UID16) += uid16.o obj-$(CONFIG_MODULES) += module.o --- 8,17 ---- signal.o sys.o kmod.o workqueue.o pid.o \ rcupdate.o intermodule.o extable.o params.o posix-timers.o \ ! kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o syscall_ksyms.o obj-$(CONFIG_FUTEX) += futex.o obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o obj-$(CONFIG_SMP) += cpu.o spinlock.o + obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o obj-$(CONFIG_UID16) += uid16.o obj-$(CONFIG_MODULES) += module.o *************** *** 19,22 **** --- 19,23 ---- obj-$(CONFIG_PM) += power/ obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o + obj-$(CONFIG_KEXEC) += kexec.o obj-$(CONFIG_COMPAT) += compat.o obj-$(CONFIG_CPUSETS) += cpuset.o *************** *** 28,32 **** --- 29,35 ---- obj-$(CONFIG_KPROBES) += kprobes.o obj-$(CONFIG_SYSFS) += ksysfs.o + obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o obj-$(CONFIG_GENERIC_HARDIRQS) += irq/ + obj-$(CONFIG_CRASH_DUMP) += crash_dump.o obj-$(CONFIG_SECCOMP) += seccomp.o Index: exec_domain.c =================================================================== RCS file: /cvsroot/linux-abi/linux-abi/linux-26/kernel/exec_domain.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** exec_domain.c 24 Jan 2006 00:28:19 -0000 1.3 --- exec_domain.c 24 Jan 2006 04:40:18 -0000 1.4 *************** *** 48,52 **** .pers_low = PERID_DEFAULT, /* low personality id */ .pers_high = PERID_DEFAULT, /* high personality id */ ! /* .signal_map = ident_map, /* Identity map signals. */ .signal_invmap = ident_map, /* - both ways. */ }; --- 48,52 ---- .pers_low = PERID_DEFAULT, /* low personality id */ .pers_high = PERID_DEFAULT, /* high personality id */ ! .signal_map = ident_map, /* Identity map signals. */ .signal_invmap = ident_map, /* - both ways. */ }; Index: fork.c =================================================================== RCS file: /cvsroot/linux-abi/linux-abi/linux-26/kernel/fork.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** fork.c 24 Jan 2006 00:28:19 -0000 1.3 --- fork.c 24 Jan 2006 04:40:18 -0000 1.4 *************** *** 36,39 **** --- 36,40 ---- #include <linux/jiffies.h> #include <linux/futex.h> + #include <linux/rcupdate.h> #include <linux/ptrace.h> #include <linux/mount.h> *************** *** 177,180 **** --- 178,182 ---- /* One for us, one for whoever does the "release_task()" (usually parent) */ atomic_set(&tsk->usage,2); + atomic_set(&tsk->fs_excl, 0); return tsk; } *************** *** 195,198 **** --- 197,201 ---- mm->mmap_cache = NULL; mm->free_area_cache = oldmm->mmap_base; + mm->cached_hole_size = ~0UL; mm->map_count = 0; set_mm_counter(mm, rss, 0); *************** *** 208,213 **** if (mpnt->vm_flags & VM_DONTCOPY) { __vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file, ! -vma_pages(mpnt)); continue; } --- 211,218 ---- if (mpnt->vm_flags & VM_DONTCOPY) { + long pages = vma_pages(mpnt); + mm->total_vm -= pages; __vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file, ! -pages); continue; } *************** *** 250,255 **** /* * Link in the new vma and copy the page table entries: ! * link in first so that swapoff can see swap entries, ! * and try_to_unmap_one's find_vma find the new vma. */ spin_lock(&mm->page_table_lock); --- 255,261 ---- /* * Link in the new vma and copy the page table entries: ! * link in first so that swapoff can see swap entries. ! * Note that, exceptionally, here the vma is inserted ! * without holding mm->mmap_sem. */ spin_lock(&mm->page_table_lock); *************** *** 323,326 **** --- 329,333 ---- mm->default_kioctx = (struct kioctx)INIT_KIOCTX(mm->default_kioctx, *mm); mm->free_area_cache = TASK_UNMAPPED_BASE; + mm->cached_hole_size = ~0UL; if (likely(!mm_alloc_pgd(mm))) { *************** *** 560,570 **** } ! static int count_open_files(struct files_struct *files, int size) { int i; /* Find the last open fd */ for (i = size/(8*sizeof(long)); i > 0; ) { ! if (files->open_fds->fds_bits[--i]) break; } --- 567,578 ---- } ! static int count_open_files(struct fdtable *fdt) { + int size = fdt->max_fdset; int i; /* Find the last open fd */ for (i = size/(8*sizeof(long)); i > 0; ) { ! if (fdt->open_fds->fds_bits[--i]) break; } *************** *** 573,576 **** --- 581,611 ---- } + static struct files_struct *alloc_files(void) + { + struct files_struct *newf; + struct fdtable *fdt; + + newf = kmem_cache_alloc(files_cachep, SLAB_KERNEL); + if (!newf) + goto out; + + atomic_set(&newf->count, 1); + + spin_lock_init(&newf->file_lock); + fdt = &newf->fdtab; + fdt->next_fd = 0; + fdt->max_fds = NR_OPEN_DEFAULT; + fdt->max_fdset = __FD_SETSIZE; + fdt->close_on_exec = &newf->close_on_exec_init; + fdt->open_fds = &newf->open_fds_init; + fdt->fd = &newf->fd_array[0]; + INIT_RCU_HEAD(&fdt->rcu); + fdt->free_files = NULL; + fdt->next = NULL; + rcu_assign_pointer(newf->fdt, fdt); + out: + return newf; + } + static int copy_files(unsigned long clone_flags, struct task_struct * tsk) { *************** *** 578,581 **** --- 613,617 ---- struct file **old_fds, **new_fds; int open_files, size, i, error = 0, expand; + struct fdtable *old_fdt, *new_fdt; /* *************** *** 598,618 **** tsk->files = NULL; error = -ENOMEM; ! newf = kmem_cache_alloc(files_cachep, SLAB_KERNEL); ! if (!newf) goto out; - atomic_set(&newf->count, 1); - - spin_lock_init(&newf->file_lock); - newf->next_fd = 0; - newf->max_fds = NR_OPEN_DEFAULT; - newf->max_fdset = __FD_SETSIZE; - newf->close_on_exec = &newf->close_on_exec_init; - newf->open_fds = &newf->open_fds_init; - newf->fd = &newf->fd_array[0]; - spin_lock(&oldf->file_lock); ! ! open_files = count_open_files(oldf, oldf->max_fdset); expand = 0; --- 634,646 ---- tsk->files = NULL; error = -ENOMEM; ! newf = alloc_files(); ! if (!newf) goto out; spin_lock(&oldf->file_lock); ! old_fdt = files_fdtable(oldf); ! new_fdt = files_fdtable(newf); ! size = old_fdt->max_fdset; ! open_files = count_open_files(old_fdt); expand = 0; *************** *** 621,630 **** * Note: we're not a clone task, so the open count won't change. */ ! if (open_files > newf->max_fdset) { ! newf->max_fdset = 0; expand = 1; } ! if (open_files > newf->max_fds) { ! newf->max_fds = 0; expand = 1; } --- 649,658 ---- * Note: we're not a clone task, so the open count won't change. */ ! if (open_files > new_fdt->max_fdset) { ! new_fdt->max_fdset = 0; expand = 1; } ! if (open_files > new_fdt->max_fds) { ! new_fdt->max_fds = 0; expand = 1; } *************** *** 638,649 **** if (error < 0) goto out_release; spin_lock(&oldf->file_lock); } ! old_fds = oldf->fd; ! new_fds = newf->fd; ! memcpy(newf->open_fds->fds_bits, oldf->open_fds->fds_bits, open_files/8); ! memcpy(newf->close_on_exec->fds_bits, oldf->close_on_exec->fds_bits, open_files/8); for (i = open_files; i != 0; i--) { --- 666,684 ---- if (error < 0) goto out_release; + new_fdt = files_fdtable(newf); + /* + * Reacquire the oldf lock and a pointer to its fd table + * who knows it may have a new bigger fd table. We need + * the latest pointer. + */ spin_lock(&oldf->file_lock); + old_fdt = files_fdtable(oldf); } ! old_fds = old_fdt->fd; ! new_fds = new_fdt->fd; ! memcpy(new_fdt->open_fds->fds_bits, old_fdt->open_fds->fds_bits, open_files/8); ! memcpy(new_fdt->close_on_exec->fds_bits, old_fdt->close_on_exec->fds_bits, open_files/8); for (i = open_files; i != 0; i--) { *************** *** 658,679 **** * fd is available to the new process. */ ! FD_CLR(open_files - i, newf->open_fds); } ! *new_fds++ = f; } spin_unlock(&oldf->file_lock); /* compute the remainder to be cleared */ ! size = (newf->max_fds - open_files) * sizeof(struct file *); /* This is long word aligned thus could use a optimized version */ memset(new_fds, 0, size); ! if (newf->max_fdset > open_files) { ! int left = (newf->max_fdset-open_files)/8; int start = open_files / (8 * sizeof(unsigned long)); ! memset(&newf->open_fds->fds_bits[start], 0, left); ! memset(&newf->close_on_exec->fds_bits[start], 0, left); } --- 693,714 ---- * fd is available to the new process. */ ! FD_CLR(open_files - i, new_fdt->open_fds); } ! rcu_assign_pointer(*new_fds++, f); } spin_unlock(&oldf->file_lock); /* compute the remainder to be cleared */ ! size = (new_fdt->max_fds - open_files) * sizeof(struct file *); /* This is long word aligned thus could use a optimized version */ memset(new_fds, 0, size); ! if (new_fdt->max_fdset > open_files) { ! int left = (new_fdt->max_fdset-open_files)/8; int start = open_files / (8 * sizeof(unsigned long)); ! memset(&new_fdt->open_fds->fds_bits[start], 0, left); ! memset(&new_fdt->close_on_exec->fds_bits[start], 0, left); } *************** *** 684,690 **** out_release: ! free_fdset (newf->close_on_exec, newf->max_fdset); ! free_fdset (newf->open_fds, newf->max_fdset); ! free_fd_array(newf->fd, newf->max_fds); kmem_cache_free(files_cachep, newf); goto out; --- 719,725 ---- out_release: ! free_fdset (new_fdt->close_on_exec, new_fdt->max_fdset); ! free_fdset (new_fdt->open_fds, new_fdt->max_fdset); ! free_fd_array(new_fdt->fd, new_fdt->max_fds); kmem_cache_free(files_cachep, newf); goto out; *************** *** 814,818 **** unsigned long new_flags = p->flags; ! new_flags &= ~PF_SUPERPRIV; new_flags |= PF_FORKNOEXEC; if (!(clone_flags & CLONE_PTRACE)) --- 849,853 ---- unsigned long new_flags = p->flags; ! new_flags &= ~(PF_SUPERPRIV | PF_NOFREEZE); new_flags |= PF_FORKNOEXEC; if (!(clone_flags & CLONE_PTRACE)) *************** *** 990,993 **** --- 1025,1031 ---- */ clear_tsk_thread_flag(p, TIF_SYSCALL_TRACE); + #ifdef TIF_SYSCALL_EMU + clear_tsk_thread_flag(p, TIF_SYSCALL_EMU); + #endif /* Our parent execution domain becomes current domain *************** *** 1001,1007 **** p->exit_state = 0; - /* Perform scheduler related setup */ - sched_fork(p); - /* * Ok, make it visible to the rest of the system. --- 1039,1042 ---- *************** *** 1012,1027 **** INIT_LIST_HEAD(&p->ptrace_list); /* Need tasklist lock for parent etc handling! */ write_lock_irq(&tasklist_lock); /* ! * The task hasn't been attached yet, so cpus_allowed mask cannot ! * have changed. The cpus_allowed mask of the parent may have ! * changed after it was copied first time, and it may then move to ! * another CPU - so we re-copy it here and set the child's CPU to ! * the parent's CPU. This avoids alot of nasty races. */ p->cpus_allowed = current->cpus_allowed; ! set_task_cpu(p, smp_processor_id()); /* --- 1047,1069 ---- INIT_LIST_HEAD(&p->ptrace_list); + /* Perform scheduler related setup. Assign this task to a CPU. */ + sched_fork(p, clone_flags); + /* Need tasklist lock for parent etc handling! */ write_lock_irq(&tasklist_lock); /* ! * The task hasn't been attached yet, so its cpus_allowed mask will ! * not be changed, nor will its assigned CPU. ! * ! * The cpus_allowed mask of the parent may have changed after it was ! * copied first time - so re-copy it here, then check the child's CPU ! * to ensure it is on a valid CPU (and if not, just force it back to ! * parent's CPU). This avoids alot of nasty races. */ p->cpus_allowed = current->cpus_allowed; ! if (unlikely(!cpu_isset(task_cpu(p), p->cpus_allowed) || ! !cpu_online(task_cpu(p)))) ! set_task_cpu(p, smp_processor_id()); /* *************** *** 1085,1088 **** --- 1127,1135 ---- } + /* + * inherit ioprio + */ + p->ioprio = current->ioprio; + SET_LINKS(p); if (unlikely(p->ptrace & PT_PTRACED)) *************** *** 1100,1103 **** --- 1147,1153 ---- } + if (!current->signal->tty && p->signal->tty) + p->signal->tty = NULL; + nr_threads++; total_forks++; Index: syscall_ksyms.c =================================================================== RCS file: /cvsroot/linux-abi/linux-abi/linux-26/kernel/syscall_ksyms.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** syscall_ksyms.c 24 Jan 2006 00:28:19 -0000 1.2 --- syscall_ksyms.c 24 Jan 2006 04:40:18 -0000 1.3 *************** *** 4,13 **** */ - #include <linux/config.h> - #include <linux/module.h> - #include <linux/personality.h> #define __KERNEL_SYSCALLS__ #include <linux/unistd.h> #include <linux/syscalls.h> #include <linux/msg.h> #include <linux/sem.h> --- 4,14 ---- */ #define __KERNEL_SYSCALLS__ #include <linux/unistd.h> #include <linux/syscalls.h> + + #include <linux/config.h> + #include <linux/module.h> + #include <linux/personality.h> #include <linux/msg.h> #include <linux/sem.h> *************** *** 15,34 **** #include <linux/fs.h> - - asmlinkage long sys_rt_sigaction(int sig, - const struct sigaction __user *act, - struct sigaction __user *oact, - size_t sigsetsize); - extern asmlinkage long sys_sigaltstack(const stack_t *uss, stack_t *uoss); - extern asmlinkage int sys_sigsuspend(int history0, int history1, - old_sigset_t mask); - - - - - - - - EXPORT_SYMBOL(sys_uselib); EXPORT_SYMBOL(sys_sync); --- 16,19 ---- |