Merge branch 'akpm' (patches from Andrew)
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 11 Oct 2020 18:18:04 +0000 (11:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 11 Oct 2020 18:18:04 +0000 (11:18 -0700)
Merge misc fixes from Andrew Morton:
 "Five fixes.

  Subsystems affected by this patch series: MAINTAINERS, mm/pagemap,
  mm/swap, and mm/hugetlb"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  mm: khugepaged: recalculate min_free_kbytes after memory hotplug as expected by khugepaged
  mm: validate inode in mapping_set_error()
  mm: mmap: Fix general protection fault in unlink_file_vma()
  MAINTAINERS: Antoine Tenart's email address
  MAINTAINERS: change hardening mailing list

Documentation/x86/boot.rst
arch/x86/kernel/cpu/mce/core.c
fs/pipe.c
include/linux/watch_queue.h
kernel/events/core.c

index 7fafc7ac00d7f5d90ae574bde56b900865c55d9f..abb9fc164657a7caa98effa0a6ba4b0b8ebd764b 100644 (file)
@@ -1342,8 +1342,8 @@ follow::
 
 In addition to read/modify/write the setup header of the struct
 boot_params as that of 16-bit boot protocol, the boot loader should
-also fill the additional fields of the struct boot_params as that
-described in zero-page.txt.
+also fill the additional fields of the struct boot_params as
+described in chapter :doc:`zero-page`.
 
 After setting up the struct boot_params, the boot loader can load the
 32/64-bit kernel in the same way as that of 16-bit boot protocol.
@@ -1379,7 +1379,7 @@ can be calculated as follows::
 In addition to read/modify/write the setup header of the struct
 boot_params as that of 16-bit boot protocol, the boot loader should
 also fill the additional fields of the struct boot_params as described
-in zero-page.txt.
+in chapter :doc:`zero-page`.
 
 After setting up the struct boot_params, the boot loader can load
 64-bit kernel in the same way as that of 16-bit boot protocol, but
index f43a78bde670b844e79696db23dbe87dc5add3f3..fc4f8c04bdb5616e718dd30130e77a565af8db08 100644 (file)
@@ -1904,6 +1904,8 @@ void (*machine_check_vector)(struct pt_regs *) = unexpected_machine_check;
 
 static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
 {
+       bool irq_state;
+
        WARN_ON_ONCE(user_mode(regs));
 
        /*
@@ -1914,7 +1916,7 @@ static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
            mce_check_crashing_cpu())
                return;
 
-       nmi_enter();
+       irq_state = idtentry_enter_nmi(regs);
        /*
         * The call targets are marked noinstr, but objtool can't figure
         * that out because it's an indirect call. Annotate it.
@@ -1925,7 +1927,7 @@ static __always_inline void exc_machine_check_kernel(struct pt_regs *regs)
        if (regs->flags & X86_EFLAGS_IF)
                trace_hardirqs_on_prepare();
        instrumentation_end();
-       nmi_exit();
+       idtentry_exit_nmi(regs, irq_state);
 }
 
 static __always_inline void exc_machine_check_user(struct pt_regs *regs)
index 117db82b10af515bbbfbbac4c9a88b0d88669e91..0ac197658a2d6e4c1ae4123f8f83eca875ea8dd7 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -894,19 +894,18 @@ int create_pipe_files(struct file **res, int flags)
 {
        struct inode *inode = get_pipe_inode();
        struct file *f;
+       int error;
 
        if (!inode)
                return -ENFILE;
 
        if (flags & O_NOTIFICATION_PIPE) {
-#ifdef CONFIG_WATCH_QUEUE
-               if (watch_queue_init(inode->i_pipe) < 0) {
+               error = watch_queue_init(inode->i_pipe);
+               if (error) {
+                       free_pipe_info(inode->i_pipe);
                        iput(inode);
-                       return -ENOMEM;
+                       return error;
                }
-#else
-               return -ENOPKG;
-#endif
        }
 
        f = alloc_file_pseudo(inode, pipe_mnt, "",
index 5e08db2adc31994c6e26264ccd67cd92ae686ff9..c994d1b2cdbaa2abb313170749d0ee396a807a90 100644 (file)
@@ -122,6 +122,12 @@ static inline void remove_watch_list(struct watch_list *wlist, u64 id)
  */
 #define watch_sizeof(STRUCT) (sizeof(STRUCT) << WATCH_INFO_LENGTH__SHIFT)
 
+#else
+static inline int watch_queue_init(struct pipe_inode_info *pipe)
+{
+       return -ENOPKG;
+}
+
 #endif
 
 #endif /* _LINUX_WATCH_QUEUE_H */
index 7ed5248f0445eadeaac5711a25523978b47aae7e..e8bf92202542b4189f67ed7f8e5e56b2bcb7bb86 100644 (file)
@@ -99,7 +99,7 @@ static void remote_function(void *data)
  * retry due to any failures in smp_call_function_single(), such as if the
  * task_cpu() goes offline concurrently.
  *
- * returns @func return value or -ESRCH when the process isn't running
+ * returns @func return value or -ESRCH or -ENXIO when the process isn't running
  */
 static int
 task_function_call(struct task_struct *p, remote_function_f func, void *info)
@@ -115,7 +115,8 @@ task_function_call(struct task_struct *p, remote_function_f func, void *info)
        for (;;) {
                ret = smp_call_function_single(task_cpu(p), remote_function,
                                               &data, 1);
-               ret = !ret ? data.ret : -EAGAIN;
+               if (!ret)
+                       ret = data.ret;
 
                if (ret != -EAGAIN)
                        break;