- 20 Jul, 2004 1 commit
-
-
Patrick Mochel authored
into digitalimplant.org:/home/mochel/src/linux-2.6-power
-
- 18 Jul, 2004 2 commits
-
-
Ingo Molnar authored
This cleans up legacy x86 binary support by introducing a new personality bit: READ_IMPLIES_EXEC, and implements Linus' suggestion to add the PROT_EXEC bit on the two affected syscall entry places, sys_mprotect() and sys_mmap(). If this bit is set then PROT_READ will also add the PROT_EXEC bit - as expected by legacy x86 binaries. The ELF loader will automatically set this bit when it encounters a legacy binary. This approach avoids the problems the previous ->def_flags solution caused. In particular this patch fixes the PROT_NONE problem in a cleaner way (http://lkml.org/lkml/2004/7/12/227), and it should fix the ia64 PROT_EXEC problem reported by David Mosberger. Also, mprotect(PROT_READ) done by legacy binaries will do the right thing as well. the details: - the personality bit is added to the personality mask upon exec(), within the ELF loader, but is not cleared (see the exceptions below). This means that if an environment that already has the bit exec()s a new-style binary it will still get the old behavior. - one exception are setuid/setgid binaries: these will reset the bit - thus local attackers cannot manually set the bit and circumvent NX protection. Legacy setuid binaries will still get the bit through the ELF loader. This gives us maximum flexibility in shaping compatibility environments. - selinux also clears the bit when switching SIDs via exec(). - x86 is the only arch making use of READ_IMPLIES_EXEC currently. Other arches will have the pre-NX-patch protection setup they always had. I have booted an old distro [RH 7.2] and two new PT_GNU_STACK distros [SuSE 9.2 and FC2] on an NX-capable CPU - they work just fine and all the mapping details are right. I've checked the PROT_NONE test-utility as well and it works as expected. I have checked various setuid scenarios as well involving legacy and new-style binaries. an improved setarch utility can be used to set the personality bit manually: http://redhat.com/~mingo/nx-patches/setarch-1.4-3.tar.gz the new '-X' flag does it, e.g.: ./setarch -X linux /bin/cat /proc/self/maps will trigger the old protection layout even on a new distro. Signed-off-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
David Eger authored
I've tracked down the core issue giving me the oops wrt pmac_zilog. When you have two serial drivers, (e.g. 8250 and PMAC_ZILOG) they both say "I want to reserve X ports starting with major TTY_MAJOR and minor 64". By the time pmac_zilog gets there, the ports it requests are already reserved. Unfortunately, init_pmz() doesn't check for pmz_register() failure, and so it merrily goes on to register the half-initialized pmac_zilog driver with the power management subsystem. This path provides a proper failure path. Also: Restore ppc configs now that I know people use AT Keyboards on CHRP and PReP machines, and the zilog driver is no longer Oops'ing. Signed-off-by:
David Eger <eger@havoc.gtf.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
- 17 Jul, 2004 29 commits
-
-
Linus Torvalds authored
Ready for the kernel summit in Ottawa...
-
Linus Torvalds authored
This also fixes it for when the real parent is ignoring SIGCHLD - noted by David Mosberger.
-
Andi Kleen authored
For some reason I booted a NUMA and SLAB_DEBUG i386 kernel on a non NUMA 512MB machine. This caused an oops at bootup in change_page_attr. The reason was that highmem_start_start page ended up zero and that triggered the highmem check in change_page_attr when the slab debug code would unmap a kernel mapping. Fix is straightforward: if there is no highmem set highmem_start_page to max_low_pfn+1
-
Andi Kleen authored
This fixes a long standing corruption bug in the x86-64 code. The SMP trampoline would corrupt page 2, which was sometimes used for other data. This corrupted the ioport/iomem list in some cases and causes oopses while read /proc/iomem. Fix is to check the correct location and don't zero it afterwards because it gets reinitialized for the next CPU anyways. Thanks to Alexander Nyberg for tracking it down.
-
Patrick Mochel authored
-
Patrick Mochel authored
- Add {enable,disable}_nonboot_cpus() to prepare() and finish() in kernel/power/disk.c - Move swsusp __setup options there. Remove resume_status variable in favor of simpler 'noresume' variable, and check it in pm_resume(). - Remove software_resume() from swsusp; rename pm_resume() to software_resume(). The latter is considerably cleaner, and leverages the core code. - Move software_suspend() to kernel/power/main.c and shrink it down a wrapper that takes pm_sem and calls pm_suspend_disk(), which does the same as the old software_suspend() did. This keeps the same entry points (via ACPI sleep and the reboot() syscall), but actually allows those to use the low-level power states of the system rather than always shutting off the system. - Remove now-unused functions from swsusp.
-
Patrick Mochel authored
-
Patrick Mochel authored
- Remove kernel/power/pmdisk.c. - Remove CONFIG_PM_STD config option. - Fix up Makefile.
-
Patrick Mochel authored
- Remove from pmdisk. - Remove pmdisk= command line option.
-
Patrick Mochel authored
- Change name of free_suspend_pagedir() to swsusp_free(). - Call from kernel/power/disk.c
-
Patrick Mochel authored
- Merge suspend_save_image() from both into one. - Rename to swsusp_write(). - Remove pmdisk_write(). - Fixup call in kernel/power/disk.c and software_suspend(). - Mark lock_swapdevices() static again.
-
Patrick Mochel authored
- Merge pmdisk_read() and __read_suspend_image() and rename to swsusp_read() - Fix up call in kernel/power/disk.c to call new name. - Remove extra error checking from software_resume().
-
Patrick Mochel authored
This embodies the core of the swsusp->pmdisk cleanups. Instead of using the ->dummy variable at the end of each pagedir for a linked list of the page dirs, this uses a static array, which is kept in the empty space of the swsusp header. There are 768 entries, and could be scaled up based on the size of the page and the amount of room remaining. 768 should be enough anyway, since each entry is a swp_entry_t to a page-length array of pages. With larger systems and more memory come larger pages, so each page-sized array will automatically scale up. This replaces the read_suspend_image() and write_suspend_image() in swsusp with the much more concise pmdisk versions (not that big of change at this point) and fixes up the callers so software_resume() gets it right. Also, mark the helpers only used in swsusp as static again.
-
Patrick Mochel authored
- Move struct pmdisk_header definition to swsusp and change name to struct swsusp_header. - Statically allocate one (swsusp_header), and use it during mark_swapfiles() and when checking sig on resume. - Move check_sig() from pmdisk to swsusp. - Wrap with swsusp_verify(), and move check_header() there. - Fix up calls in pmdisk and swsusp. - Make new wrapper swsusp_close_swap() and call from write_suspend_image(). - Look for swsusp_info info in swsusp_header.swsusp_info, instead of magic location at end of struct.
-
Patrick Mochel authored
- The bio code already does this for us..
-
Patrick Mochel authored
- Move definition of struct pmdsik_info to power.h and rename to struct swsusp_info. - Kill struct suspend_header. - Move helpers from pmdisk into swsusp: init_header(), dump_info(), write_header(), sanity_check(), check_header(). - Fix up calls in pmdisk to call the right ones. - Clean up swsusp code to use helpers; delete duplicates.
-
Patrick Mochel authored
- Create swsusp_data_read() and call from read_suspend_image() in both swsusp and pmdisk. - Mark swsusp_pagedir_relocate() as static again.
-
Patrick Mochel authored
- Move bio helpers to swsusp. - Convert swsusp to use them, rathen buffer_heads. - Expose and fix up calls in pmdisk. - Clean up swsusp::read_suspend_image() a bit.
-
Patrick Mochel authored
-
Patrick Mochel authored
-
Patrick Mochel authored
- Split do_magic into swsusp_arch_suspend() and swsusp_arch_resume(). - Clean up based on pmdisk implementation - Only save registers we need to. - Use rep;movsl for copying, rather than doing each byte. - Create swsusp_suspend and swsusp_resume wrappers for calling the assmebly routines that: - Call {save,restore}_processor_state() in each. - Disable/enable interrupts in each. - Call swsusp_{suspend,restore} in software_{suspend,resume} - Kill all the do_magic_* functions. - Remove prototypes from linux/suspend.h - Remove similar pmdisk functions. - Update calls in kernel/power/disk.c to use swsusp versions.
-
Patrick Mochel authored
- Move call out of assembly-callbacks and into software_suspend() after do_magic() returns.
-
Patrick Mochel authored
- Split count_and_copy_data_pages() into count_data_pages() and copy_data_pages(). - Move helper saveable() from pmdisk to swsusp, and update to work with page zones. - Get rid of uneeded defines in pmdisk.
-
Patrick Mochel authored
- Move helpers calc_order(), alloc_pagedir(), alloc_image_pages(), enough_free_mem(), and enough_swap() into swsusp. - Wrap them all with a new function - swsusp_alloc(). - Fix up pmdisk to just call that. - Fix up suspend_prepare_image() to call that, instead of doing it inline.
-
Patrick Mochel authored
- Introduce helpers to swsusp - swsusp_write_page(), swsusp_data_write() and swsusp_data_free(). - Delete duplicate copies from pmdisk and fixup names in calls. - Clean up write_suspend_image() in swsusp and use the helpers.
-
Patrick Mochel authored
- In pmdisk, change pm_pagedir_nosave back to pagedir_nosave, and pmdisk_pages back to nr_copy_pages. - Mark them, and other page count/pagedir variables extern. - Make sure they're not static in swsusp. - Remove mention from include/linux/suspend.h, since no one else needs them.
-
Patrick Mochel authored
- Use read_swapfiles() in swsusp and rename to swsusp_swap_check(). - Use lock_swapdevices() in swsusp and rename to swsusp_swap_lock().
-
Patrick Mochel authored
- Expose and use version in swsusp.
-
Patrick Mochel authored
-
- 16 Jul, 2004 8 commits
-
-
Miklos Szeredi authored
This patch fixes a hard-to-trigger condition, where the inode is on the inode_in_use list while it's state is dirty. In this state dirty pages are not written back in sync() or from kupdate, only from direct page reclaim. And this causes a livelock in balance_dirty_pages after a while. The actual sequence of events required to get into this state is: thread function inode state inode list ---------------------------------------------------------------------------- 1 __sync_single_inode (background) I_DIRTY sb->s_io 1 do_writepages ... I_LOCKED 2 __writeback_single_inode (sync) sleeps I_LOCKED 1 __sync_single_inode (background) finish 0 inode_in_use 2 __writeback_single_inode (sync) wakeup 0 2 __sync_single_inode (sync) 0 2 do_writepages ... I_LOCKED 3 __mark_inode_dirty I_LOCKED | I_DIRTY 2 __sync_single_inode (sync) finish I_DIRTY left on inode_in_use Signed-off-by:
Miklos Szeredi <miklos@szeredi.hu> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
Pat Gefre authored
Patch for our console driver. We converted the driver to use the serial core functions. Also some changes to use sysfs/udev and a new major number. Cc: Jesse Barnes <jbarnes@engr.sgi.com> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-
Alexander Viro authored
-
Alexander Viro authored
-
Alexander Viro authored
-
Alexander Viro authored
partially annotated, fixed dereferencing of userland pointer (trivial, since we'd just copied the entire structure).
-
Alexander Viro authored
-
Linus Torvalds authored
-