Re: mmotm 2020-06-25-20-36 uploaded (objtool warning)

2020-06-30 Thread Randy Dunlap
On 6/30/20 2:59 AM, Peter Zijlstra wrote:
> On Fri, Jun 26, 2020 at 04:35:08PM -0700, Randy Dunlap wrote:
>> arch/x86/kernel/sys_ia32.o: warning: objtool: cp_stat64()+0x57: call to 
>> new_encode_dev() with UACCESS enabled
> 
> That's c120f3b81ede ("x86: switch cp_stat64() to unsafe_put_user()").
> 
> Where __put_user() made sure evaluate 'x' before doing
> __uaccess_begin(), the new code has no such choice.
> 
> The simplest fix is probably something like this.
> 

Acked-by: Randy Dunlap  # build-tested

Thanks.

> ---
>  include/linux/kdev_t.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h
> index 85b5151911cf..a840ffef7c19 100644
> --- a/include/linux/kdev_t.h
> +++ b/include/linux/kdev_t.h
> @@ -36,7 +36,7 @@ static inline dev_t old_decode_dev(u16 val)
>   return MKDEV((val >> 8) & 255, val & 255);
>  }
>  
> -static inline u32 new_encode_dev(dev_t dev)
> +static __always_inline u32 new_encode_dev(dev_t dev)
>  {
>   unsigned major = MAJOR(dev);
>   unsigned minor = MINOR(dev);
> @@ -50,7 +50,7 @@ static inline dev_t new_decode_dev(u32 dev)
>   return MKDEV(major, minor);
>  }
>  
> -static inline u64 huge_encode_dev(dev_t dev)
> +static __always_inline u64 huge_encode_dev(dev_t dev)
>  {
>   return new_encode_dev(dev);
>  }
> 


-- 
~Randy



Re: mmotm 2020-06-25-20-36 uploaded (objtool warning)

2020-06-30 Thread Peter Zijlstra
On Fri, Jun 26, 2020 at 04:35:08PM -0700, Randy Dunlap wrote:
> arch/x86/kernel/sys_ia32.o: warning: objtool: cp_stat64()+0x57: call to 
> new_encode_dev() with UACCESS enabled

That's c120f3b81ede ("x86: switch cp_stat64() to unsafe_put_user()").

Where __put_user() made sure evaluate 'x' before doing
__uaccess_begin(), the new code has no such choice.

The simplest fix is probably something like this.

---
 include/linux/kdev_t.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h
index 85b5151911cf..a840ffef7c19 100644
--- a/include/linux/kdev_t.h
+++ b/include/linux/kdev_t.h
@@ -36,7 +36,7 @@ static inline dev_t old_decode_dev(u16 val)
return MKDEV((val >> 8) & 255, val & 255);
 }
 
-static inline u32 new_encode_dev(dev_t dev)
+static __always_inline u32 new_encode_dev(dev_t dev)
 {
unsigned major = MAJOR(dev);
unsigned minor = MINOR(dev);
@@ -50,7 +50,7 @@ static inline dev_t new_decode_dev(u32 dev)
return MKDEV(major, minor);
 }
 
-static inline u64 huge_encode_dev(dev_t dev)
+static __always_inline u64 huge_encode_dev(dev_t dev)
 {
return new_encode_dev(dev);
 }


Re: mmotm 2020-06-25-20-36 uploaded (mm/memory-failure.c)

2020-06-26 Thread Andrew Morton
On Fri, 26 Jun 2020 15:09:08 -0700 Randy Dunlap  wrote:

> On 6/25/20 8:37 PM, a...@linux-foundation.org wrote:
> > The mm-of-the-moment snapshot 2020-06-25-20-36 has been uploaded to
> > 
> >http://www.ozlabs.org/~akpm/mmotm/
> > 
> > mmotm-readme.txt says
> > 
> > README for mm-of-the-moment:
> > 
> > http://www.ozlabs.org/~akpm/mmotm/
> > 
> > This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
> > more than once a week.
> > 
> > You will need quilt to apply these patches to the latest Linus release (5.x
> > or 5.x-rcY).  The series file is in broken-out.tar.gz and is duplicated in
> > http://ozlabs.org/~akpm/mmotm/series
> > 
> 
> when CONFIG_MIGRATION is not set/enabled:
> 
> ../mm/memory-failure.c: In function ‘new_page’:
> ../mm/memory-failure.c:1692:9: error: implicit declaration of function 
> ‘alloc_migration_target’; did you mean ‘alloc_migrate_target’? 
> [-Werror=implicit-function-declaration]
>   return alloc_migration_target(p, (unsigned long));
>  ^~
>  alloc_migrate_target
> ../mm/memory-failure.c:1692:9: warning: return makes pointer from integer 
> without a cast [-Wint-conversion]
>   return alloc_migration_target(p, (unsigned long));
>  ^~

Thanks.

Appears to be due to Joonsoo Kim's "mm/migrate: make a standard
migration target allocation function".



Re: mmotm 2020-06-25-20-36 uploaded (mm/memory-failure.c)

2020-06-26 Thread Randy Dunlap
On 6/25/20 8:37 PM, a...@linux-foundation.org wrote:
> The mm-of-the-moment snapshot 2020-06-25-20-36 has been uploaded to
> 
>http://www.ozlabs.org/~akpm/mmotm/
> 
> mmotm-readme.txt says
> 
> README for mm-of-the-moment:
> 
> http://www.ozlabs.org/~akpm/mmotm/
> 
> This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
> more than once a week.
> 
> You will need quilt to apply these patches to the latest Linus release (5.x
> or 5.x-rcY).  The series file is in broken-out.tar.gz and is duplicated in
> http://ozlabs.org/~akpm/mmotm/series
> 

when CONFIG_MIGRATION is not set/enabled:

../mm/memory-failure.c: In function ‘new_page’:
../mm/memory-failure.c:1692:9: error: implicit declaration of function 
‘alloc_migration_target’; did you mean ‘alloc_migrate_target’? 
[-Werror=implicit-function-declaration]
  return alloc_migration_target(p, (unsigned long));
 ^~
 alloc_migrate_target
../mm/memory-failure.c:1692:9: warning: return makes pointer from integer 
without a cast [-Wint-conversion]
  return alloc_migration_target(p, (unsigned long));
 ^~



-- 
~Randy
Reported-by: Randy Dunlap 


Re: mmotm 2020-06-25-20-36 uploaded (mm/slab.c)

2020-06-26 Thread Kees Cook
On Fri, Jun 26, 2020 at 09:28:36AM -0700, Randy Dunlap wrote:
> On 6/25/20 8:37 PM, a...@linux-foundation.org wrote:
> > The mm-of-the-moment snapshot 2020-06-25-20-36 has been uploaded to
> > 
> >http://www.ozlabs.org/~akpm/mmotm/
> > 
> > mmotm-readme.txt says
> > 
> > README for mm-of-the-moment:
> > 
> > http://www.ozlabs.org/~akpm/mmotm/
> > 
> > This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
> > more than once a week.
> 
> 
> when CONFIG_NUMA is not set/enabled:
> 
> ../mm/slab.c: In function ‘___cache_free’:
> ../mm/slab.c:3471:2: error: implicit declaration of function ‘__free_one’; 
> did you mean ‘__free_page’? [-Werror=implicit-function-declaration]
>   __free_one(ac, objp);
>   ^~

Eek! Thanks for catching that. I will send a fix patch.

-- 
Kees Cook


Re: mmotm 2020-06-25-20-36 uploaded (mm/slab.c)

2020-06-26 Thread Randy Dunlap
On 6/25/20 8:37 PM, a...@linux-foundation.org wrote:
> The mm-of-the-moment snapshot 2020-06-25-20-36 has been uploaded to
> 
>http://www.ozlabs.org/~akpm/mmotm/
> 
> mmotm-readme.txt says
> 
> README for mm-of-the-moment:
> 
> http://www.ozlabs.org/~akpm/mmotm/
> 
> This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
> more than once a week.


when CONFIG_NUMA is not set/enabled:

../mm/slab.c: In function ‘___cache_free’:
../mm/slab.c:3471:2: error: implicit declaration of function ‘__free_one’; did 
you mean ‘__free_page’? [-Werror=implicit-function-declaration]
  __free_one(ac, objp);
  ^~


-- 
~Randy
Reported-by: Randy Dunlap 


mmotm 2020-06-25-20-36 uploaded

2020-06-25 Thread akpm
The mm-of-the-moment snapshot 2020-06-25-20-36 has been uploaded to

   http://www.ozlabs.org/~akpm/mmotm/

mmotm-readme.txt says

README for mm-of-the-moment:

http://www.ozlabs.org/~akpm/mmotm/

This is a snapshot of my -mm patch queue.  Uploaded at random hopefully
more than once a week.

You will need quilt to apply these patches to the latest Linus release (5.x
or 5.x-rcY).  The series file is in broken-out.tar.gz and is duplicated in
http://ozlabs.org/~akpm/mmotm/series

The file broken-out.tar.gz contains two datestamp files: .DATE and
.DATE--mm-dd-hh-mm-ss.  Both contain the string -mm-dd-hh-mm-ss,
followed by the base kernel version against which this patch series is to
be applied.

This tree is partially included in linux-next.  To see which patches are
included in linux-next, consult the `series' file.  Only the patches
within the #NEXT_PATCHES_START/#NEXT_PATCHES_END markers are included in
linux-next.


A full copy of the full kernel tree with the linux-next and mmotm patches
already applied is available through git within an hour of the mmotm
release.  Individual mmotm releases are tagged.  The master branch always
points to the latest release, so it's constantly rebasing.

https://github.com/hnaz/linux-mm

The directory http://www.ozlabs.org/~akpm/mmots/ (mm-of-the-second)
contains daily snapshots of the -mm tree.  It is updated more frequently
than mmotm, and is untested.

A git copy of this tree is also available at

https://github.com/hnaz/linux-mm



This mmotm tree contains the following patches against 5.8-rc2:
(patches marked "*" will be included in linux-next)

  origin.patch
* openrisc-fix-boot-oops-when-debug_vm-is-enabled.patch
* mm-do_swap_page-fix-up-the-error-code-instantiation.patch
* mm-compaction-make-capture-control-handling-safe-wrt-interrupts.patch
* 
kexec-do-not-verify-the-signature-without-the-lockdown-or-mandatory-signature.patch
* ocfs2-avoid-inode-removed-while-nfsd-access-it.patch
* ocfs2-load-global_inode_alloc.patch
* ocfs2-fix-panic-on-nfs-server-over-ocfs2.patch
* ocfs2-fix-value-of-ocfs2_invalid_slot.patch
* lib-fix-test_hmmc-reference-after-free.patch
* linux-bitsh-fix-unsigned-less-than-zero-warnings.patch
* mm-slab-fix-sign-conversion-problem-in-memcg_uncharge_slab.patch
* mm-slab-use-memzero_explicit-in-kzfree.patch
* slub-cure-list_slab_objects-from-double-fix.patch
* mm-fix-swap-cache-node-allocation-mask.patch
* mm-memoryc-properly-pte_offset_map_lock-unlock-in-vm_insert_pages.patch
* mm-debug_vm_pgtable-fix-build-failure-with-powerpc-8xx.patch
* make-asm-generic-cacheflushh-more-standalone.patch
* media-omap3isp-remove-cacheflushh.patch
* mm-fix-a-warning-while-make-xmldocs.patch
* mm-memcontrol-handle-div0-crash-race-condition-in-memorylow.patch
* mm-memcontrol-fix-do-not-put-the-css-reference.patch
* mm-memcg-prevent-missed-memorylow-load-tears.patch
* docs-mm-gup-minor-documentation-update.patch
* doc-thp-cow-fault-no-longer-allocate-thp.patch
* mm-workingset-age-nonresident-information-alongside-anonymous-pages.patch
* 
mm-swap-fix-for-mm-workingset-age-nonresident-information-alongside-anonymous-pages.patch
* mm-memory-fix-io-cost-for-anonymous-page.patch
* x86-hyperv-allocate-the-hypercall-page-with-only-read-and-execute-bits.patch
* arm64-use-page_kernel_rox-directly-in-alloc_insn_page.patch
* mm-remove-vmalloc_exec.patch
* mm-fix-false-softlockup-during-pfn-range-removal.patch
* maintainers-update-info-for-sparse.patch
* mm-shuffle-dont-move-pages-between-zones-and-dont-read-garbage-memmaps.patch
* mm-page_alloc-fix-documentation-error.patch
* proc-kpageflags-prevent-an-integer-overflow-in-stable_page_flags.patch
* proc-kpageflags-do-not-use-uninitialized-struct-pages.patch
* checkpatch-test-git_dir-changes.patch
* scripts-tagssh-collect-compiled-source-precisely.patch
* bloat-o-meter-support-comparing-library-archives.patch
* scripts-decode_stacktrace-skip-missing-symbols.patch
* scripts-decode_stacktrace-guess-basepath-if-not-specified.patch
* scripts-decode_stacktrace-guess-path-to-modules.patch
* scripts-decode_stacktrace-guess-path-to-vmlinux-by-release-name.patch
* ocfs2-clear-links-count-in-ocfs2_mknod-if-an-error-occurs.patch
* ocfs2-fix-ocfs2-corrupt-when-iputting-an-inode.patch
* ramfs-support-o_tmpfile.patch
* kernel-watchdog-flush-all-printk-nmi-buffers-when-hardlockup-detected.patch
  mm.patch
* mm-treewide-rename-kzfree-to-kfree_sensitive.patch
* mm-ksize-should-silently-accept-a-null-pointer.patch
* mm-expand-config_slab_freelist_hardened-to-include-slab.patch
* slab-add-naive-detection-of-double-free.patch
* mm-slub-extend-slub_debug-syntax-for-multiple-blocks.patch
* mm-slub-make-some-slub_debug-related-attributes-read-only.patch
* mm-slub-remove-runtime-allocation-order-changes.patch
* mm-slub-make-remaining-slub_debug-related-attributes-read-only.patch
* mm-slub-make-reclaim_account-attribute-read-only.patch
* mm-slub-introduce-static-key-for-slub_debug.patch
*