2014-07-02 22:08:23

by Andrew Morton

[permalink] [raw]
Subject: mmotm 2014-07-02-15-07 uploaded

The mm-of-the-moment snapshot 2014-07-02-15-07 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 (3.x
or 3.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-yyyy-mm-dd-hh-mm-ss. Both contain the string yyyy-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 git tree which contains the memory management portion of this tree is
maintained at git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git
by Michal Hocko. It contains the patches which are between the
"#NEXT_PATCHES_START mm" and "#NEXT_PATCHES_END" markers, from the series
file, http://www.ozlabs.org/~akpm/mmotm/series.


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.

http://git.cmpxchg.org/?p=linux-mmotm.git;a=summary

To develop on top of mmotm git:

$ git remote add mmotm git://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git
$ git remote update mmotm
$ git checkout -b topic mmotm/master
<make changes, commit>
$ git send-email mmotm/master.. [...]

To rebase a branch with older patches to a new mmotm release:

$ git remote update mmotm
$ git rebase --onto mmotm/master <topic base> topic




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 available at

http://git.cmpxchg.org/?p=linux-mmots.git;a=summary

and use of this tree is similar to
http://git.cmpxchg.org/?p=linux-mmotm.git, described above.


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

origin.patch
i-need-old-gcc.patch
arch-alpha-kernel-systblss-remove-debug-check.patch
maintainers-akpm-maintenance.patch
* mm-page_alloc-fix-cma-area-initialisation-when-pageblock-max_order.patch
* slub-fix-off-by-one-in-number-of-slab-tests.patch
* autofs4-fix-false-positive-compile-error.patch
* tools-cpu-hotplug-fix-unexpected-operator-error.patch
* tools-memory-hotplug-fix-unexpected-operator-error.patch
* zram-revalidate-disk-after-capacity-change.patch
* msync-fix-incorrect-fstart-calculation.patch
* mm-vmscan-update-the-trace-vmscan-postprocesspl-for-event-vmscan-mm_vmscan_lru_isolate.patch
* hwpoison-fix-the-handling-path-of-the-victimized-page-frame-that-belong-to-non-lur.patch
* proc-stat-convert-to-single_open_size.patch
* fs-seq_file-fallback-to-vmalloc-allocation.patch
* tools-msgque-improve-error-handling-when-not-running-as-root.patch
* kernel-printk-printkc-revert-printk-enable-interrupts-before-calling-console_trylock_for_printk.patch
* shmem-fix-init_page_accessed-use-to-stop-pagelru-bug.patch
* revert-shmem-fix-faulting-into-a-hole-while-its-punched.patch
* shmem-fix-faulting-into-a-hole-while-its-punched-take-2.patch
* mm-fs-fix-pessimization-in-hole-punching-pagecache.patch
* x86mem-hotplug-pass-sync_global_pgds-a-correct-argument-in-remove_pagetable.patch
* x86mem-hotplug-modify-pgd-entry-when-removing-memory.patch
* x86-numa-setup_node_data-drop-dead-code-and-rename-function.patch
* x86-numa-setup_node_data-drop-dead-code-and-rename-function-checkpatch-fixes.patch
* kernel-auditfilterc-replace-countsize-kmalloc-by-kcalloc.patch
* fs-cifs-remove-obsolete-__constant.patch
* fs-cifs-filec-replace-countsize-kzalloc-by-kcalloc.patch
* fs-cifs-smb2filec-replace-countsize-kzalloc-by-kcalloc.patch
* kernel-posix-timersc-code-clean-up.patch
* kernel-posix-timersc-code-clean-up-checkpatch-fixes.patch
* input-route-kbd-leds-through-the-generic-leds-layer.patch
* input-route-kbd-leds-through-the-generic-leds-layer-fix.patch
* remove-cpu_subtype_sh7764.patch
* fs-squashfs-file_directc-replace-countsize-kmalloc-by-kmalloc_array.patch
* fs-squashfs-superc-logging-clean-up.patch
* drivers-net-irda-donauboe-convert-to-module_pci_driver.patch
* fs-ext4-fsyncc-generic_file_fsync-call-based-on-barrier-flag.patch
* ocfs2-correctly-check-the-return-value-of-ocfs2_search_extent_list.patch
* ocfs2-remove-convertion-of-total_backoff-in-dlm_join_domain.patch
* ocfs2-do-not-write-error-flag-to-user-structure-we-cannot-copy-from-to.patch
* ocfs2-free-inode-when-i_count-becomes-zero.patch
* ocfs2-free-inode-when-i_count-becomes-zero-checkpatch-fixes.patch
* ocfs2-o2net-dont-shutdown-connection-when-idle-timeout.patch
* ocfs2-o2net-set-tcp-user-timeout-to-max-value.patch
* ocfs2-quorum-add-a-log-for-node-not-fenced.patch
* ocfs2-call-ocfs2_journal_access_di-before-ocfs2_journal_dirty-in-ocfs2_write_end_nolock.patch
* fs-ocfs2-slot_mapc-replace-countsize-kzalloc-by-kcalloc.patch
* ocfs2-dlm-fix-race-between-dispatched_work-and-dlm_lockres_grab_inflight_worker.patch
* maintainers-update-ibm-serveraid-raid-info.patch
* block-restore-proc-partitions-to-not-display-non-partitionable-removable-devices.patch
* kernel-watchdogc-convert-printk-pr_warning-to-pr_foo.patch
mm.patch
* mm-slabc-add-__init-to-init_lock_keys.patch
* slab-common-add-functions-for-kmem_cache_node-access.patch
* slab-common-add-functions-for-kmem_cache_node-access-fix.patch
* slub-use-new-node-functions.patch
* slub-use-new-node-functions-checkpatch-fixes.patch
* slub-use-new-node-functions-fix.patch
* slab-use-get_node-and-kmem_cache_node-functions.patch
* slab-use-get_node-and-kmem_cache_node-functions-fix.patch
* slab-use-get_node-and-kmem_cache_node-functions-fix-2.patch
* slab-use-get_node-and-kmem_cache_node-functions-fix-2-fix.patch
* mm-slabh-wrap-the-whole-file-with-guarding-macro.patch
* mm-slub-mark-resiliency_test-as-init-text.patch
* mm-slub-slub_debug=n-use-the-same-alloc-free-hooks-as-for-slub_debug=y.patch
* memcg-cleanup-memcg_cache_params-refcnt-usage.patch
* memcg-destroy-kmem-caches-when-last-slab-is-freed.patch
* memcg-mark-caches-that-belong-to-offline-memcgs-as-dead.patch
* slub-dont-fail-kmem_cache_shrink-if-slab-placement-optimization-fails.patch
* slub-make-slab_free-non-preemptable.patch
* memcg-wait-for-kfrees-to-finish-before-destroying-cache.patch
* slub-make-dead-memcg-caches-discard-free-slabs-immediately.patch
* slub-kmem_cache_shrink-check-if-partial-list-is-empty-under-list_lock.patch
* slab-do-not-keep-free-objects-slabs-on-dead-memcg-caches.patch
* slab-set-free_limit-for-dead-caches-to-0.patch
* slab-add-unlikely-macro-to-help-compiler.patch
* slab-move-up-code-to-get-kmem_cache_node-in-free_block.patch
* slab-defer-slab_destroy-in-free_block.patch
* slab-defer-slab_destroy-in-free_block-v4.patch
* slab-factor-out-initialization-of-arracy-cache.patch
* slab-introduce-alien_cache.patch
* slab-use-the-lock-on-alien_cache-instead-of-the-lock-on-array_cache.patch
* slab-destroy-a-slab-without-holding-any-alien-cache-lock.patch
* slab-remove-a-useless-lockdep-annotation.patch
* slab-remove-bad_alien_magic.patch
* slab-change-int-to-size_t-for-representing-allocation-size.patch
* slub-reduce-duplicate-creation-on-the-first-object.patch
* mm-readaheadc-remove-unused-file_ra_state-from-count_history_pages.patch
* mm-memory_hotplugc-add-__meminit-to-grow_zone_span-grow_pgdat_span.patch
* mm-page_alloc-add-__meminit-to-alloc_pages_exact_nid.patch
* mm-page_allocc-unexport-alloc_pages_exact_nid.patch
* include-linux-memblockh-add-__init-to-memblock_set_bottom_up.patch
* vmalloc-use-rcu-list-iterator-to-reduce-vmap_area_lock-contention.patch
* mm-memoryc-use-entry-=-access_oncepte-in-handle_pte_fault.patch
* mem-hotplug-avoid-illegal-state-prefixed-with-legal-state-when-changing-state-of-memory_block.patch
* mem-hotplug-introduce-mmop_offline-to-replace-the-hard-coding-1.patch
* mm-page_alloc-simplify-drain_zone_pages-by-using-min.patch
* mm-internalh-use-nth_page.patch
* dma-cma-separate-core-cma-management-codes-from-dma-apis.patch
* dma-cma-support-alignment-constraint-on-cma-region.patch
* dma-cma-support-arbitrary-bitmap-granularity.patch
* dma-cma-support-arbitrary-bitmap-granularity-fix.patch
* cma-generalize-cma-reserved-area-management-functionality.patch
* cma-generalize-cma-reserved-area-management-functionality-fix.patch
* ppc-kvm-cma-use-general-cma-reserved-area-management-framework.patch
* ppc-kvm-cma-use-general-cma-reserved-area-management-framework-fix.patch
* mm-cma-clean-up-cma-allocation-error-path.patch
* mm-cma-change-cma_declare_contiguous-to-obey-coding-convention.patch
* mm-cma-clean-up-log-message.patch
* mm-hugetlbfs-fix-rmapping-for-anonymous-hugepages-with-page_pgoff.patch
* mm-hugetlbfs-fix-rmapping-for-anonymous-hugepages-with-page_pgoff-v2.patch
* mm-hugetlbfs-fix-rmapping-for-anonymous-hugepages-with-page_pgoff-v3.patch
* mm-hugetlbfs-fix-rmapping-for-anonymous-hugepages-with-page_pgoff-v3-fix.patch
* mm-thp-move-invariant-bug-check-out-of-loop-in-__split_huge_page_map.patch
* mm-thp-replace-smp_mb-after-atomic_add-by-smp_mb__after_atomic.patch
* mm-page-flags-clean-up-the-page-flag-test-set-clear-macros.patch
* mm-memcontrol-fold-mem_cgroup_do_charge.patch
* mm-memcontrol-rearrange-charging-fast-path.patch
* mm-memcontrol-reclaim-at-least-once-for-__gfp_noretry.patch
* mm-huge_memory-use-gfp_transhuge-when-charging-huge-pages.patch
* mm-memcontrol-retry-reclaim-for-oom-disabled-and-__gfp_nofail-charges.patch
* mm-memcontrol-remove-explicit-oom-parameter-in-charge-path.patch
* mm-memcontrol-simplify-move-precharge-function.patch
* mm-memcontrol-catch-root-bypass-in-move-precharge.patch
* mm-memcontrol-use-root_mem_cgroup-res_counter.patch
* mm-memcontrol-remove-ordering-between-pc-mem_cgroup-and-pagecgroupused.patch
* mm-memcontrol-do-not-acquire-page_cgroup-lock-for-kmem-pages.patch
* mm-memcontrol-rewrite-charge-api.patch
* mm-memcontrol-rewrite-charge-api-fix-3.patch
* mm-memcontrol-rewrite-uncharge-api.patch
* mm-memcontrol-rewrite-uncharge-api-fix-2.patch
* mm-memcontrol-rewrite-uncharge-api-fix-4.patch
* mm-memcontrol-rewrite-uncharge-api-fix-5.patch
* mm-memcontrol-rewrite-charge-api-fix-shmem_unuse.patch
* mm-memcontrol-rewrite-charge-api-fix-shmem_unuse-fix.patch
* page-cgroup-trivial-cleanup.patch
* page-cgroup-get-rid-of-nr_pcg_flags.patch
* mm-mem-hotplug-replace-simple_strtoull-with-kstrtoull.patch
* memcg-remove-lookup_cgroup_page-prototype.patch
* mm-update-comments-for-get-set_pfnblock_flags_mask.patch
* mem-hotplug-improve-zone_movable_is_highmem-logic.patch
* mm-vmscan-remove-remains-of-kswapd-managed-zone-all_unreclaimable.patch
* mm-vmscan-rework-compaction-ready-signaling-in-direct-reclaim.patch
* mm-vmscan-remove-all_unreclaimable.patch
* mm-vmscan-move-swappiness-out-of-scan_control.patch
* tracing-tell-mm_migrate_pages-event-about-numa_misplaced.patch
* mm-update-the-description-for-madvise_remove.patch
* mm-vmallocc-add-a-schedule-point-to-vmalloc.patch
* mm-vmallocc-add-a-schedule-point-to-vmalloc-fix.patch
* mm-vmalloc-constify-allocation-mask.patch
* include-linux-mmdebugh-add-vm_warn_once.patch
* shmem-fix-double-uncharge-in-__shmem_file_setup.patch
* shmem-update-memory-reservation-on-truncate.patch
* mm-catch-memory-commitment-underflow.patch
* mm-catch-memory-commitment-underflow-fix.patch
* mm-export-nr_shmem-via-sysinfo2-si_meminfo-interfaces.patch
* mm-hwpoison-injectc-remove-unnecessary-null-test-before-debugfs_remove_recursive.patch
* mm-replace-init_page_accessed-by-__setpagereferenced.patch
* mmhugetlb-make-unmap_ref_private-return-void.patch
* mmhugetlb-simplify-error-handling-in-hugetlb_cow.patch
* hwpoison-fix-race-with-changing-page-during-offlining-v2.patch
* mm-hugetlb-generalize-writes-to-nr_hugepages.patch
* mm-hugetlb-remove-hugetlb_zero-and-hugetlb_infinity.patch
* mm-make-copy_pte_range-static-again.patch
* mm-introduce-do_shared_fault-and-drop-do_fault-fix-fix.patch
* mm-compactionc-isolate_freepages_block-small-tuneup.patch
* fs-mpagec-forgotten-write_sync-in-case-of-data-integrity-write.patch
* m68k-call-find_vma-with-the-mmap_sem-held-in-sys_cacheflush.patch
* zram-rename-struct-table-to-zram_table_entry.patch
* zram-remove-unused-sector_size-define.patch
* zram-use-size_t-instead-of-u16.patch
* zram-remove-global-tb_lock-with-fine-grain-lock.patch
* mm-zswapc-add-__init-to-zswap_entry_cache_destroy.patch
* mm-zbud-zbud_alloc-minor-param-change.patch
* mm-zbud-change-zbud_alloc-size-type-to-size_t.patch
* mm-zpool-implement-common-zpool-api-to-zbud-zsmalloc.patch
* mm-zpool-implement-common-zpool-api-to-zbud-zsmalloc-fix.patch
* mm-zpool-zbud-zsmalloc-implement-zpool.patch
* mm-zpool-update-zswap-to-use-zpool.patch
* mm-zpool-update-zswap-to-use-zpool-fix.patch
* mm-zpool-prevent-zbud-zsmalloc-from-unloading-when-used.patch
* mm-zpool-prevent-zbud-zsmalloc-from-unloading-when-used-checkpatch-fixes.patch
* do_shared_fault-check-that-mmap_sem-is-held.patch
* include-kernelh-rewrite-min3-max3-and-clamp-using-min-and-max.patch
* include-kernelh-rewrite-min3-max3-and-clamp-using-min-and-max-fix.patch
* makefile-tell-gcc-optimizer-to-never-introduce-new-data-races.patch
* fs-asus_atk0110-fix-define_simple_attribute-semicolon-definition-and-use.patch
* drivers-misc-ti-st-st_corec-fix-null-dereference-on-protocol-type-check.patch
* printk-make-dynamic-kernel-ring-buffer-alignment-explicit.patch
* printk-move-power-of-2-practice-of-ring-buffer-size-to-a-helper.patch
* printk-make-dynamic-units-clear-for-the-kernel-ring-buffer.patch
* printk-allow-increasing-the-ring-buffer-depending-on-the-number-of-cpus.patch
* printk-allow-increasing-the-ring-buffer-depending-on-the-number-of-cpus-fix.patch
* printk-tweak-do_syslog-to-match-comments.patch
* lib-vsprintf-add-%pt-format-specifier.patch
* maintainers-remove-two-ancient-eata-sections.patch
* drivers-video-backlight-backlightc-remove-backlight-sysfs-uevent.patch
* list-use-argument-hlist_add_after-names-from-rcu-variant.patch
* list-fix-order-of-arguments-for-hlist_add_after_rcu.patch
* list-fix-order-of-arguments-for-hlist_add_after_rcu-checkpatch-fixes.patch
* klist-use-same-naming-scheme-as-hlist-for-klist_add_after.patch
* mm-utilc-add-kstrimdup.patch
* add-lib-globc.patch
* add-lib-globc-fix.patch
* lib-globc-add-config_glob_selftest.patch
* libata-use-glob_match-from-lib-globc.patch
* lib-add-size-unit-t-p-e-to-memparse.patch
* lib-string_helpersc-constify-static-arrays.patch
* lib-test-kstrtoxc-use-array_size-instead-of-sizeof-sizeof.patch
* kernelh-remove-deprecated-pack_hex_byte.patch
* lib-list_sort_test-return-enomem-when-allocation-fails.patch
* lib-list_sort_test-add-extra-corruption-check.patch
* lib-list_sort_test-simplify-and-harden-cleanup.patch
* lib-list_sortc-limit-number-of-unused-cmp-callbacks.patch
* lib-list_sortc-convert-to-pr_foo.patch
* lib-list_sortc-convert-to-pr_foo-fix.patch
* lib-add-crc64-ecma-module.patch
* fs-compatc-remove-unnecessary-test-on-unsigned-value.patch
* checkpatch-attempt-to-find-unnecessary-out-of-memory-messages.patch
* checkpatch-warn-on-unnecessary-else-after-return-or-break.patch
* checkpatch-fix-complex-macro-false-positive-for-escaped-constant-char.patch
* checkpatch-fix-function-pointers-in-blank-line-needed-after-declarations-test.patch
* checkpatch-ignore-email-headers-better.patch
* checkpatchpl-also-suggest-else-if-when-if-follows-brace.patch
* checkpatch-add-test-for-blank-lines-after-function-struct-union-enum.patch
* checkpatch-add-test-for-blank-lines-after-function-struct-union-enum-declarations.patch
* checkpatch-add-a-multiple-blank-lines-test.patch
* checkpatch-change-blank-line-after-declaration-type-to-line_spacing.patch
* checkpatch-quiet-kconfig-help-message-checking.patch
* checkpatch-warn-on-unnecessary-parentheses-around-references-of-foo-bar.patch
* checkpatch-allow-multiple-const-types.patch
* checkpatch-improve-no-space-after-cast-test.patch
* checkpatch-emit-fewer-kmalloc_array-kcalloc-conversion-warnings.patch
* checkpatch-add-test-for-commit-id-formatting-style-in-commit-log.patch
* fs-efs-nameic-return-is-not-a-function.patch
* binfmt_elfc-use-get_random_int-to-fix-entropy-depleting.patch
* binfmt_elfc-use-get_random_int-to-fix-entropy-depleting-fix.patch
* fs-ramfs-file-nommuc-replace-countsize-kzalloc-by-kcalloc.patch
* init-make-rootdelay=n-consistent-with-rootwait-behaviour.patch
* kernel-test_kprobesc-use-current-logging-functions.patch
* rtc-add-support-of-nvram-for-maxim-dallas-rtc-ds1343.patch
* rtc-move-ds2404-entry-where-it-belongs.patch
* rtc-add-hardware-dependency-to-rtc-moxart.patch
* rtc-rtc-ds1742-revert-drivers-rtc-rtc-ds1742c-remove-redundant-of_match_ptr-helper.patch
* rtc-efi-check-for-invalid-data-coming-back-from-uefi.patch
* fs-isofs-logging-clean-up.patch
* fs-isofs-logging-clean-up-fix.patch
* fs-coda-use-linux-uaccessh.patch
* fs-nilfs2-superc-remove-unnecessary-test-on-unsigned-value.patch
* nilfs2-add-sys-fs-nilfs2-features-group.patch
* nilfs2-add-sys-fs-nilfs2-device-group.patch
* nilfs2-add-sys-fs-nilfs2-device-superblock-group.patch
* nilfs2-add-sys-fs-nilfs2-device-segctor-group.patch
* nilfs2-add-sys-fs-nilfs2-device-segments-group.patch
* nilfs2-add-sys-fs-nilfs2-device-checkpoints-group.patch
* nilfs2-add-sys-fs-nilfs2-device-mounted_snapshots-group.patch
* nilfs2-add-sys-fs-nilfs2-device-mounted_snapshots-snapshot-group.patch
* nilfs2-integrate-sysfs-support-into-driver.patch
* nilfs2-integrate-sysfs-support-into-driver-fix.patch
* hfsplus-fix-longname-handling.patch
* fs-ufs-convert-printk-to-pr_foo.patch
* fs-ufs-use-pr_fmt.patch
* fs-ufs-superc-use-__func__-in-logging.patch
* fs-ufs-superc-use-va_format-instead-of-buffer-vsnprintf.patch
* fs-ufs-convert-ufsd-printk-to-pr_debug.patch
* fs-reiserfs-replace-not-standard-%lu-%ld.patch
* fs-reiserfs-use-linux-uaccessh.patch
* fs-reiserfs-xattrc-fix-blank-line-missing-after-declarations.patch
* fs-hpfs-dnodec-fix-suspect-code-indent.patch
* fs-proc-kcorec-use-page_align-instead-of-alignpage_size.patch
* proc-constify-seq_operations.patch
* fork-exec-cleanup-mm-initialization.patch
* fork-reset-mm-pinned_vm.patch
* fork-copy-mms-vm-usage-counters-under-mmap_sem.patch
* bin2c-move-bin2c-in-scripts-basic.patch
* kernel-build-bin2c-based-on-config-option-config_build_bin2c.patch
* kexec-rename-unusebale_pages-to-unusable_pages.patch
* kexec-move-segment-verification-code-in-a-separate-function.patch
* kexec-use-common-function-for-kimage_normal_alloc-and-kimage_crash_alloc.patch
* resource-provide-new-functions-to-walk-through-resources.patch
* kexec-make-kexec_segment-user-buffer-pointer-a-union.patch
* kexec-new-syscall-kexec_file_load-declaration.patch
* kexec-implementation-of-new-syscall-kexec_file_load.patch
* kexec-implementation-of-new-syscall-kexec_file_load-checkpatch-fixes.patch
* kexec-implementation-of-new-syscall-kexec_file_load-fix.patch
* purgatory-sha256-provide-implementation-of-sha256-in-purgaotory-context.patch
* purgatory-core-purgatory-functionality.patch
* kexec-load-and-relocate-purgatory-at-kernel-load-time.patch
* kexec-bzimage64-support-for-loading-bzimage-using-64bit-entry.patch
* kexec-bzimage64-support-for-loading-bzimage-using-64bit-entry-fix.patch
* kexec-support-for-kexec-on-panic-using-new-system-call.patch
* kexec-support-for-kexec-on-panic-using-new-system-call-fix.patch
* kexec-support-kexec-kdump-on-efi-systems.patch
* kexec-support-kexec-kdump-on-efi-systems-fix.patch
* lib-idr-fix-out-of-bounds-pointer-dereference.patch
* sysctl-remove-now-unused-typedef-ctl_table.patch
* sysctl-remove-now-unused-typedef-ctl_table-fix.patch
* fs-exofs-ore_raidc-replace-countsize-kzalloc-by-kcalloc.patch
* kernel-gcov-fsc-remove-unnecessary-null-test-before-debugfs_remove.patch
* fs-adfs-dir_fplusc-use-array_size-instead-of-sizeof-sizeof.patch
* fs-adfs-dir_fplusc-replace-countsize-kzalloc-by-kcalloc.patch
* adfs-add-__printf-verification-fix-format-argument-mismatches.patch
* fs-bfs-use-bfs-prefix-for-dump_imap.patch
* panic-add-taint_softlockup.patch
* panic-add-taint_softlockup-fix.patch
* drivers-parport-parport_ip32c-use-ptr_err_or_zero.patch
* fs-pstore-ram_corec-replace-countsize-kmalloc-by-kmalloc_array.patch
* fs-cachefiles-daemonc-remove-unnecessary-tests-on-unsigned-values.patch
* fs-cachefiles-bindc-remove-unnecessary-assertions.patch
* fs-omfs-inodec-replace-countsize-kzalloc-by-kcalloc.patch
* fs-romfs-superc-convert-printk-to-pr_foo.patch
* fs-romfs-superc-use-pr_fmt-in-logging.patch
* fs-romfs-superc-add-blank-line-after-declarations.patch
* fs-qnx6-convert-printk-to-pr_foo.patch
* fs-qnx6-use-pr_fmt-and-__func__-in-logging.patch
* fs-qnx6-update-debugging-to-current-functions.patch
* initrd-fix-lz4-decompress-with-initrd.patch
* initramfs-support-initrd-that-is-bigger-than-2gib.patch
* initramfs-support-initramfs-that-is-bigger-than-2gib.patch
* shm-make-exit_shm-work-proportional-to-task-activity.patch
* shm-allow-exit_shm-in-parallel-if-only-marking-orphans.patch
* shm-remove-unneeded-extern-for-function.patch
* lib-scatterlist-make-arch_has_sg_chain-an-actual-kconfig.patch
* lib-scatterlist-make-arch_has_sg_chain-an-actual-kconfig-fix.patch
* lib-scatterlist-make-arch_has_sg_chain-an-actual-kconfig-fix-2.patch
* lib-scatterlist-make-arch_has_sg_chain-an-actual-kconfig-fix-3.patch
* lib-scatterlist-clean-up-useless-architecture-versions-of-scatterlisth.patch
* scripts-coccinelle-free-add-null-test-before-freeing-functions.patch
* scripts-tagssh-include-compat_sys_-symbols-in-the-generated-tags.patch
* fs-dlm-debug_fsc-remove-unnecessary-null-test-before-debugfs_remove.patch
linux-next.patch
* drivers-gpio-gpio-zevioc-fix-build.patch
* init-mainc-code-clean-up.patch
* arch-arm-mach-omap2-replace-strict_strto-with-kstrto.patch
* arch-arm-mach-pxa-replace-strict_strto-call-with-kstrto.patch
* arch-arm-mach-s3c24xx-mach-jivec-replace-strict_strto-with-kstrto.patch
* arch-arm-mach-w90x900-cpuc-replace-obsolete-strict_strto.patch
* arch-powerpc-replace-obsolete-strict_strto-calls.patch
* arch-x86-replace-strict_strto-calls.patch
* drivers-scsi-replace-strict_strto-calls.patch
* net-sunrpc-replace-strict_strto-calls.patch
* drivers-staging-emxx_udc-emxx_udcc-replace-strict_strto-with-kstrto.patch
* include-linux-remove-strict_strto-definitions.patch
* pci-dma-compat-add-pci_zalloc_consistent-helper.patch
* atm-use-pci_zalloc_consistent.patch
* block-use-pci_zalloc_consistent.patch
* crypto-use-pci_zalloc_consistent.patch
* infiniband-use-pci_zalloc_consistent.patch
* i810-use-pci_zalloc_consistent.patch
* media-use-pci_zalloc_consistent.patch
* amd-use-pci_zalloc_consistent.patch
* atl1e-use-pci_zalloc_consistent.patch
* enic-use-pci_zalloc_consistent.patch
* sky2-use-pci_zalloc_consistent.patch
* micrel-use-pci_zalloc_consistent.patch
* qlogic-use-pci_zalloc_consistent.patch
* irda-use-pci_zalloc_consistent.patch
* ipw2100-use-pci_zalloc_consistent.patch
* mwl8k-use-pci_zalloc_consistent.patch
* rtl818x-use-pci_zalloc_consistent.patch
* rtlwifi-use-pci_zalloc_consistent.patch
* scsi-use-pci_zalloc_consistent.patch
* staging-use-pci_zalloc_consistent.patch
* synclink_gt-use-pci_zalloc_consistent.patch
* vme-bridges-use-pci_zalloc_consistent.patch
* amd-neaten-and-remove-unnecessary-oom-messages.patch
* kernel-kprobesc-convert-printk-to-pr_foo.patch
* mm-replace-remap_file_pages-syscall-with-emulation.patch
* mm-replace-remap_file_pages-syscall-with-emulation-fix.patch
* mm-replace-remap_file_pages-syscall-with-emulation-fix-2.patch
* mm-replace-remap_file_pages-syscall-with-emulation-fix-3.patch
* memcg-deprecate-memoryforce_empty-knob.patch
* memcg-deprecate-memoryforce_empty-knob-fix.patch
* fat-add-i_disksize-to-represent-uninitialized-size-v4.patch
* fat-add-fat_fallocate-operation-v4.patch
* fat-zero-out-seek-range-on-_fat_get_block-v4.patch
* fat-fallback-to-buffered-write-in-case-of-fallocated-region-on-direct-io-v4.patch
* fat-permit-to-return-phy-block-number-by-fibmap-in-fallocated-region-v4.patch
* documentation-filesystems-vfattxt-update-the-limitation-for-fat-fallocate-v4.patch
* w1-call-put_device-if-device_register-fails.patch
* mm-add-strictlimit-knob-v2.patch
debugging-keep-track-of-page-owners.patch
page-owners-correct-page-order-when-to-free-page.patch
make-sure-nobodys-leaking-resources.patch
journal_add_journal_head-debug.patch
journal_add_journal_head-debug-fix.patch
releasing-resources-with-children.patch
make-frame_pointer-default=y.patch
kernel-forkc-export-kernel_thread-to-modules.patch
mutex-subsystem-synchro-test-module.patch
slab-leaks3-default-y.patch
put_bh-debug.patch
add-debugging-aid-for-memory-initialisation-problems.patch
workaround-for-a-pci-restoring-bug.patch
single_open-seq_release-leak-diagnostics.patch


2014-07-02 23:21:11

by Randy Dunlap

[permalink] [raw]
Subject: Re: mmotm 2014-07-02-15-07 uploaded (stack protector)

On 07/02/14 15:08, [email protected] wrote:
> The mm-of-the-moment snapshot 2014-07-02-15-07 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.

Hi Andi,

Here is an extract from 10 randconfig builds:


$ grep STACKPROTECTOR_STRONG config-r*
config-r8735:CONFIG_CC_STACKPROTECTOR_STRONG=y
config-r8736:CONFIG_CC_STACKPROTECTOR_STRONG=y
config-r8737:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
config-r8738:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
config-r8739:CONFIG_CC_STACKPROTECTOR_STRONG=y
config-r8740:CONFIG_CC_STACKPROTECTOR_STRONG=y
config-r8741:CONFIG_CC_STACKPROTECTOR_STRONG=y
config-r8742:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
config-r8743:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
config-r8744:# CONFIG_CC_STACKPROTECTOR_STRONG is not set


but the captured output for each one says:

grep STACKPROTECTOR_STRONG build*.out
build-r8735.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
build-r8737.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
build-r8739.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
build-r8740.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
build-r8740.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
build-r8741.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
build-r8741.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
build-r8742.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler


then the build goes on to produce many errors like this one:

CC init/do_mounts.o
gcc: error: unrecognized command line option '-fstack-protector-strong'


Can you explain this, please? or even better yet, fix it.

thanks,

--
~Randy

2014-07-03 00:23:04

by Andi Kleen

[permalink] [raw]
Subject: Re: mmotm 2014-07-02-15-07 uploaded (stack protector)

On Wed, Jul 02, 2014 at 04:21:06PM -0700, Randy Dunlap wrote:
> On 07/02/14 15:08, [email protected] wrote:
> > The mm-of-the-moment snapshot 2014-07-02-15-07 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.
>
> Hi Andi,
>
> Here is an extract from 10 randconfig builds:
>
>
> $ grep STACKPROTECTOR_STRONG config-r*
> config-r8735:CONFIG_CC_STACKPROTECTOR_STRONG=y
> config-r8736:CONFIG_CC_STACKPROTECTOR_STRONG=y
> config-r8737:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
> config-r8738:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
> config-r8739:CONFIG_CC_STACKPROTECTOR_STRONG=y
> config-r8740:CONFIG_CC_STACKPROTECTOR_STRONG=y
> config-r8741:CONFIG_CC_STACKPROTECTOR_STRONG=y
> config-r8742:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
> config-r8743:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
> config-r8744:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
>
>
> but the captured output for each one says:
>
> grep STACKPROTECTOR_STRONG build*.out
> build-r8735.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> build-r8737.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> build-r8739.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> build-r8740.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> build-r8740.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> build-r8741.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> build-r8741.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> build-r8742.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>
>
> then the build goes on to produce many errors like this one:
>
> CC init/do_mounts.o
> gcc: error: unrecognized command line option '-fstack-protector-strong'
>
>
> Can you explain this, please? or even better yet, fix it.

That's the code

ifdef CONFIG_CC_STACKPROTECTOR_STRONG
stackp-flag := -fstack-protector-strong
ifeq ($(call cc-option, $(stackp-flag)),)
$(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \
-fstack-protector-strong not supported by compiler)
endif
else
# Force off for distro compilers that enable stack protector by default.
stackp-flag := $(call cc-option, -fno-stack-protector)
endif
endif
KBUILD_CFLAGS += $(stackp-flag)

So -fstack-protector-strong itself is never protected by a cc-option call.

You could add it to the stack-flag line, then it would only warn.

stackp-flag := $(call cc-option, -fstack-protector-strong)

It's hard to tell what the original author wanted, perhaps they wanted
it to error out. It looks intentional. Clearly they didn't think of randconfig
though.

Or get a compiler that supports stack protection?

-Andi

2014-07-03 00:37:39

by Randy Dunlap

[permalink] [raw]
Subject: Re: mmotm 2014-07-02-15-07 uploaded (stack protector)

On 07/02/14 17:22, Andi Kleen wrote:
> On Wed, Jul 02, 2014 at 04:21:06PM -0700, Randy Dunlap wrote:
>> On 07/02/14 15:08, [email protected] wrote:
>>> The mm-of-the-moment snapshot 2014-07-02-15-07 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.
>>
>> Hi Andi,
>>
>> Here is an extract from 10 randconfig builds:
>>
>>
>> $ grep STACKPROTECTOR_STRONG config-r*
>> config-r8735:CONFIG_CC_STACKPROTECTOR_STRONG=y
>> config-r8736:CONFIG_CC_STACKPROTECTOR_STRONG=y
>> config-r8737:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
>> config-r8738:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
>> config-r8739:CONFIG_CC_STACKPROTECTOR_STRONG=y
>> config-r8740:CONFIG_CC_STACKPROTECTOR_STRONG=y
>> config-r8741:CONFIG_CC_STACKPROTECTOR_STRONG=y
>> config-r8742:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
>> config-r8743:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
>> config-r8744:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
>>
>>
>> but the captured output for each one says:
>>
>> grep STACKPROTECTOR_STRONG build*.out
>> build-r8735.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>> build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>> build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>> build-r8737.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>> build-r8739.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>> build-r8740.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>> build-r8740.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>> build-r8741.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>> build-r8741.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>> build-r8742.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>>
>>
>> then the build goes on to produce many errors like this one:
>>
>> CC init/do_mounts.o
>> gcc: error: unrecognized command line option '-fstack-protector-strong'
>>
>>
>> Can you explain this, please? or even better yet, fix it.
>
> That's the code
>
> ifdef CONFIG_CC_STACKPROTECTOR_STRONG
> stackp-flag := -fstack-protector-strong
> ifeq ($(call cc-option, $(stackp-flag)),)
> $(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \
> -fstack-protector-strong not supported by compiler)
> endif
> else
> # Force off for distro compilers that enable stack protector by default.
> stackp-flag := $(call cc-option, -fno-stack-protector)
> endif
> endif
> KBUILD_CFLAGS += $(stackp-flag)
>
> So -fstack-protector-strong itself is never protected by a cc-option call.

ouch.

> You could add it to the stack-flag line, then it would only warn.
>
> stackp-flag := $(call cc-option, -fstack-protector-strong)
>
> It's hard to tell what the original author wanted, perhaps they wanted
> it to error out. It looks intentional. Clearly they didn't think of randconfig
> though.
>
> Or get a compiler that supports stack protection?

Yeah, I have plans to upgrade, just been too busy.

thanks for your help.
--
~Randy

2014-07-03 00:51:44

by Kees Cook

[permalink] [raw]
Subject: Re: mmotm 2014-07-02-15-07 uploaded (stack protector)

On Wed, Jul 02, 2014 at 05:22:31PM -0700, Andi Kleen wrote:
> On Wed, Jul 02, 2014 at 04:21:06PM -0700, Randy Dunlap wrote:
> > On 07/02/14 15:08, [email protected] wrote:
> > > The mm-of-the-moment snapshot 2014-07-02-15-07 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.
> >
> > Hi Andi,
> >
> > Here is an extract from 10 randconfig builds:
> >
> >
> > $ grep STACKPROTECTOR_STRONG config-r*
> > config-r8735:CONFIG_CC_STACKPROTECTOR_STRONG=y
> > config-r8736:CONFIG_CC_STACKPROTECTOR_STRONG=y
> > config-r8737:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
> > config-r8738:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
> > config-r8739:CONFIG_CC_STACKPROTECTOR_STRONG=y
> > config-r8740:CONFIG_CC_STACKPROTECTOR_STRONG=y
> > config-r8741:CONFIG_CC_STACKPROTECTOR_STRONG=y
> > config-r8742:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
> > config-r8743:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
> > config-r8744:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
> >
> >
> > but the captured output for each one says:
> >
> > grep STACKPROTECTOR_STRONG build*.out
> > build-r8735.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> > build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> > build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> > build-r8737.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> > build-r8739.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> > build-r8740.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> > build-r8740.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> > build-r8741.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> > build-r8741.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> > build-r8742.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> >
> >
> > then the build goes on to produce many errors like this one:
> >
> > CC init/do_mounts.o
> > gcc: error: unrecognized command line option '-fstack-protector-strong'
> >
> >
> > Can you explain this, please? or even better yet, fix it.
>
> That's the code
>
> ifdef CONFIG_CC_STACKPROTECTOR_STRONG
> stackp-flag := -fstack-protector-strong
> ifeq ($(call cc-option, $(stackp-flag)),)
> $(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \
> -fstack-protector-strong not supported by compiler)
> endif
> else
> # Force off for distro compilers that enable stack protector by default.
> stackp-flag := $(call cc-option, -fno-stack-protector)
> endif
> endif
> KBUILD_CFLAGS += $(stackp-flag)
>
> So -fstack-protector-strong itself is never protected by a cc-option call.
>
> You could add it to the stack-flag line, then it would only warn.
>
> stackp-flag := $(call cc-option, -fstack-protector-strong)
>
> It's hard to tell what the original author wanted, perhaps they wanted
> it to error out. It looks intentional. Clearly they didn't think of randconfig
> though.

The problem is that if you make kbuild hard-fail when selecting this missing
compiler option, you can never switch it back because "make menuconfig" will
refuse to build since the compiler option would be missing. Being silent
about the missing option (and/or falling back to other options) means that
you could get two different kernel features selection with the same CONFIG_*
set, depending on the kernel, which is extremely bad ("I selected
stack-protector-strong but it built without it?!").

So, the middle ground was to warn about it during the kbuild logic so
you could find the source of the problem, but ultimately fail the build
when the compiler doesn't support it so there weren't any silent failure
modes.

-Kees

--
Kees Cook @outflux.net

2014-07-03 00:57:03

by Andrew Morton

[permalink] [raw]
Subject: Re: mmotm 2014-07-02-15-07 uploaded (stack protector)

On Wed, 2 Jul 2014 17:51:00 -0700 Kees Cook <[email protected]> wrote:

> > It's hard to tell what the original author wanted, perhaps they wanted
> > it to error out. It looks intentional. Clearly they didn't think of randconfig
> > though.
>
> The problem is that if you make kbuild hard-fail when selecting this missing
> compiler option, you can never switch it back because "make menuconfig" will
> refuse to build since the compiler option would be missing. Being silent
> about the missing option (and/or falling back to other options) means that
> you could get two different kernel features selection with the same CONFIG_*
> set, depending on the kernel, which is extremely bad ("I selected
> stack-protector-strong but it built without it?!").
>
> So, the middle ground was to warn about it during the kbuild logic so
> you could find the source of the problem, but ultimately fail the build
> when the compiler doesn't support it so there weren't any silent failure
> modes.

--- a/Makefile~a
+++ a/Makefile
@@ -630,6 +630,9 @@ KBUILD_CFLAGS += $(call cc-option,-Wfram
endif

# Handle stack protector mode.
+#
+# This space reserved for Kees
+#
ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
stackp-flag := -fstack-protector
ifeq ($(call cc-option, $(stackp-flag)),)
_

2014-07-03 00:57:48

by Kees Cook

[permalink] [raw]
Subject: Re: mmotm 2014-07-02-15-07 uploaded (stack protector)

Hi Randy,

And to explain more specifically what's happening:

On Wed, Jul 02, 2014 at 04:21:06PM -0700, Randy Dunlap wrote:
> config-r8736:CONFIG_CC_STACKPROTECTOR_STRONG=y
> [...]
> build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
> gcc: error: unrecognized command line option '-fstack-protector-strong'

That makes sense: a feature that requires a specific compiler version was
chosen, so you get a warning and a failed build. (The first warning was
during the .config parsing pass, the second warning was during the binary
build pass.)

> config-r8737:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
> [...]
> build-r8737.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler

This is the same issue: the prior .config was still there with STRONG set,
but after finishing the new .config parsing pass, everything is happy for
the binary build pass. And, I assume, the r8737 didn't fail to build.

The trouble seems to be how kbuild handle .config changes, but I was never
able to sort it out.

-Kees

--
Kees Cook @outflux.net

2014-07-03 01:00:29

by Andi Kleen

[permalink] [raw]
Subject: Re: mmotm 2014-07-02-15-07 uploaded (stack protector)

> The problem is that if you make kbuild hard-fail when selecting this missing
> compiler option, you can never switch it back because "make menuconfig" will
> refuse to build since the compiler option would be missing. Being silent
> about the missing option (and/or falling back to other options) means that
> you could get two different kernel features selection with the same CONFIG_*
> set, depending on the kernel, which is extremely bad ("I selected
> stack-protector-strong but it built without it?!").

The assumption that every flag in a .config has been consciouscly
selected by a human is a quite dubious one ...

LTO just turns itself off if the toolchain doesn't support it.

> So, the middle ground was to warn about it during the kbuild logic so
> you could find the source of the problem, but ultimately fail the build
> when the compiler doesn't support it so there weren't any silent failure
> modes.

Longer term it would be of course best to move all the cc-options
probing into Kconfig. I bet that would speed up builds too.

-Andi

2014-07-03 01:12:07

by Kees Cook

[permalink] [raw]
Subject: [PATCH] kbuild: explain stack-protector-strong CONFIG logic

This adds a hopefully helpful comment above the (seemingly weird)
compiler flag selection logic.

Suggested-by: Andrew Morton <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
---
Makefile | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/Makefile b/Makefile
index 13175632137f..ea88e68d121e 100644
--- a/Makefile
+++ b/Makefile
@@ -630,6 +630,22 @@ KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
endif

# Handle stack protector mode.
+#
+# Since kbuild can potentially perform two passes (first with the old
+# .config values and then with updated .config values), we cannot error out
+# if a desired compiler option is unsupported. If we were to error, kbuild
+# could never get to the second pass and actually notice that we changed
+# the option to something that was supported.
+#
+# Additionally, we don't want to fallback and/or silently change which compiler
+# flags will be used, since that leads to producing kernels with different
+# security feature characteristics depending on the compiler used. ("But I
+# selected CC_STACKPROTECTOR_STRONG! Why did it build with _REGULAR?!")
+#
+# The middle ground is to warn here so that the failed option is obvious, but
+# to let the build fail with bad compiler flags so that we can't produce a
+# kernel when there is a CONFIG and compiler mismatch.
+#
ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
stackp-flag := -fstack-protector
ifeq ($(call cc-option, $(stackp-flag)),)
--
1.7.9.5


--
Kees Cook
Chrome OS Security

2014-07-03 01:13:35

by Kees Cook

[permalink] [raw]
Subject: Re: mmotm 2014-07-02-15-07 uploaded (stack protector)

On Wed, Jul 02, 2014 at 06:00:19PM -0700, Andi Kleen wrote:
> > The problem is that if you make kbuild hard-fail when selecting this missing
> > compiler option, you can never switch it back because "make menuconfig" will
> > refuse to build since the compiler option would be missing. Being silent
> > about the missing option (and/or falling back to other options) means that
> > you could get two different kernel features selection with the same CONFIG_*
> > set, depending on the kernel, which is extremely bad ("I selected
> > stack-protector-strong but it built without it?!").
>
> The assumption that every flag in a .config has been consciouscly
> selected by a human is a quite dubious one ...

Sure; it was actually via automated config updates that I uncovered this
limitation of kbuild in the first place.

> LTO just turns itself off if the toolchain doesn't support it.

For this situation, it is more surprising to have this option fall back,
since it is a security feature selection. The build must fail in some way if
compiler doesn't match CONFIG.

> > So, the middle ground was to warn about it during the kbuild logic so
> > you could find the source of the problem, but ultimately fail the build
> > when the compiler doesn't support it so there weren't any silent failure
> > modes.
>
> Longer term it would be of course best to move all the cc-options
> probing into Kconfig. I bet that would speed up builds too.

Absolutely. I presently lack the deep knowledge to figure this out. :)

-Kees

--
Kees Cook @outflux.net

2014-07-03 01:42:56

by Randy Dunlap

[permalink] [raw]
Subject: Re: mmotm 2014-07-02-15-07 uploaded (stack protector)

On 07/02/14 17:57, Kees Cook wrote:
> Hi Randy,
>
> And to explain more specifically what's happening:
>
> On Wed, Jul 02, 2014 at 04:21:06PM -0700, Randy Dunlap wrote:
>> config-r8736:CONFIG_CC_STACKPROTECTOR_STRONG=y
>> [...]
>> build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>> build-r8736.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>> gcc: error: unrecognized command line option '-fstack-protector-strong'
>
> That makes sense: a feature that requires a specific compiler version was
> chosen, so you get a warning and a failed build. (The first warning was
> during the .config parsing pass, the second warning was during the binary
> build pass.)
>
>> config-r8737:# CONFIG_CC_STACKPROTECTOR_STRONG is not set
>> [...]
>> build-r8737.out:/local/lnx/MM/mmotm-2014-0702-1507/Makefile:662: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
>
> This is the same issue: the prior .config was still there with STRONG set,
> but after finishing the new .config parsing pass, everything is happy for
> the binary build pass. And, I assume, the r8737 didn't fail to build.

True, r8737 built successfully.

Maybe I should use 'make mrproper' instead of 'make clean' between each randconfig
build.

Thanks.

>
> The trouble seems to be how kbuild handle .config changes, but I was never
> able to sort it out.


--
~Randy