All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: akpm@linux-foundation.org, christophe.leroy@c-s.fr,
	jannh@google.com, kpsingh@chromium.org, kpsingh@google.com,
	mm-commits@vger.kernel.org, peterz@infradead.org
Subject: + lib-add-might_fault-to-strncpy_from_user.patch added to -mm tree
Date: Tue, 14 Apr 2020 16:56:35 -0700	[thread overview]
Message-ID: <20200414235635.XYO2L15nu%akpm@linux-foundation.org> (raw)
In-Reply-To: <20200412004155.1a8f4e081b4e03ef5903abb5@linux-foundation.org>


The patch titled
     Subject: lib: Add might_fault() to strncpy_from_user.
has been added to the -mm tree.  Its filename is
     lib-add-might_fault-to-strncpy_from_user.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/lib-add-might_fault-to-strncpy_from_user.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/lib-add-might_fault-to-strncpy_from_user.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: KP Singh <kpsingh@chromium.org>
Subject: lib: Add might_fault() to strncpy_from_user.


When updating a piece of broken logic from using get_user to
strncpy_from_user, we noticed that a warning which is expected when
calling a function that might fault from an atomic context with
pagefaults enabled disappeared.

Not having this warning in place can lead to calling strncpy_from_user
from an atomic context and eventually kernel crashes/stack corruption.

Link: http://lkml.kernel.org/r/20200414225705.255711-1-kpsingh@chromium.org
Signed-off-by: KP Singh <kpsingh@google.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Jann Horn <jannh@google.com>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 lib/strncpy_from_user.c |    1 +
 1 file changed, 1 insertion(+)

--- a/lib/strncpy_from_user.c~lib-add-might_fault-to-strncpy_from_user
+++ a/lib/strncpy_from_user.c
@@ -98,6 +98,7 @@ long strncpy_from_user(char *dst, const
 {
 	unsigned long max_addr, src_addr;
 
+	might_fault();
 	if (unlikely(count <= 0))
 		return 0;
 
_

Patches currently in -mm which might be from kpsingh@chromium.org are

lib-add-might_fault-to-strncpy_from_user.patch

  parent reply	other threads:[~2020-04-14 23:56 UTC|newest]

Thread overview: 144+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12  7:41 incoming Andrew Morton
2020-04-12  7:42 ` [patch 1/1] mm/debug: add tests validating architecture page table helpers Andrew Morton
2020-04-12 16:33   ` Linus Torvalds
2020-04-13  2:13     ` Anshuman Khandual
2020-04-13 20:01 ` + mm-userfaultfd-disable-userfaultfd-wp-on-x86_32.patch added to -mm tree Andrew Morton
2020-04-13 20:08 ` + maintainers-add-an-entry-for-kfifo-fix.patch " Andrew Morton
2020-04-13 20:11 ` + m68k-drop-redundant-generic-y-=-hardirqh.patch " Andrew Morton
2020-04-13 20:12 ` + userc-make-uidhash_table-static.patch " Andrew Morton
2020-04-13 20:34 ` + sh-fix-build-error-in-mm-initc.patch " Andrew Morton
2020-04-13 20:51 ` + mm-hugetlb-fix-a-addressing-exception-caused-by-huge_pte_offset.patch " Andrew Morton
2020-04-13 21:16 ` + checkpatch-additional-maintainer-section-entry-ordering-checks.patch " Andrew Morton
2020-04-13 22:27 ` + fat-improve-the-readahead-for-fat-entries.patch " Andrew Morton
2020-04-13 22:32 ` + mm-swapfile-use-list_prevnext_entry-instead-of-open-coding.patch " Andrew Morton
2020-04-13 22:33 ` + mm-replace-zero-length-array-with-flexible-array-member.patch " Andrew Morton
2020-04-13 22:36 ` + mm-vmsan-fix-some-typos-in-comment.patch " Andrew Morton
2020-04-13 22:38 ` + mm-compaction-fix-a-typo-in-comment-pessemistic-pessimistic.patch " Andrew Morton
2020-04-13 22:38 ` + mm-memblock-fix-a-typo-in-comment-implict-implicit.patch " Andrew Morton
2020-04-13 22:38 ` + mm-list_lru-fix-a-typo-in-comment-numbesr-numbers.patch " Andrew Morton
2020-04-13 22:50 ` + mm-filemap-fix-a-typo-in-comment-unneccssary-unnecessary.patch " Andrew Morton
2020-04-13 22:51 ` + mm-frontswap-fix-some-typos-in-frontswapc.patch " Andrew Morton
2020-04-13 22:51 ` + mm-memcg-fix-some-typos-in-memcontrolc.patch " Andrew Morton
2020-04-13 22:51 ` + mm-fix-a-typo-in-comment-strucure-structure.patch " Andrew Morton
2020-04-13 23:07 ` + mm-slub-fix-a-typo-in-comment-disambiguiation-disambiguation.patch " Andrew Morton
2020-04-13 23:07 ` + mm-sparse-fix-a-typo-in-comment-convienence-convenience.patch " Andrew Morton
2020-04-13 23:07 ` + mm-page-writeback-fix-a-typo-in-comment-effictive-effective.patch " Andrew Morton
2020-04-13 23:07 ` + mm-memory-fix-a-typo-in-comment-attampt-attempt.patch " Andrew Morton
2020-04-14  0:25 ` + mm-memblock-replace-dereferences-of-memblock_regionnid-with-api-calls.patch " Andrew Morton
2020-04-14  0:25 ` + mm-make-early_pfn_to_nid-and-related-defintions-close-to-each-other.patch " Andrew Morton
2020-04-14  0:25 ` + mm-remove-config_have_memblock_node_map-option.patch " Andrew Morton
2020-04-14  0:25 ` + mm-free_area_init-use-maximal-zone-pfns-rather-than-zone-sizes.patch " Andrew Morton
2020-04-14  0:25 ` + mm-use-free_area_init-instead-of-free_area_init_nodes.patch " Andrew Morton
2020-04-14  0:26 ` + alpha-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + arm-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + arm64-simplify-detection-of-memory-zone-boundaries-for-uma-configs.patch " Andrew Morton
2020-04-14  0:26 ` + csky-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + m68k-mm-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + parisc-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + sparc32-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + unicore32-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + xtensa-simplify-detection-of-memory-zone-boundaries.patch " Andrew Morton
2020-04-14  0:26 ` + mm-memmap_init-iterate-over-memblock-regions-rather-that-check-each-pfn.patch " Andrew Morton
2020-04-14  0:26 ` + mm-remove-early_pfn_in_nid-and-config_nodes_span_other_nodes.patch " Andrew Morton
2020-04-14  0:26 ` + mm-free_area_init-allow-defining-max_zone_pfn-in-descending-order.patch " Andrew Morton
2020-04-14  0:26 ` + mm-rename-free_area_init_node-to-free_area_init_memoryless_node.patch " Andrew Morton
2020-04-14  0:26 ` + mm-clean-up-free_area_init_node-and-its-helpers.patch " Andrew Morton
2020-04-14  0:26 ` + mm-simplify-find_min_pfn_with_active_regions.patch " Andrew Morton
2020-04-14  0:27 ` + docs-vm-update-memory-models-documentation.patch " Andrew Morton
2020-04-14  0:40 ` + mm-page_allocc-bad_-is-not-necessary-when-pagehwpoison.patch " Andrew Morton
2020-04-14  0:40 ` + mm-page_allocc-bad_flags-is-not-necessary-for-bad_page.patch " Andrew Morton
2020-04-14  0:40 ` + mm-page_allocc-rename-free_pages_check_bad-to-check_free_page_bad.patch " Andrew Morton
2020-04-14  0:40 ` + mm-page_allocc-rename-free_pages_check-to-check_free_page.patch " Andrew Morton
2020-04-14  0:40 ` + mm-page_allocc-extract-check__page_bad-common-part-to-page_bad_reason.patch " Andrew Morton
2020-04-14  0:52 ` + dynamic_debug-add-an-option-to-enable-dynamic-debug-for-modules-only.patch " Andrew Morton
2020-04-14  1:09 ` + mm-gup-return-eintr-when-gup-is-interrupted-by-fatal-signals.patch " Andrew Morton
2020-04-14  1:37 ` + squashfs-squashfs_fsh-replace-zero-length-array-with-flexible-array-member.patch " Andrew Morton
2020-04-14  1:37 ` + squashfs-migrate-from-ll_rw_block-usage-to-bio.patch " Andrew Morton
2020-04-14  1:39 ` + checkpatch-fix-a-typo-in-the-regex-for-allocfunctions.patch " Andrew Morton
2020-04-14  2:06 ` + powerpc-pseries-hotplug-memory-stop-checking-is_mem_section_removable.patch " Andrew Morton
2020-04-14  2:06 ` + mm-memory_hotplug-remove-is_mem_section_removable.patch " Andrew Morton
2020-04-14  2:13 ` [folded-merged] mm-clarify-__gfp_memalloc-usage-update.patch removed from " Andrew Morton
2020-04-14  2:13 ` [folded-merged] mm-clarify-__gfp_memalloc-usage-update-checkpatch-fixes.patch " Andrew Morton
2020-04-14 22:30 ` + maintainers-add-an-entry-for-kfifo-fix-fix.patch added to " Andrew Morton
2020-04-14 23:10 ` + mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2.patch " Andrew Morton
2020-04-14 23:11 ` + mm-hugetlb-fix-a-typo-in-comment-manitained-maintained-v2-checkpatch-fixes.patch " Andrew Morton
2020-04-14 23:11 ` + mm-ksm-fix-a-typo-in-comment-alreaady-already-v2.patch " Andrew Morton
2020-04-14 23:56 ` Andrew Morton [this message]
2020-04-15  0:00 ` + tools-build-tweak-unused-value-workaround.patch " Andrew Morton
2020-04-15  0:39 ` + h8300-remove-usage-of-__arch_use_5level_hack.patch " Andrew Morton
2020-04-15  0:39 ` + arm-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:39 ` + arm64-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:39 ` + hexagon-remove-__arch_use_5level_hack.patch " Andrew Morton
2020-04-15  0:39 ` + ia64-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:39 ` + nios2-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:40 ` + openrisc-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:40 ` + powerpc-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:40 ` + sh-fault-modernize-printing-of-kernel-messages.patch " Andrew Morton
2020-04-15  0:40 ` + sh-drop-__pxd_offset-macros-that-duplicate-pxd_index-ones.patch " Andrew Morton
2020-04-15  0:40 ` + sh-add-support-for-folded-p4d-page-tables.patch " Andrew Morton
2020-04-15  0:40 ` + unicore32-remove-__arch_use_5level_hack.patch " Andrew Morton
2020-04-15  0:40 ` + asm-generic-remove-pgtable-nop4d-hackh.patch " Andrew Morton
2020-04-15  0:40 ` + mm-remove-__arch_has_5level_hack-and-include-asm-generic-5level-fixuph.patch " Andrew Morton
2020-04-15  1:17 ` + mm-move-readahead-prototypes-from-mmh.patch " Andrew Morton
2020-04-15  1:17 ` + mm-return-void-from-various-readahead-functions.patch " Andrew Morton
2020-04-15  1:17 ` + mm-ignore-return-value-of-readpages.patch " Andrew Morton
2020-04-15  1:17 ` + mm-move-readahead-nr_pages-check-into-read_pages.patch " Andrew Morton
2020-04-15  1:17 ` + mm-add-new-readahead_control-api.patch " Andrew Morton
2020-04-15  1:17 ` + mm-use-readahead_control-to-pass-arguments.patch " Andrew Morton
2020-04-15  1:17 ` + mm-rename-various-offset-parameters-to-index.patch " Andrew Morton
2020-04-15  1:17 ` + mm-rename-readahead-loop-variable-to-i.patch " Andrew Morton
2020-04-15  1:17 ` + mm-remove-page_offset-from-readahead-loop.patch " Andrew Morton
2020-04-15  1:17 ` + mm-put-readahead-pages-in-cache-earlier.patch " Andrew Morton
2020-04-15  1:17 ` + mm-add-readahead-address-space-operation.patch " Andrew Morton
2020-04-15  1:17 ` + mm-move-end_index-check-out-of-readahead-loop.patch " Andrew Morton
2020-04-15  1:18 ` + mm-add-page_cache_readahead_unbounded.patch " Andrew Morton
2020-04-15  1:18 ` + mm-document-why-we-dont-set-pagereadahead.patch " Andrew Morton
2020-04-15  1:18 ` + mm-use-memalloc_nofs_save-in-readahead-path.patch " Andrew Morton
2020-04-15  1:18 ` + fs-convert-mpage_readpages-to-mpage_readahead.patch " Andrew Morton
2020-04-15  1:18 ` + btrfs-convert-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + erofs-convert-uncompressed-files-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + erofs-convert-compressed-files-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + ext4-convert-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + ext4-pass-the-inode-to-ext4_mpage_readpages.patch " Andrew Morton
2020-04-15  1:18 ` + f2fs-convert-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + f2fs-pass-the-inode-to-f2fs_mpage_readpages.patch " Andrew Morton
2020-04-15  1:18 ` + fuse-convert-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:18 ` + iomap-convert-from-readpages-to-readahead.patch " Andrew Morton
2020-04-15  1:54 ` + mm-ksm-fix-null-pointer-dereference-when-ksm-zero-page-is-enabled.patch " Andrew Morton
2020-04-15  7:44   ` Kirill Tkhai
2020-04-15  8:16     ` [External] " Muchun Song
2020-04-15 18:32       ` Andrew Morton
2020-04-15  4:29 ` + mm-gupc-further-document-vma_permits_fault.patch " Andrew Morton
2020-04-15  4:33 ` + fuse-convert-from-readpages-to-readahead-fix.patch " Andrew Morton
2020-04-15  4:46 ` + x86-hyperv-use-vmalloc_exec-for-the-hypercall-page.patch " Andrew Morton
2020-04-15  4:46 ` + x86-fix-vmap-arguments-in-map_irq_stack.patch " Andrew Morton
2020-04-15  4:46 ` + staging-android-ion-use-vmap-instead-of-vm_map_ram.patch " Andrew Morton
2020-04-15  4:46 ` + staging-media-ipu3-use-vmap-instead-of-reimplementing-it.patch " Andrew Morton
2020-04-15  4:46 ` + dma-mapping-use-vmap-insted-of-reimplementing-it.patch " Andrew Morton
2020-04-15  4:46 ` + powerpc-add-an-ioremap_phb-helper.patch " Andrew Morton
2020-04-15  4:46 ` + powerpc-remove-__ioremap_at-and-__iounmap_at.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-__get_vm_area.patch " Andrew Morton
2020-04-15  4:47 ` + mm-unexport-unmap_kernel_range_noflush.patch " Andrew Morton
2020-04-15  4:47 ` + mm-rename-config_pgtable_mapping-to-config_zsmalloc_pgtable_mapping.patch " Andrew Morton
2020-04-15  4:47 ` + mm-only-allow-page-table-mappings-for-built-in-zsmalloc.patch " Andrew Morton
2020-04-15  4:47 ` + mm-pass-addr-as-unsigned-long-to-vb_free.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-vmap_page_range_noflush-and-vunmap_page_range.patch " Andrew Morton
2020-04-15  4:47 ` + mm-rename-vmap_page_range-to-map_kernel_range.patch " Andrew Morton
2020-04-15  4:47 ` + mm-dont-return-the-number-of-pages-from-map_kernel_range_noflush.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-map_vm_range.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-unmap_vmap_area.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-the-prot-argument-from-vm_map_ram.patch " Andrew Morton
2020-04-15  4:47 ` + mm-enforce-that-vmap-cant-map-pages-executable.patch " Andrew Morton
2020-04-15  4:47 ` + gpu-drm-remove-the-powerpc-hack-in-drm_legacy_sg_alloc.patch " Andrew Morton
2020-04-15  4:47 ` + mm-remove-the-pgprot-argument-to-__vmalloc.patch " Andrew Morton
2020-04-15  4:48 ` + mm-remove-the-prot-argument-to-__vmalloc_node.patch " Andrew Morton
2020-04-15  4:48 ` + mm-remove-both-instances-of-__vmalloc_node_flags.patch " Andrew Morton
2020-04-15  4:48 ` + mm-remove-__vmalloc_node_flags_caller.patch " Andrew Morton
2020-04-15  4:48 ` + mm-switch-the-test_vmalloc-module-to-use-__vmalloc_node.patch " Andrew Morton
2020-04-15  4:48 ` + mm-remove-vmalloc_user_node_flags.patch " Andrew Morton
2020-04-15  4:48 ` + arm64-use-__vmalloc_node-in-arch_alloc_vmap_stack.patch " Andrew Morton
2020-04-15  4:48 ` + powerpc-use-__vmalloc_node-in-alloc_vm_stack.patch " Andrew Morton
2020-04-15  4:48 ` + s390-use-__vmalloc_node-in-stack_alloc.patch " Andrew Morton
2020-04-15 17:44 ` + test_firmware-remove-unnecessary-test_fw_mutex-in-test_dev_config_show_xxx.patch " Andrew Morton
2020-04-15 18:12 ` + slub-avoid-redzone-when-choosing-freepointer-location.patch " Andrew Morton
2020-04-15 18:41 ` + mm-shmem-fix-build-without-thp.patch " Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200414235635.XYO2L15nu%akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=jannh@google.com \
    --cc=kpsingh@chromium.org \
    --cc=kpsingh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.