Commit 1ce6ec91 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'akpm' (fixes from Andrew)

Pull misc fixes from Andrew Morton:
 "Ten fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  kernel/signal.c: stop info leak via the tkill and the tgkill syscalls
  mm/vmscan: fix error return in kswapd_run()
  hfsplus: fix potential overflow in hfsplus_file_truncate()
  avr32: fix build error in atstk1006_defconfig
  hugetlbfs: add swap entry check in follow_hugetlb_page()
  fs/binfmt_elf.c: fix hugetlb memory check in vma_dump_size()
  hugetlbfs: stop setting VM_DONTDUMP in initializing vma(VM_HUGETLB)
  checkpatch: fix stringification macro defect
  drivers/video/mmp/core.c: fix use-after-free bug
  thinkpad-acpi: kill hotkey_thread_mutex
parents 96d86834 b9e146d8
...@@ -165,6 +165,10 @@ BUILDIO_IOPORT(l, u32) ...@@ -165,6 +165,10 @@ BUILDIO_IOPORT(l, u32)
#define readw_be __raw_readw #define readw_be __raw_readw
#define readl_be __raw_readl #define readl_be __raw_readl
#define writeb_relaxed writeb
#define writew_relaxed writew
#define writel_relaxed writel
#define writeb_be __raw_writeb #define writeb_be __raw_writeb
#define writew_be __raw_writew #define writew_be __raw_writew
#define writel_be __raw_writel #define writel_be __raw_writel
......
...@@ -1964,9 +1964,6 @@ struct tp_nvram_state { ...@@ -1964,9 +1964,6 @@ struct tp_nvram_state {
/* kthread for the hotkey poller */ /* kthread for the hotkey poller */
static struct task_struct *tpacpi_hotkey_task; static struct task_struct *tpacpi_hotkey_task;
/* Acquired while the poller kthread is running, use to sync start/stop */
static struct mutex hotkey_thread_mutex;
/* /*
* Acquire mutex to write poller control variables as an * Acquire mutex to write poller control variables as an
* atomic block. * atomic block.
...@@ -2462,8 +2459,6 @@ static int hotkey_kthread(void *data) ...@@ -2462,8 +2459,6 @@ static int hotkey_kthread(void *data)
unsigned int poll_freq; unsigned int poll_freq;
bool was_frozen; bool was_frozen;
mutex_lock(&hotkey_thread_mutex);
if (tpacpi_lifecycle == TPACPI_LIFE_EXITING) if (tpacpi_lifecycle == TPACPI_LIFE_EXITING)
goto exit; goto exit;
...@@ -2523,7 +2518,6 @@ static int hotkey_kthread(void *data) ...@@ -2523,7 +2518,6 @@ static int hotkey_kthread(void *data)
} }
exit: exit:
mutex_unlock(&hotkey_thread_mutex);
return 0; return 0;
} }
...@@ -2533,9 +2527,6 @@ static void hotkey_poll_stop_sync(void) ...@@ -2533,9 +2527,6 @@ static void hotkey_poll_stop_sync(void)
if (tpacpi_hotkey_task) { if (tpacpi_hotkey_task) {
kthread_stop(tpacpi_hotkey_task); kthread_stop(tpacpi_hotkey_task);
tpacpi_hotkey_task = NULL; tpacpi_hotkey_task = NULL;
mutex_lock(&hotkey_thread_mutex);
/* at this point, the thread did exit */
mutex_unlock(&hotkey_thread_mutex);
} }
} }
...@@ -3234,7 +3225,6 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) ...@@ -3234,7 +3225,6 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
mutex_init(&hotkey_mutex); mutex_init(&hotkey_mutex);
#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
mutex_init(&hotkey_thread_mutex);
mutex_init(&hotkey_thread_data_mutex); mutex_init(&hotkey_thread_data_mutex);
#endif #endif
......
...@@ -252,7 +252,5 @@ void mmp_unregister_path(struct mmp_path *path) ...@@ -252,7 +252,5 @@ void mmp_unregister_path(struct mmp_path *path)
kfree(path); kfree(path);
mutex_unlock(&disp_lock); mutex_unlock(&disp_lock);
dev_info(path->dev, "de-register %s\n", path->name);
} }
EXPORT_SYMBOL_GPL(mmp_unregister_path); EXPORT_SYMBOL_GPL(mmp_unregister_path);
...@@ -1137,6 +1137,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma, ...@@ -1137,6 +1137,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
goto whole; goto whole;
if (!(vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_PRIVATE)) if (!(vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_PRIVATE))
goto whole; goto whole;
return 0;
} }
/* Do not dump I/O mapped devices or special mappings */ /* Do not dump I/O mapped devices or special mappings */
......
...@@ -533,7 +533,7 @@ void hfsplus_file_truncate(struct inode *inode) ...@@ -533,7 +533,7 @@ void hfsplus_file_truncate(struct inode *inode)
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
struct page *page; struct page *page;
void *fsdata; void *fsdata;
u32 size = inode->i_size; loff_t size = inode->i_size;
res = pagecache_write_begin(NULL, mapping, size, 0, res = pagecache_write_begin(NULL, mapping, size, 0,
AOP_FLAG_UNINTERRUPTIBLE, AOP_FLAG_UNINTERRUPTIBLE,
......
...@@ -110,7 +110,7 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -110,7 +110,7 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
* way when do_mmap_pgoff unwinds (may be important on powerpc * way when do_mmap_pgoff unwinds (may be important on powerpc
* and ia64). * and ia64).
*/ */
vma->vm_flags |= VM_HUGETLB | VM_DONTEXPAND | VM_DONTDUMP; vma->vm_flags |= VM_HUGETLB | VM_DONTEXPAND;
vma->vm_ops = &hugetlb_vm_ops; vma->vm_ops = &hugetlb_vm_ops;
if (vma->vm_pgoff & (~huge_page_mask(h) >> PAGE_SHIFT)) if (vma->vm_pgoff & (~huge_page_mask(h) >> PAGE_SHIFT))
......
...@@ -2948,7 +2948,7 @@ do_send_specific(pid_t tgid, pid_t pid, int sig, struct siginfo *info) ...@@ -2948,7 +2948,7 @@ do_send_specific(pid_t tgid, pid_t pid, int sig, struct siginfo *info)
static int do_tkill(pid_t tgid, pid_t pid, int sig) static int do_tkill(pid_t tgid, pid_t pid, int sig)
{ {
struct siginfo info; struct siginfo info = {};
info.si_signo = sig; info.si_signo = sig;
info.si_errno = 0; info.si_errno = 0;
......
...@@ -2961,7 +2961,17 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -2961,7 +2961,17 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
break; break;
} }
if (absent || /*
* We need call hugetlb_fault for both hugepages under migration
* (in which case hugetlb_fault waits for the migration,) and
* hwpoisoned hugepages (in which case we need to prevent the
* caller from accessing to them.) In order to do this, we use
* here is_swap_pte instead of is_hugetlb_entry_migration and
* is_hugetlb_entry_hwpoisoned. This is because it simply covers
* both cases, and because we can't follow correct pages
* directly from any kind of swap entries.
*/
if (absent || is_swap_pte(huge_ptep_get(pte)) ||
((flags & FOLL_WRITE) && !pte_write(huge_ptep_get(pte)))) { ((flags & FOLL_WRITE) && !pte_write(huge_ptep_get(pte)))) {
int ret; int ret;
......
...@@ -3188,9 +3188,9 @@ int kswapd_run(int nid) ...@@ -3188,9 +3188,9 @@ int kswapd_run(int nid)
if (IS_ERR(pgdat->kswapd)) { if (IS_ERR(pgdat->kswapd)) {
/* failure at boot is fatal */ /* failure at boot is fatal */
BUG_ON(system_state == SYSTEM_BOOTING); BUG_ON(system_state == SYSTEM_BOOTING);
pgdat->kswapd = NULL;
pr_err("Failed to start kswapd on node %d\n", nid); pr_err("Failed to start kswapd on node %d\n", nid);
ret = PTR_ERR(pgdat->kswapd); ret = PTR_ERR(pgdat->kswapd);
pgdat->kswapd = NULL;
} }
return ret; return ret;
} }
......
...@@ -3016,6 +3016,7 @@ sub process { ...@@ -3016,6 +3016,7 @@ sub process {
$dstat !~ /^'X'$/ && # character constants $dstat !~ /^'X'$/ && # character constants
$dstat !~ /$exceptions/ && $dstat !~ /$exceptions/ &&
$dstat !~ /^\.$Ident\s*=/ && # .foo = $dstat !~ /^\.$Ident\s*=/ && # .foo =
$dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo
$dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...) $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...)
$dstat !~ /^for\s*$Constant$/ && # for (...) $dstat !~ /^for\s*$Constant$/ && # for (...)
$dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ && # for (...) bar() $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ && # for (...) bar()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment