diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2014-01-17 12:34:34 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-01-17 12:34:34 -0500 |
commit | 2692170fcef8753937e6219ded744a4a52d2a5e1 (patch) | |
tree | 37e94d196764edcbad8f1d4e6f5d2893fffcbdfa | |
parent | Grsec/PaX: 3.0-{3.2.54,3.12.7}-201401091837 (diff) | |
download | hardened-patchset-2692170fcef8753937e6219ded744a4a52d2a5e1.tar.gz hardened-patchset-2692170fcef8753937e6219ded744a4a52d2a5e1.tar.bz2 hardened-patchset-2692170fcef8753937e6219ded744a4a52d2a5e1.zip |
Grsec/PaX: 3.0-{3.2.54,3.12.7}-201401131812
-rw-r--r-- | 3.12.7/0000_README | 2 | ||||
-rw-r--r-- | 3.12.7/4420_grsecurity-3.0-3.12.7-201401131812.patch (renamed from 3.12.7/4420_grsecurity-3.0-3.12.7-201401091837.patch) | 218 | ||||
-rw-r--r-- | 3.2.54/0000_README | 2 | ||||
-rw-r--r-- | 3.2.54/4420_grsecurity-3.0-3.2.54-201401160931.patch (renamed from 3.2.54/4420_grsecurity-3.0-3.2.54-201401091839.patch) | 373 |
4 files changed, 393 insertions, 202 deletions
diff --git a/3.12.7/0000_README b/3.12.7/0000_README index 298b491..6d218ae 100644 --- a/3.12.7/0000_README +++ b/3.12.7/0000_README @@ -2,7 +2,7 @@ README ----------------------------------------------------------------------------- Individual Patch Descriptions: ----------------------------------------------------------------------------- -Patch: 4420_grsecurity-3.0-3.12.7-201401091837.patch +Patch: 4420_grsecurity-3.0-3.12.7-201401131812.patch From: http://www.grsecurity.net Desc: hardened-sources base patch from upstream grsecurity diff --git a/3.12.7/4420_grsecurity-3.0-3.12.7-201401091837.patch b/3.12.7/4420_grsecurity-3.0-3.12.7-201401131812.patch index 923bea4..ef22dd5 100644 --- a/3.12.7/4420_grsecurity-3.0-3.12.7-201401091837.patch +++ b/3.12.7/4420_grsecurity-3.0-3.12.7-201401131812.patch @@ -42936,6 +42936,21 @@ index 3d13a63..da31bf1 100644 .release = mxr_vp_layer_release, .buffer_set = mxr_vp_buffer_set, .stream_set = mxr_vp_stream_set, +diff --git a/drivers/media/platform/vivi.c b/drivers/media/platform/vivi.c +index 1d3f119..75f40bb 100644 +--- a/drivers/media/platform/vivi.c ++++ b/drivers/media/platform/vivi.c +@@ -58,8 +58,8 @@ MODULE_AUTHOR("Mauro Carvalho Chehab, Ted Walther and John Sokol"); + MODULE_LICENSE("Dual BSD/GPL"); + MODULE_VERSION(VIVI_VERSION); + +-static unsigned video_nr = -1; +-module_param(video_nr, uint, 0644); ++static int video_nr = -1; ++module_param(video_nr, int, 0644); + MODULE_PARM_DESC(video_nr, "videoX start number, -1 is autodetect"); + + static unsigned n_devs = 1; diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c index 545c04c..a14bded 100644 --- a/drivers/media/radio/radio-cadet.c @@ -53501,7 +53516,7 @@ index 89dec7f..361b0d75 100644 fd_offset + ex.a_text); if (error != N_DATADDR(ex)) { diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c -index 4c94a79..228e9da 100644 +index 4c94a79..2610454 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -34,6 +34,7 @@ @@ -53670,7 +53685,7 @@ index 4c94a79..228e9da 100644 } error = load_addr; -@@ -538,6 +569,322 @@ out: +@@ -538,6 +569,315 @@ out: return error; } @@ -53904,41 +53919,34 @@ index 4c94a79..228e9da 100644 + unsigned long pax_flags_hardmode = 0UL, pax_flags_softmode = 0UL; + + xattr_size = pax_getxattr(file->f_path.dentry, xattr_value, sizeof xattr_value); -+ switch (xattr_size) { -+ default: ++ if (xattr_size <= 0 || xattr_size > sizeof xattr_value) + return ~0UL; + -+ case -ENODATA: -+ break; -+ -+ case 0 ... sizeof xattr_value: -+ for (i = 0; i < xattr_size; i++) -+ switch (xattr_value[i]) { -+ default: -+ return ~0UL; -+ -+#define parse_flag(option1, option2, flag) \ -+ case option1: \ -+ if (pax_flags_hardmode & MF_PAX_##flag) \ -+ return ~0UL; \ -+ pax_flags_hardmode |= MF_PAX_##flag; \ -+ break; \ -+ case option2: \ -+ if (pax_flags_softmode & MF_PAX_##flag) \ -+ return ~0UL; \ -+ pax_flags_softmode |= MF_PAX_##flag; \ -+ break; ++ for (i = 0; i < xattr_size; i++) ++ switch (xattr_value[i]) { ++ default: ++ return ~0UL; ++ ++#define parse_flag(option1, option2, flag) \ ++ case option1: \ ++ if (pax_flags_hardmode & MF_PAX_##flag) \ ++ return ~0UL; \ ++ pax_flags_hardmode |= MF_PAX_##flag; \ ++ break; \ ++ case option2: \ ++ if (pax_flags_softmode & MF_PAX_##flag) \ ++ return ~0UL; \ ++ pax_flags_softmode |= MF_PAX_##flag; \ ++ break; + -+ parse_flag('p', 'P', PAGEEXEC); -+ parse_flag('e', 'E', EMUTRAMP); -+ parse_flag('m', 'M', MPROTECT); -+ parse_flag('r', 'R', RANDMMAP); -+ parse_flag('s', 'S', SEGMEXEC); ++ parse_flag('p', 'P', PAGEEXEC); ++ parse_flag('e', 'E', EMUTRAMP); ++ parse_flag('m', 'M', MPROTECT); ++ parse_flag('r', 'R', RANDMMAP); ++ parse_flag('s', 'S', SEGMEXEC); + +#undef parse_flag -+ } -+ break; -+ } ++ } + + if (pax_flags_hardmode & pax_flags_softmode) + return ~0UL; @@ -53993,7 +54001,7 @@ index 4c94a79..228e9da 100644 /* * These are the functions used to load ELF style executables and shared * libraries. There is no binary dependent code anywhere else. -@@ -554,6 +901,11 @@ static unsigned long randomize_stack_top(unsigned long stack_top) +@@ -554,6 +894,11 @@ static unsigned long randomize_stack_top(unsigned long stack_top) { unsigned int random_variable = 0; @@ -54005,7 +54013,7 @@ index 4c94a79..228e9da 100644 if ((current->flags & PF_RANDOMIZE) && !(current->personality & ADDR_NO_RANDOMIZE)) { random_variable = get_random_int() & STACK_RND_MASK; -@@ -572,7 +924,7 @@ static int load_elf_binary(struct linux_binprm *bprm) +@@ -572,7 +917,7 @@ static int load_elf_binary(struct linux_binprm *bprm) unsigned long load_addr = 0, load_bias = 0; int load_addr_set = 0; char * elf_interpreter = NULL; @@ -54014,7 +54022,7 @@ index 4c94a79..228e9da 100644 struct elf_phdr *elf_ppnt, *elf_phdata; unsigned long elf_bss, elf_brk; int retval, i; -@@ -582,12 +934,12 @@ static int load_elf_binary(struct linux_binprm *bprm) +@@ -582,12 +927,12 @@ static int load_elf_binary(struct linux_binprm *bprm) unsigned long start_code, end_code, start_data, end_data; unsigned long reloc_func_desc __maybe_unused = 0; int executable_stack = EXSTACK_DEFAULT; @@ -54028,7 +54036,7 @@ index 4c94a79..228e9da 100644 loc = kmalloc(sizeof(*loc), GFP_KERNEL); if (!loc) { -@@ -723,11 +1075,82 @@ static int load_elf_binary(struct linux_binprm *bprm) +@@ -723,11 +1068,82 @@ static int load_elf_binary(struct linux_binprm *bprm) goto out_free_dentry; /* OK, This is the point of no return */ @@ -54112,7 +54120,7 @@ index 4c94a79..228e9da 100644 if (elf_read_implies_exec(loc->elf_ex, executable_stack)) current->personality |= READ_IMPLIES_EXEC; -@@ -817,6 +1240,20 @@ static int load_elf_binary(struct linux_binprm *bprm) +@@ -817,6 +1233,20 @@ static int load_elf_binary(struct linux_binprm *bprm) #else load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr); #endif @@ -54133,7 +54141,7 @@ index 4c94a79..228e9da 100644 } error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt, -@@ -849,9 +1286,9 @@ static int load_elf_binary(struct linux_binprm *bprm) +@@ -849,9 +1279,9 @@ static int load_elf_binary(struct linux_binprm *bprm) * allowed task size. Note that p_filesz must always be * <= p_memsz so it is only necessary to check p_memsz. */ @@ -54146,7 +54154,7 @@ index 4c94a79..228e9da 100644 /* set_brk can never work. Avoid overflows. */ send_sig(SIGKILL, current, 0); retval = -EINVAL; -@@ -890,17 +1327,45 @@ static int load_elf_binary(struct linux_binprm *bprm) +@@ -890,17 +1320,45 @@ static int load_elf_binary(struct linux_binprm *bprm) goto out_free_dentry; } if (likely(elf_bss != elf_brk) && unlikely(padzero(elf_bss))) { @@ -54198,7 +54206,7 @@ index 4c94a79..228e9da 100644 load_bias); if (!IS_ERR((void *)elf_entry)) { /* -@@ -1122,7 +1587,7 @@ static bool always_dump_vma(struct vm_area_struct *vma) +@@ -1122,7 +1580,7 @@ static bool always_dump_vma(struct vm_area_struct *vma) * Decide what to dump of a segment, part, all or none. */ static unsigned long vma_dump_size(struct vm_area_struct *vma, @@ -54207,7 +54215,7 @@ index 4c94a79..228e9da 100644 { #define FILTER(type) (mm_flags & (1UL << MMF_DUMP_##type)) -@@ -1160,7 +1625,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma, +@@ -1160,7 +1618,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma, if (vma->vm_file == NULL) return 0; @@ -54216,7 +54224,7 @@ index 4c94a79..228e9da 100644 goto whole; /* -@@ -1385,9 +1850,9 @@ static void fill_auxv_note(struct memelfnote *note, struct mm_struct *mm) +@@ -1385,9 +1843,9 @@ static void fill_auxv_note(struct memelfnote *note, struct mm_struct *mm) { elf_addr_t *auxv = (elf_addr_t *) mm->saved_auxv; int i = 0; @@ -54228,7 +54236,7 @@ index 4c94a79..228e9da 100644 fill_note(note, "CORE", NT_AUXV, i * sizeof(elf_addr_t), auxv); } -@@ -1396,7 +1861,7 @@ static void fill_siginfo_note(struct memelfnote *note, user_siginfo_t *csigdata, +@@ -1396,7 +1854,7 @@ static void fill_siginfo_note(struct memelfnote *note, user_siginfo_t *csigdata, { mm_segment_t old_fs = get_fs(); set_fs(KERNEL_DS); @@ -54237,7 +54245,7 @@ index 4c94a79..228e9da 100644 set_fs(old_fs); fill_note(note, "CORE", NT_SIGINFO, sizeof(*csigdata), csigdata); } -@@ -2023,14 +2488,14 @@ static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum, +@@ -2023,14 +2481,14 @@ static void fill_extnum_info(struct elfhdr *elf, struct elf_shdr *shdr4extnum, } static size_t elf_core_vma_data_size(struct vm_area_struct *gate_vma, @@ -54254,7 +54262,7 @@ index 4c94a79..228e9da 100644 return size; } -@@ -2123,7 +2588,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2123,7 +2581,7 @@ static int elf_core_dump(struct coredump_params *cprm) dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE); @@ -54263,7 +54271,7 @@ index 4c94a79..228e9da 100644 offset += elf_core_extra_data_size(); e_shoff = offset; -@@ -2137,10 +2602,12 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2137,10 +2595,12 @@ static int elf_core_dump(struct coredump_params *cprm) offset = dataoff; size += sizeof(*elf); @@ -54276,7 +54284,7 @@ index 4c94a79..228e9da 100644 if (size > cprm->limit || !dump_write(cprm->file, phdr4note, sizeof(*phdr4note))) goto end_coredump; -@@ -2154,7 +2621,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2154,7 +2614,7 @@ static int elf_core_dump(struct coredump_params *cprm) phdr.p_offset = offset; phdr.p_vaddr = vma->vm_start; phdr.p_paddr = 0; @@ -54285,7 +54293,7 @@ index 4c94a79..228e9da 100644 phdr.p_memsz = vma->vm_end - vma->vm_start; offset += phdr.p_filesz; phdr.p_flags = vma->vm_flags & VM_READ ? PF_R : 0; -@@ -2165,6 +2632,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2165,6 +2625,7 @@ static int elf_core_dump(struct coredump_params *cprm) phdr.p_align = ELF_EXEC_PAGESIZE; size += sizeof(phdr); @@ -54293,7 +54301,7 @@ index 4c94a79..228e9da 100644 if (size > cprm->limit || !dump_write(cprm->file, &phdr, sizeof(phdr))) goto end_coredump; -@@ -2189,7 +2657,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2189,7 +2650,7 @@ static int elf_core_dump(struct coredump_params *cprm) unsigned long addr; unsigned long end; @@ -54302,7 +54310,7 @@ index 4c94a79..228e9da 100644 for (addr = vma->vm_start; addr < end; addr += PAGE_SIZE) { struct page *page; -@@ -2198,6 +2666,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2198,6 +2659,7 @@ static int elf_core_dump(struct coredump_params *cprm) page = get_dump_page(addr); if (page) { void *kaddr = kmap(page); @@ -54310,7 +54318,7 @@ index 4c94a79..228e9da 100644 stop = ((size += PAGE_SIZE) > cprm->limit) || !dump_write(cprm->file, kaddr, PAGE_SIZE); -@@ -2215,6 +2684,7 @@ static int elf_core_dump(struct coredump_params *cprm) +@@ -2215,6 +2677,7 @@ static int elf_core_dump(struct coredump_params *cprm) if (e_phnum == PN_XNUM) { size += sizeof(*shdr4extnum); @@ -54318,7 +54326,7 @@ index 4c94a79..228e9da 100644 if (size > cprm->limit || !dump_write(cprm->file, shdr4extnum, sizeof(*shdr4extnum))) -@@ -2235,6 +2705,167 @@ out: +@@ -2235,6 +2698,167 @@ out: #endif /* CONFIG_ELF_CORE */ @@ -103344,10 +103352,10 @@ index 0000000..679b9ef +} diff --git a/tools/gcc/size_overflow_hash.data b/tools/gcc/size_overflow_hash.data new file mode 100644 -index 0000000..afbbf8f +index 0000000..3d6cc0f --- /dev/null +++ b/tools/gcc/size_overflow_hash.data -@@ -0,0 +1,7725 @@ +@@ -0,0 +1,7743 @@ +intel_fake_agp_alloc_by_type_1 intel_fake_agp_alloc_by_type 1 1 NULL +ocfs2_get_refcount_tree_3 ocfs2_get_refcount_tree 0 3 NULL +batadv_orig_node_del_if_4 batadv_orig_node_del_if 2 4 NULL @@ -103651,6 +103659,7 @@ index 0000000..afbbf8f +set_msr_hyperv_pw_2785 set_msr_hyperv_pw 3 2785 NULL +device_add_attrs_2789 device_add_attrs 0 2789 NULL +iwl_dbgfs_clear_ucode_statistics_write_2804 iwl_dbgfs_clear_ucode_statistics_write 3 2804 NULL ++vmemmap_pte_populate_2822 vmemmap_pte_populate 3 2822 NULL +sel_read_enforce_2828 sel_read_enforce 3 2828 NULL +vb2_dc_get_userptr_2829 vb2_dc_get_userptr 2-3 2829 NULL nohasharray +snd_pcm_reset_2829 snd_pcm_reset 0 2829 &vb2_dc_get_userptr_2829 @@ -103694,7 +103703,7 @@ index 0000000..afbbf8f +ocfs2_get_right_path_3097 ocfs2_get_right_path 0 3097 NULL +clone_bio_3100 clone_bio 6 3100 NULL nohasharray +ttusb2_msg_3100 ttusb2_msg 4 3100 &clone_bio_3100 -+rb_alloc_3102 rb_alloc 1 3102 NULL ++rb_alloc_3102 rb_alloc 1-3 3102 NULL +simple_write_to_buffer_3122 simple_write_to_buffer 2-5 3122 NULL +print_time_3132 print_time 0 3132 NULL +fill_write_buffer_3142 fill_write_buffer 3 3142 NULL @@ -103813,6 +103822,7 @@ index 0000000..afbbf8f +ext4_xattr_find_entry_4025 ext4_xattr_find_entry 0 4025 NULL +mtip_hw_read_registers_4037 mtip_hw_read_registers 3 4037 NULL +i915_gpu_idle_4062 i915_gpu_idle 0 4062 NULL ++vmemmap_pmd_populate_4071 vmemmap_pmd_populate 3 4071 NULL +read_file_queues_4078 read_file_queues 3 4078 NULL +fbcon_do_set_font_4079 fbcon_do_set_font 2-3 4079 NULL +btrfs_inc_ref_4084 btrfs_inc_ref 0 4084 NULL @@ -104407,6 +104417,7 @@ index 0000000..afbbf8f +sparse_early_usemaps_alloc_node_9269 sparse_early_usemaps_alloc_node 4 9269 NULL +hdpvr_read_9273 hdpvr_read 3 9273 NULL +flakey_status_9274 flakey_status 5 9274 NULL ++migrate_misplaced_transhuge_page_9298 migrate_misplaced_transhuge_page 7 9298 NULL +iwl_dbgfs_stations_read_9309 iwl_dbgfs_stations_read 3 9309 NULL +ceph_sync_setxattr_9310 ceph_sync_setxattr 4 9310 NULL +ieee80211_if_fmt_txpower_9334 ieee80211_if_fmt_txpower 3 9334 NULL @@ -104730,6 +104741,7 @@ index 0000000..afbbf8f +ecryptfs_copy_filename_11868 ecryptfs_copy_filename 4 11868 NULL +ieee80211_rx_bss_info_11887 ieee80211_rx_bss_info 3 11887 NULL +mdc_rename_11899 mdc_rename 4-6 11899 NULL ++perf_mmap_alloc_page_11904 perf_mmap_alloc_page 1 11904 NULL +xstateregs_get_11906 xstateregs_get 4 11906 NULL +ti_write_11916 ti_write 4 11916 NULL +fs_devrw_entry_11924 fs_devrw_entry 3 11924 NULL @@ -104819,7 +104831,7 @@ index 0000000..afbbf8f +rtw_android_get_link_speed_12655 rtw_android_get_link_speed 0 12655 NULL +ocfs2_read_block_12659 ocfs2_read_block 0 12659 NULL +sel_read_class_12669 sel_read_class 3 12669 NULL nohasharray -+sparse_mem_maps_populate_node_12669 sparse_mem_maps_populate_node 4 12669 &sel_read_class_12669 ++sparse_mem_maps_populate_node_12669 sparse_mem_maps_populate_node 4-5 12669 &sel_read_class_12669 +ext4_writepage_trans_blocks_12674 ext4_writepage_trans_blocks 0 12674 NULL +ext4_bg_num_gdb_meta_12702 ext4_bg_num_gdb_meta 0 12702 NULL +iwl_dbgfs_calib_disabled_write_12707 iwl_dbgfs_calib_disabled_write 3 12707 NULL @@ -105554,6 +105566,7 @@ index 0000000..afbbf8f +SyS_lsetxattr_18776 SyS_lsetxattr 4 18776 NULL +alloc_fcdev_18780 alloc_fcdev 1 18780 NULL +prealloc_18800 prealloc 0 18800 NULL ++alloc_pages_node_18809 alloc_pages_node 1 18809 NULL +madvise_hwpoison_18812 madvise_hwpoison 2 18812 NULL +setup_ioapic_irq_18813 setup_ioapic_irq 1 18813 NULL +dm_stats_print_18815 dm_stats_print 7 18815 NULL @@ -106113,6 +106126,7 @@ index 0000000..afbbf8f +iscsi_change_queue_depth_23416 iscsi_change_queue_depth 2 23416 NULL +vga_mm_r_23419 vga_mm_r 0 23419 NULL +vzalloc_node_23424 vzalloc_node 1-2 23424 NULL ++vmemmap_populate_basepages_23435 vmemmap_populate_basepages 3 23435 NULL +__ctzsi2_23444 __ctzsi2 1 23444 NULL +ocfs2_zero_tail_23447 ocfs2_zero_tail 3 23447 NULL +hidraw_send_report_23449 hidraw_send_report 3 23449 NULL @@ -106386,6 +106400,7 @@ index 0000000..afbbf8f +aircable_prepare_write_buffer_25669 aircable_prepare_write_buffer 3 25669 NULL +lpfc_idiag_cmd_get_25672 lpfc_idiag_cmd_get 2 25672 NULL +sta_inactive_ms_read_25690 sta_inactive_ms_read 3 25690 NULL ++sparse_mem_map_populate_25693 sparse_mem_map_populate 2 25693 NULL +ebitmap_start_positive_25703 ebitmap_start_positive 0 25703 NULL +wl1271_tx_enabled_rates_get_25712 wl1271_tx_enabled_rates_get 0 25712 NULL nohasharray +rx_filter_mc_filter_read_25712 rx_filter_mc_filter_read 3 25712 &wl1271_tx_enabled_rates_get_25712 @@ -106581,6 +106596,7 @@ index 0000000..afbbf8f +ocfs2_refcount_cal_cow_clusters_27422 ocfs2_refcount_cal_cow_clusters 0-3-4 27422 NULL nohasharray +evm_inode_init_security_27422 evm_inode_init_security 0 27422 &ocfs2_refcount_cal_cow_clusters_27422 +cypress_write_27423 cypress_write 4 27423 NULL ++vmemmap_populate_27442 vmemmap_populate 3 27442 NULL +sddr09_read_data_27447 sddr09_read_data 3 27447 NULL +ktime_to_us_27455 ktime_to_us 0 27455 NULL +sk_extract_addr_27474 sk_extract_addr 0 27474 NULL @@ -107466,6 +107482,7 @@ index 0000000..afbbf8f +ntfs_attr_extend_initialized_35084 ntfs_attr_extend_initialized 2 35084 NULL +store_ifalias_35088 store_ifalias 4 35088 NULL +__kfifo_uint_must_check_helper_35097 __kfifo_uint_must_check_helper 0-1 35097 NULL ++alloc_thread_info_node_35101 alloc_thread_info_node 2 35101 NULL +capi_write_35104 capi_write 3 35104 NULL nohasharray +tx_tx_done_template_read_35104 tx_tx_done_template_read 3 35104 &capi_write_35104 +ide_settings_proc_write_35110 ide_settings_proc_write 3 35110 NULL @@ -107585,7 +107602,8 @@ index 0000000..afbbf8f +ieee80211_if_fmt_peer_36071 ieee80211_if_fmt_peer 3 36071 NULL +ext3_new_blocks_36073 ext3_new_blocks 3-0 36073 NULL +ieee80211_if_write_tsf_36077 ieee80211_if_write_tsf 3 36077 NULL -+snd_pcm_plug_read_transfer_36080 snd_pcm_plug_read_transfer 0-3 36080 NULL ++vmemmap_pud_populate_36080 vmemmap_pud_populate 3 36080 NULL nohasharray ++snd_pcm_plug_read_transfer_36080 snd_pcm_plug_read_transfer 0-3 36080 &vmemmap_pud_populate_36080 +mtip_hw_read_device_status_36082 mtip_hw_read_device_status 3 36082 NULL +vga_arb_write_36112 vga_arb_write 3 36112 NULL +simple_xattr_alloc_36118 simple_xattr_alloc 2 36118 NULL @@ -108224,6 +108242,7 @@ index 0000000..afbbf8f +xfs_iext_add_41422 xfs_iext_add 3 41422 NULL +isdn_ppp_fill_rq_41428 isdn_ppp_fill_rq 2 41428 NULL +lbs_rdrf_read_41431 lbs_rdrf_read 3 41431 NULL ++vmemmap_populate_hugepages_41434 vmemmap_populate_hugepages 3 41434 NULL +iio_device_alloc_41440 iio_device_alloc 1 41440 NULL +ntfs_file_buffered_write_41442 ntfs_file_buffered_write 6-4 41442 NULL +pcpu_build_alloc_info_41443 pcpu_build_alloc_info 1-2-3 41443 NULL @@ -108444,7 +108463,7 @@ index 0000000..afbbf8f +ath10k_p2p_calc_noa_ie_len_43209 ath10k_p2p_calc_noa_ie_len 0 43209 NULL +f2fs_acl_from_disk_43210 f2fs_acl_from_disk 2 43210 NULL +atomic_long_add_return_43217 atomic_long_add_return 1-0 43217 NULL -+vmemmap_alloc_block_43245 vmemmap_alloc_block 1 43245 NULL ++vmemmap_alloc_block_43245 vmemmap_alloc_block 1-2 43245 NULL +fixup_leb_43256 fixup_leb 3 43256 NULL +ide_end_rq_43269 ide_end_rq 4 43269 NULL +nilfs_direct_IO_43271 nilfs_direct_IO 4 43271 NULL @@ -108785,6 +108804,7 @@ index 0000000..afbbf8f +vb2_dma_sg_get_userptr_46146 vb2_dma_sg_get_userptr 2-3 46146 NULL +__netlink_change_ngroups_46156 __netlink_change_ngroups 2 46156 NULL +alloc_iova_46160 alloc_iova 2 46160 NULL ++kmalloc_section_memmap_46168 kmalloc_section_memmap 2 46168 NULL +twl_direction_out_46182 twl_direction_out 2 46182 NULL +vxge_os_dma_malloc_46184 vxge_os_dma_malloc 2 46184 NULL +fq_resize_46195 fq_resize 2 46195 NULL @@ -109128,7 +109148,8 @@ index 0000000..afbbf8f +aic7xxx_rem_scb_from_disc_list_49041 aic7xxx_rem_scb_from_disc_list 0 49041 NULL +setup_msi_irq_49052 setup_msi_irq 3-4 49052 NULL +ubi_read_49061 ubi_read 0 49061 NULL -+scsi_register_49094 scsi_register 2 49094 NULL ++sparse_early_nid_49094 sparse_early_nid 0 49094 NULL nohasharray ++scsi_register_49094 scsi_register 2 49094 &sparse_early_nid_49094 +paging64_walk_addr_nested_49100 paging64_walk_addr_nested 3 49100 NULL +compat_do_readv_writev_49102 compat_do_readv_writev 4 49102 NULL +xfrm_replay_state_esn_len_49119 xfrm_replay_state_esn_len 0 49119 NULL @@ -109687,6 +109708,7 @@ index 0000000..afbbf8f +dbAllocNext_53506 dbAllocNext 0 53506 NULL +ocfs2_xattr_set_acl_53508 ocfs2_xattr_set_acl 4 53508 NULL +check_acl_53512 check_acl 0 53512 NULL ++alloc_pages_exact_nid_53515 alloc_pages_exact_nid 1 53515 NULL +send_utimes_53516 send_utimes 0 53516 NULL +SYSC_bind_53582 SYSC_bind 3 53582 NULL +cifs_utf16_bytes_53593 cifs_utf16_bytes 0 53593 NULL @@ -109790,7 +109812,7 @@ index 0000000..afbbf8f +ll_ra_count_get_54410 ll_ra_count_get 3 54410 NULL +copy_gadget_strings_54417 copy_gadget_strings 3-2 54417 NULL +btrfs_inc_extent_ref_54442 btrfs_inc_extent_ref 0 54442 NULL -+sparse_early_mem_maps_alloc_node_54485 sparse_early_mem_maps_alloc_node 4 54485 NULL ++sparse_early_mem_maps_alloc_node_54485 sparse_early_mem_maps_alloc_node 4-5 54485 NULL +simple_strtoull_54493 simple_strtoull 0 54493 NULL +swiotlb_tbl_map_single_54495 swiotlb_tbl_map_single 0 54495 NULL +btrfs_ordered_sum_size_54509 btrfs_ordered_sum_size 0-2 54509 NULL @@ -110003,6 +110025,7 @@ index 0000000..afbbf8f +ocfs2_find_xe_in_bucket_56224 ocfs2_find_xe_in_bucket 0 56224 NULL +do_ipt_set_ctl_56238 do_ipt_set_ctl 4 56238 NULL +fd_copyin_56247 fd_copyin 3 56247 NULL ++svc_init_buffer_56249 svc_init_buffer 3 56249 NULL +sk_rmem_schedule_56255 sk_rmem_schedule 3 56255 NULL +p9pdu_vreadf_56271 p9pdu_vreadf 0 56271 NULL +il4965_ucode_general_stats_read_56277 il4965_ucode_general_stats_read 3 56277 NULL @@ -110248,7 +110271,7 @@ index 0000000..afbbf8f +ieee80211_if_read_dot11MeshTTL_58307 ieee80211_if_read_dot11MeshTTL 3 58307 NULL +i915_wait_seqno_58309 i915_wait_seqno 0 58309 NULL +tx_tx_start_int_templates_read_58324 tx_tx_start_int_templates_read 3 58324 NULL -+ext4_ext_truncate_extend_restart_58331 ext4_ext_truncate_extend_restart 3 58331 NULL ++ext4_ext_truncate_extend_restart_58331 ext4_ext_truncate_extend_restart 3-0 58331 NULL +diva_init_dma_map_58336 diva_init_dma_map 3 58336 NULL +__copy_from_user_swizzled_58337 __copy_from_user_swizzled 2-4 58337 NULL +next_pidmap_58347 next_pidmap 2-0 58347 NULL @@ -110379,6 +110402,7 @@ index 0000000..afbbf8f +btrfs_del_dir_entries_in_log_59490 btrfs_del_dir_entries_in_log 0 59490 NULL +ib_copy_from_udata_59502 ib_copy_from_udata 3 59502 NULL +rds_pin_pages_59507 rds_pin_pages 1-2 59507 NULL ++kmalloc_large_node_59542 kmalloc_large_node 3 59542 NULL +ext4_resize_fs_59543 ext4_resize_fs 2 59543 NULL +mpi_get_nbits_59551 mpi_get_nbits 0 59551 NULL +tunables_write_59563 tunables_write 3 59563 NULL @@ -110556,7 +110580,7 @@ index 0000000..afbbf8f +i40e_calculate_l2fpm_size_61104 i40e_calculate_l2fpm_size 0-1-2-3-4 61104 NULL +alloc_chrdev_region_61112 alloc_chrdev_region 0 61112 NULL +__probe_kernel_read_61119 __probe_kernel_read 3 61119 NULL -+vmemmap_alloc_block_buf_61126 vmemmap_alloc_block_buf 1 61126 NULL ++vmemmap_alloc_block_buf_61126 vmemmap_alloc_block_buf 1-2 61126 NULL +afs_proc_cells_write_61139 afs_proc_cells_write 3 61139 NULL +brcmf_sdio_chip_cr4_exitdl_61143 brcmf_sdio_chip_cr4_exitdl 4 61143 NULL +__vmalloc_61168 __vmalloc 1 61168 NULL @@ -110608,6 +110632,7 @@ index 0000000..afbbf8f +trace_options_core_write_61551 trace_options_core_write 3 61551 NULL +o2hb_pop_count_61553 o2hb_pop_count 2 61553 NULL +dvb_net_ioctl_61559 dvb_net_ioctl 2 61559 NULL ++alloc_pgtable_page_61562 alloc_pgtable_page 1 61562 NULL +parport_pc_fifo_write_block_dma_61568 parport_pc_fifo_write_block_dma 3 61568 NULL +fan_proc_write_61569 fan_proc_write 3 61569 NULL +ieee80211_if_read_rc_rateidx_mask_2ghz_61570 ieee80211_if_read_rc_rateidx_mask_2ghz 3 61570 NULL @@ -110702,6 +110727,7 @@ index 0000000..afbbf8f +sparse_early_usemaps_alloc_pgdat_section_62304 sparse_early_usemaps_alloc_pgdat_section 2 62304 NULL +ocfs2_find_victim_alloc_group_62306 ocfs2_find_victim_alloc_group 0 62306 NULL +subsystem_filter_read_62310 subsystem_filter_read 3 62310 NULL ++vmemmap_pgd_populate_62315 vmemmap_pgd_populate 2 62315 NULL +timespec_to_jiffies_62321 timespec_to_jiffies 0 62321 NULL +Wb35Reg_BurstWrite_62327 Wb35Reg_BurstWrite 4 62327 NULL +subseq_list_62332 subseq_list 3-0 62332 NULL @@ -111075,10 +111101,10 @@ index 0000000..afbbf8f +nvme_trans_standard_inquiry_page_65526 nvme_trans_standard_inquiry_page 4 65526 NULL diff --git a/tools/gcc/size_overflow_plugin.c b/tools/gcc/size_overflow_plugin.c new file mode 100644 -index 0000000..62a1ae8 +index 0000000..50f8464 --- /dev/null +++ b/tools/gcc/size_overflow_plugin.c -@@ -0,0 +1,4050 @@ +@@ -0,0 +1,4072 @@ +/* + * Copyright 2011, 2012, 2013, 2014 by Emese Revfy <re.emese@gmail.com> + * Licensed under the GPL v2, or (at your option) v3 @@ -111139,9 +111165,9 @@ index 0000000..62a1ae8 +#define MIN_CHECK true +#define MAX_CHECK false + -+#define TURN_OFF_ASM_STR "# size_overflow MARK_TURN_OFF\n\t" -+#define YES_ASM_STR "# size_overflow MARK_YES\n\t" -+#define OK_ASM_STR "# size_overflow\n\t" ++#define TURN_OFF_ASM_STR "# size_overflow MARK_TURN_OFF " ++#define YES_ASM_STR "# size_overflow MARK_YES " ++#define OK_ASM_STR "# size_overflow " + +#if BUILDING_GCC_VERSION == 4005 +#define DECL_CHAIN(NODE) (TREE_CHAIN(DECL_MINIMAL_CHECK(NODE))) @@ -111208,7 +111234,7 @@ index 0000000..62a1ae8 +static tree dup_assign(struct pointer_set_t *visited, gimple oldstmt, const_tree node, tree rhs1, tree rhs2, tree __unused rhs3); + +static struct plugin_info size_overflow_plugin_info = { -+ .version = "20140102beta", ++ .version = "20140111beta", + .help = "no-size-overflow\tturn off size overflow checking\n", +}; + @@ -113298,7 +113324,7 @@ index 0000000..62a1ae8 + str = get_asm_string(stmt); + if (!str) + return false; -+ return !strcmp(str, TURN_OFF_ASM_STR); ++ return !strncmp(str, TURN_OFF_ASM_STR, sizeof(TURN_OFF_ASM_STR) - 1); +} + +static bool is_size_overflow_intentional_asm_yes(const_gimple stmt) @@ -113308,7 +113334,7 @@ index 0000000..62a1ae8 + str = get_asm_string(stmt); + if (!str) + return false; -+ return !strcmp(str, YES_ASM_STR); ++ return !strncmp(str, YES_ASM_STR, sizeof(YES_ASM_STR) - 1); +} + +static bool is_size_overflow_asm(const_gimple stmt) @@ -113318,7 +113344,7 @@ index 0000000..62a1ae8 + str = get_asm_string(stmt); + if (!str) + return false; -+ return !strncmp(str, "# size_overflow", 15); ++ return !strncmp(str, OK_ASM_STR, sizeof(OK_ASM_STR) - 1); +} + +static void print_missing_intentional(enum mark callee_attr, enum mark caller_attr, const_tree decl, unsigned int argnum) @@ -114416,9 +114442,8 @@ index 0000000..62a1ae8 + + switch (cur_fndecl_attr) { + case MARK_NO: -+ return MARK_NO; + case MARK_TURN_OFF: -+ return MARK_TURN_OFF; ++ return cur_fndecl_attr; + default: + print_missing_intentional(decl_attr, cur_fndecl_attr, fndecl, argnum); + return MARK_YES; @@ -114558,6 +114583,23 @@ index 0000000..62a1ae8 + update_stmt(stmt); +} + ++static char *create_asm_comment(unsigned int argnum, const_gimple stmt , const char *mark_str) ++{ ++ const char *fn_name; ++ char *asm_comment; ++ unsigned int len; ++ ++ if (argnum == 0) ++ fn_name = NAME(current_function_decl); ++ else ++ fn_name = NAME(gimple_call_fndecl(stmt)); ++ ++ len = asprintf(&asm_comment, "%s %s %u", mark_str, fn_name, argnum); ++ gcc_assert(len > 0); ++ ++ return asm_comment; ++} ++ +static const char *convert_mark_to_str(enum mark mark) +{ + switch (mark) { @@ -114586,8 +114628,6 @@ index 0000000..62a1ae8 + return; + } + -+ gcc_assert(!is_size_overflow_intentional_asm_turn_off(asm_data->def_stmt)); -+ + asm_data->input = create_new_var(TREE_TYPE(asm_data->output)); + asm_data->input = make_ssa_name(asm_data->input, asm_data->def_stmt); + @@ -114601,16 +114641,20 @@ index 0000000..62a1ae8 + break; + case GIMPLE_NOP: { + enum mark mark; -+ const char *str; ++ const char *mark_str; ++ char *asm_comment; + + mark = check_intentional_attribute_gimple(asm_data->output, stmt, argnum); -+ str = convert_mark_to_str(mark); + + asm_data->input = asm_data->output; + asm_data->output = NULL; + asm_data->def_stmt = stmt; + -+ create_asm_stmt(str, build_string(2, "rm"), NULL, asm_data); ++ mark_str = convert_mark_to_str(mark); ++ asm_comment = create_asm_comment(argnum, stmt, mark_str); ++ ++ create_asm_stmt(asm_comment, build_string(2, "rm"), NULL, asm_data); ++ free(asm_comment); + asm_data->input = NULL_TREE; + break; + } @@ -114633,7 +114677,8 @@ index 0000000..62a1ae8 +static void create_size_overflow_asm(gimple stmt, tree output_node, unsigned int argnum) +{ + struct asm_data asm_data; -+ const char *str; ++ const char *mark_str; ++ char *asm_comment; + enum mark mark; + + if (is_gimple_constant(output_node)) @@ -114641,18 +114686,21 @@ index 0000000..62a1ae8 + + asm_data.output = output_node; + mark = check_intentional_attribute_gimple(asm_data.output, stmt, argnum); -+ if (mark == MARK_TURN_OFF) -+ return; -+ -+ search_missing_size_overflow_attribute_gimple(stmt, argnum); ++ if (mark != MARK_TURN_OFF) ++ search_missing_size_overflow_attribute_gimple(stmt, argnum); + + asm_data.def_stmt = get_def_stmt(asm_data.output); ++ if (is_size_overflow_intentional_asm_turn_off(asm_data.def_stmt)) ++ return; ++ + create_asm_input(stmt, argnum, &asm_data); + if (asm_data.input == NULL_TREE) + return; + -+ str = convert_mark_to_str(mark); -+ create_asm_stmt(str, build_string(1, "0"), build_string(3, "=rm"), &asm_data); ++ mark_str = convert_mark_to_str(mark); ++ asm_comment = create_asm_comment(argnum, stmt, mark_str); ++ create_asm_stmt(asm_comment, build_string(1, "0"), build_string(3, "=rm"), &asm_data); ++ free(asm_comment); +} + +// Insert an asm stmt with "MARK_TURN_OFF", "MARK_YES" or "MARK_NOT_INTENTIONAL". diff --git a/3.2.54/0000_README b/3.2.54/0000_README index d65044f..155b184 100644 --- a/3.2.54/0000_README +++ b/3.2.54/0000_README @@ -134,7 +134,7 @@ Patch: 1053_linux-3.2.54.patch From: http://www.kernel.org Desc: Linux 3.2.54 -Patch: 4420_grsecurity-3.0-3.2.54-201401091839.patch +Patch: 4420_grsecurity-3.0-3.2.54-201401160931.patch From: http://www.grsecurity.net Desc: hardened-sources base patch from upstream grsecurity diff --git a/3.2.54/4420_grsecurity-3.0-3.2.54-201401091839.patch b/3.2.54/4420_grsecurity-3.0-3.2.54-201401160931.patch index 5e87908..6d2be70 100644 --- a/3.2.54/4420_grsecurity-3.0-3.2.54-201401091839.patch +++ b/3.2.54/4420_grsecurity-3.0-3.2.54-201401160931.patch @@ -270,7 +270,7 @@ index 88fd7f5..b318a78 100644 ============================================================== diff --git a/Makefile b/Makefile -index 848be26..3deab0e 100644 +index 848be26..67efb38f 100644 --- a/Makefile +++ b/Makefile @@ -245,8 +245,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ @@ -389,7 +389,13 @@ index 848be26..3deab0e 100644 $(Q)$(MAKE) $(build)=$@ # Store (new) KERNELRELASE string in include/config/kernel.release -@@ -985,6 +1047,7 @@ prepare0: archprepare FORCE +@@ -981,10 +1043,13 @@ prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ + + archprepare: archscripts prepare1 scripts_basic + ++prepare0: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS) ++prepare0: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS) + prepare0: archprepare FORCE $(Q)$(MAKE) $(build)=. # All the preparing.. @@ -397,7 +403,7 @@ index 848be26..3deab0e 100644 prepare: prepare0 # Generate some files -@@ -1089,6 +1152,8 @@ all: modules +@@ -1089,6 +1154,8 @@ all: modules # using awk while concatenating to the final file. PHONY += modules @@ -406,7 +412,7 @@ index 848be26..3deab0e 100644 modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order @$(kecho) ' Building modules, stage 2.'; -@@ -1104,7 +1169,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) +@@ -1104,7 +1171,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) # Target to prepare building external modules PHONY += modules_prepare @@ -415,7 +421,7 @@ index 848be26..3deab0e 100644 # Target to install modules PHONY += modules_install -@@ -1163,7 +1228,7 @@ CLEAN_FILES += vmlinux System.map \ +@@ -1163,7 +1230,7 @@ CLEAN_FILES += vmlinux System.map \ MRPROPER_DIRS += include/config usr/include include/generated \ arch/*/include/generated MRPROPER_FILES += .config .config.old .version .old_version \ @@ -424,7 +430,7 @@ index 848be26..3deab0e 100644 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS # clean - Delete most, but leave enough to build external modules -@@ -1201,6 +1266,7 @@ distclean: mrproper +@@ -1201,6 +1268,7 @@ distclean: mrproper \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ -o -name '.*.rej' \ @@ -432,7 +438,7 @@ index 848be26..3deab0e 100644 -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ -type f -print | xargs rm -f -@@ -1361,6 +1427,8 @@ PHONY += $(module-dirs) modules +@@ -1361,6 +1429,8 @@ PHONY += $(module-dirs) modules $(module-dirs): crmodverdir $(objtree)/Module.symvers $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) @@ -441,7 +447,7 @@ index 848be26..3deab0e 100644 modules: $(module-dirs) @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost -@@ -1487,17 +1555,21 @@ else +@@ -1487,17 +1557,21 @@ else target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) endif @@ -467,7 +473,7 @@ index 848be26..3deab0e 100644 $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) %.symtypes: %.c prepare scripts FORCE $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -@@ -1507,11 +1579,15 @@ endif +@@ -1507,11 +1581,15 @@ endif $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) @@ -5315,7 +5321,7 @@ index 745c1e7..59d97a6 100644 break; } diff --git a/arch/powerpc/kernel/module_32.c b/arch/powerpc/kernel/module_32.c -index 2e3200c..72095ce 100644 +index 2e3200c..7118986 100644 --- a/arch/powerpc/kernel/module_32.c +++ b/arch/powerpc/kernel/module_32.c @@ -162,7 +162,7 @@ int module_frob_arch_sections(Elf32_Ehdr *hdr, @@ -5347,6 +5353,15 @@ index 2e3200c..72095ce 100644 /* Find this entry, or if that fails, the next avail. entry */ while (entry->jump[0]) { +@@ -300,7 +305,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, + } + #ifdef CONFIG_DYNAMIC_FTRACE + module->arch.tramp = +- do_plt_call(module->module_core, ++ do_plt_call(module->module_core_rx, + (unsigned long)ftrace_caller, + sechdrs, module); + #endif diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index d687e3f..074a8cd 100644 --- a/arch/powerpc/kernel/process.c @@ -37067,18 +37082,9 @@ index 2581202..f230a8d9 100644 *sequence = cur_fence; diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c -index 5fc201b..7b032b9 100644 +index 5fc201b..20b6980 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c -@@ -201,7 +201,7 @@ struct methods { - const char desc[8]; - void (*loadbios)(struct drm_device *, uint8_t *); - const bool rw; --}; -+} __do_const; - - static struct methods shadow_methods[] = { - { "PRAMIN", load_vbios_pramin, true }, @@ -5474,7 +5474,7 @@ parse_bit_U_tbl_entry(struct drm_device *dev, struct nvbios *bios, struct bit_table { const char id; @@ -41249,6 +41255,21 @@ index 639abee..e2336f4 100644 *kernel_ptr = (void *)&ctrls->controls; *array_size = sizeof(struct v4l2_ext_control) * ctrls->count; +diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c +index 7d754fb..474273b 100644 +--- a/drivers/media/video/vivi.c ++++ b/drivers/media/video/vivi.c +@@ -51,8 +51,8 @@ MODULE_AUTHOR("Mauro Carvalho Chehab, Ted Walther and John Sokol"); + MODULE_LICENSE("Dual BSD/GPL"); + MODULE_VERSION(VIVI_VERSION); + +-static unsigned video_nr = -1; +-module_param(video_nr, uint, 0644); ++static int video_nr = -1; ++module_param(video_nr, int, 0644); + MODULE_PARM_DESC(video_nr, "videoX start number, -1 is autodetect"); + + static unsigned n_devs = 1; diff --git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c index 668f5c6..65df5f2 100644 --- a/drivers/memstick/host/r592.c @@ -47335,7 +47356,7 @@ index 3440812..2a4ef1f 100644 file->f_version = event_count; return POLLIN | POLLRDNORM; diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c -index 49257b3..de27d93 100644 +index 49257b3..13133cd 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -147,7 +147,7 @@ static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, @@ -47347,7 +47368,7 @@ index 49257b3..de27d93 100644 loff_t pos; int i; -@@ -189,16 +189,16 @@ static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, +@@ -189,22 +189,22 @@ static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes, for (i = 0; nbytes && i < dev->descriptor.bNumConfigurations; i++) { struct usb_config_descriptor *config = (struct usb_config_descriptor *)dev->rawdescriptors[i]; @@ -47367,6 +47388,13 @@ index 49257b3..de27d93 100644 if (len > nbytes) len = nbytes; + /* Simply don't write (skip over) unallocated parts */ + if (alloclen > (*ppos - pos)) { +- alloclen -= (*ppos - pos); ++ alloclen = alloclen + pos - *ppos; + if (copy_to_user(buf, + dev->rawdescriptors[i] + (*ppos - pos), + min(len, alloclen))) { diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 032e5a6..bc422e4 100644 --- a/drivers/usb/core/hcd.c @@ -73987,19 +74015,6 @@ index 7925bf0..d5143d2 100644 #define free(a) kfree(a) #define large_malloc(a) vmalloc(a) -diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h -index 98ce812..9afa76d 100644 ---- a/include/linux/devfreq.h -+++ b/include/linux/devfreq.h -@@ -100,7 +100,7 @@ struct devfreq_governor { - int (*init)(struct devfreq *this); - void (*exit)(struct devfreq *this); - const bool no_central_polling; --}; -+} __do_const; - - /** - * struct devfreq - Device devfreq structure diff --git a/include/linux/device.h b/include/linux/device.h index 3136ede..9a589c5 100644 --- a/include/linux/device.h @@ -76948,19 +76963,6 @@ index 857f502..350a113 100644 /* Function to register/unregister hook points. */ int nf_register_hook(struct nf_hook_ops *reg); -diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h -index 3540c6e..83adb6c 100644 ---- a/include/linux/netfilter/ipset/ip_set.h -+++ b/include/linux/netfilter/ipset/ip_set.h -@@ -274,7 +274,7 @@ struct ip_set_type_variant { - /* Return true if "b" set is the same as "a" - * according to the create set parameters */ - bool (*same_set)(const struct ip_set *a, const struct ip_set *b); --}; -+} __do_const; - - /* The core set type structure */ - struct ip_set_type { diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 74d3386..e800dbf 100644 --- a/include/linux/netfilter/nfnetlink.h @@ -101813,10 +101815,10 @@ index 38f6617..e70b72b 100755 exuberant() diff --git a/security/Kconfig b/security/Kconfig -index 51bd5a0..ce4aad0 100644 +index 51bd5a0..62953d6 100644 --- a/security/Kconfig +++ b/security/Kconfig -@@ -4,6 +4,954 @@ +@@ -4,6 +4,953 @@ menu "Security options" @@ -102126,7 +102128,6 @@ index 51bd5a0..ce4aad0 100644 + select CIFS_XATTR if CIFS + select EXT2_FS_XATTR if EXT2_FS + select EXT3_FS_XATTR if EXT3_FS -+ select EXT4_FS_XATTR if EXT4_FS + select JFFS2_FS_XATTR if JFFS2_FS + select REISERFS_FS_XATTR if REISERFS_FS + select SQUASHFS_XATTR if SQUASHFS @@ -102771,7 +102772,7 @@ index 51bd5a0..ce4aad0 100644 config KEYS bool "Enable access key retention support" help -@@ -169,7 +1117,7 @@ config INTEL_TXT +@@ -169,7 +1116,7 @@ config INTEL_TXT config LSM_MMAP_MIN_ADDR int "Low address space for LSM to protect from user allocation" depends on SECURITY && SECURITY_SELINUX @@ -105287,10 +105288,10 @@ index 0000000..414fe5e +} diff --git a/tools/gcc/constify_plugin.c b/tools/gcc/constify_plugin.c new file mode 100644 -index 0000000..c17312d +index 0000000..3e46b2f --- /dev/null +++ b/tools/gcc/constify_plugin.c -@@ -0,0 +1,560 @@ +@@ -0,0 +1,559 @@ +/* + * Copyright 2011 by Emese Revfy <re.emese@gmail.com> + * Copyright 2011-2013 by PaX Team <pageexec@freemail.hu> @@ -105337,7 +105338,7 @@ index 0000000..c17312d +int plugin_is_GPL_compatible; + +static struct plugin_info const_plugin_info = { -+ .version = "201305231310", ++ .version = "201401121315", + .help = "no-constify\tturn off constification\n", +}; + @@ -105502,22 +105503,21 @@ index 0000000..c17312d + + *no_add_attrs = true; + if (TREE_CODE(*node) == FUNCTION_DECL) { -+ error("%qE attribute does not apply to functions", name); ++ error("%qE attribute does not apply to functions (%qF)", name, *node); + return NULL_TREE; + } + + if (TREE_CODE(*node) == PARM_DECL) { -+ error("%qE attribute does not apply to function parameters", name); ++ error("%qE attribute does not apply to function parameters (%qD)", name, *node); + return NULL_TREE; + } + + if (TREE_CODE(*node) == VAR_DECL) { -+ error("%qE attribute does not apply to variables", name); ++ error("%qE attribute does not apply to variables (%qD)", name, *node); + return NULL_TREE; + } + + if (TYPE_P(*node)) { -+ *no_add_attrs = false; + type = *node; + } else { + gcc_assert(TREE_CODE(*node) == TYPE_DECL); @@ -105525,18 +105525,20 @@ index 0000000..c17312d + } + + if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) { -+ error("%qE attribute applies to struct and union types only", name); ++ error("%qE attribute used on %qT applies to struct and union types only", name, type); + return NULL_TREE; + } + + if (lookup_attribute(IDENTIFIER_POINTER(name), TYPE_ATTRIBUTES(type))) { -+ error("%qE attribute is already applied to the type", name); ++ error("%qE attribute is already applied to the type %qT", name, type); + return NULL_TREE; + } + + if (TYPE_P(*node)) { + if (lookup_attribute("do_const", TYPE_ATTRIBUTES(type))) -+ error("%qE attribute is incompatible with 'do_const'", name); ++ error("%qE attribute used on type %qT is incompatible with 'do_const'", name, type); ++ else ++ *no_add_attrs = false; + return NULL_TREE; + } + @@ -105547,7 +105549,7 @@ index 0000000..c17312d + return NULL_TREE; + } + -+ error("%qE attribute used on type that is not constified", name); ++ error("%qE attribute used on type %qT that is not constified", name, type); + return NULL_TREE; +} + @@ -105563,22 +105565,22 @@ index 0000000..c17312d +{ + *no_add_attrs = true; + if (!TYPE_P(*node)) { -+ error("%qE attribute applies to types only", name); ++ error("%qE attribute applies to types only (%qD)", name, *node); + return NULL_TREE; + } + + if (TREE_CODE(*node) != RECORD_TYPE && TREE_CODE(*node) != UNION_TYPE) { -+ error("%qE attribute applies to struct and union types only", name); ++ error("%qE attribute used on %qT applies to struct and union types only", name, *node); + return NULL_TREE; + } + + if (lookup_attribute(IDENTIFIER_POINTER(name), TYPE_ATTRIBUTES(*node))) { -+ error("%qE attribute is already applied to the type", name); ++ error("%qE attribute used on %qT is already applied to the type", name, *node); + return NULL_TREE; + } + + if (lookup_attribute("no_const", TYPE_ATTRIBUTES(*node))) { -+ error("%qE attribute is incompatible with 'no_const'", name); ++ error("%qE attribute used on %qT is incompatible with 'no_const'", name, *node); + return NULL_TREE; + } + @@ -105636,30 +105638,29 @@ index 0000000..c17312d + + constifiable(type, &cinfo); + -+ if (TYPE_READONLY(type) && C_TYPE_FIELDS_READONLY(type)) { -+ if (!lookup_attribute("do_const", TYPE_ATTRIBUTES(type))) -+ return; -+ if (cinfo.has_writable_field) -+ return; -+ error("'do_const' attribute used on type that is%sconstified", cinfo.has_fptr_field ? " " : " not "); -+ return; -+ } -+ + if (lookup_attribute("no_const", TYPE_ATTRIBUTES(type))) { + if ((cinfo.has_fptr_field && !cinfo.has_writable_field) || cinfo.has_do_const_field) { + deconstify_type(type); + TYPE_CONSTIFY_VISITED(type) = 1; + } else -+ error("'no_const' attribute used on type that is not constified"); ++ error("'no_const' attribute used on type %qT that is not constified", type); + return; + } + + if (lookup_attribute("do_const", TYPE_ATTRIBUTES(type))) { ++ if (!cinfo.has_writable_field) { ++ error("'do_const' attribute used on type %qT that is%sconstified", type, cinfo.has_fptr_field ? " " : " not "); ++ return; ++ } + constify_type(type); + return; + } + + if (cinfo.has_fptr_field && !cinfo.has_writable_field) { ++ if (lookup_attribute("do_const", TYPE_ATTRIBUTES(type))) { ++ error("'do_const' attribute used on type %qT that is constified", type); ++ return; ++ } + constify_type(type); + return; + } @@ -105747,7 +105748,6 @@ index 0000000..c17312d + return check_local_variables(); +} + -+ unsigned int ret = 0; +static struct gimple_opt_pass pass_local_variable = { + { + .type = GIMPLE_PASS, @@ -112954,12 +112954,12 @@ index 0000000..2d131cc +selnl_msglen_65499 selnl_msglen 0 65499 NULL diff --git a/tools/gcc/size_overflow_plugin.c b/tools/gcc/size_overflow_plugin.c new file mode 100644 -index 0000000..5515dcb +index 0000000..62a1ae8 --- /dev/null +++ b/tools/gcc/size_overflow_plugin.c -@@ -0,0 +1,3927 @@ +@@ -0,0 +1,4050 @@ +/* -+ * Copyright 2011, 2012, 2013 by Emese Revfy <re.emese@gmail.com> ++ * Copyright 2011, 2012, 2013, 2014 by Emese Revfy <re.emese@gmail.com> + * Licensed under the GPL v2, or (at your option) v3 + * + * Homepage: @@ -113087,7 +113087,7 @@ index 0000000..5515dcb +static tree dup_assign(struct pointer_set_t *visited, gimple oldstmt, const_tree node, tree rhs1, tree rhs2, tree __unused rhs3); + +static struct plugin_info size_overflow_plugin_info = { -+ .version = "20131214beta", ++ .version = "20140102beta", + .help = "no-size-overflow\tturn off size overflow checking\n", +}; + @@ -116534,6 +116534,141 @@ index 0000000..5515dcb + create_asm_stmt(str, build_string(1, "0"), build_string(3, "=rm"), &asm_data); +} + ++// Insert an asm stmt with "MARK_TURN_OFF", "MARK_YES" or "MARK_NOT_INTENTIONAL". ++static bool create_mark_asm(gimple stmt, enum mark mark) ++{ ++ struct asm_data asm_data; ++ const char *asm_str; ++ ++ switch (mark) { ++ case MARK_TURN_OFF: ++ asm_str = TURN_OFF_ASM_STR; ++ break; ++ case MARK_NOT_INTENTIONAL: ++ case MARK_YES: ++ asm_str = YES_ASM_STR; ++ break; ++ default: ++ gcc_unreachable(); ++ } ++ ++ asm_data.def_stmt = stmt; ++ asm_data.output = gimple_call_lhs(stmt); ++ ++ if (asm_data.output == NULL_TREE) { ++ asm_data.input = gimple_call_arg(stmt, 0); ++ if (is_gimple_constant(asm_data.input)) ++ return false; ++ asm_data.output = NULL; ++ create_asm_stmt(asm_str, build_string(2, "rm"), NULL, &asm_data); ++ return true; ++ } ++ ++ create_asm_input(stmt, 0, &asm_data); ++ gcc_assert(asm_data.input != NULL_TREE); ++ ++ create_asm_stmt(asm_str, build_string(1, "0"), build_string(3, "=rm"), &asm_data); ++ return true; ++} ++ ++static bool is_from_cast(const_tree node) ++{ ++ gimple def_stmt = get_def_stmt(node); ++ ++ if (!def_stmt) ++ return false; ++ ++ if (gimple_assign_cast_p(def_stmt)) ++ return true; ++ ++ return false; ++} ++ ++// Skip duplication when there is a minus expr and the type of rhs1 or rhs2 is a pointer_type. ++static bool skip_ptr_minus(gimple stmt) ++{ ++ const_tree rhs1, rhs2, ptr1_rhs, ptr2_rhs; ++ ++ if (gimple_assign_rhs_code(stmt) != MINUS_EXPR) ++ return false; ++ ++ rhs1 = gimple_assign_rhs1(stmt); ++ if (!is_from_cast(rhs1)) ++ return false; ++ ++ rhs2 = gimple_assign_rhs2(stmt); ++ if (!is_from_cast(rhs2)) ++ return false; ++ ++ ptr1_rhs = gimple_assign_rhs1(get_def_stmt(rhs1)); ++ ptr2_rhs = gimple_assign_rhs1(get_def_stmt(rhs2)); ++ ++ if (TREE_CODE(TREE_TYPE(ptr1_rhs)) != POINTER_TYPE && TREE_CODE(TREE_TYPE(ptr2_rhs)) != POINTER_TYPE) ++ return false; ++ ++ create_mark_asm(stmt, MARK_YES); ++ return true; ++} ++ ++static void walk_use_def_ptr(struct pointer_set_t *visited, const_tree lhs) ++{ ++ gimple def_stmt; ++ ++ def_stmt = get_def_stmt(lhs); ++ if (!def_stmt) ++ return; ++ ++ if (pointer_set_insert(visited, def_stmt)) ++ return; ++ ++ switch (gimple_code(def_stmt)) { ++ case GIMPLE_NOP: ++ case GIMPLE_ASM: ++ case GIMPLE_CALL: ++ break; ++ case GIMPLE_PHI: { ++ unsigned int i, n = gimple_phi_num_args(def_stmt); ++ ++ pointer_set_insert(visited, def_stmt); ++ ++ for (i = 0; i < n; i++) { ++ tree arg = gimple_phi_arg_def(def_stmt, i); ++ ++ walk_use_def_ptr(visited, arg); ++ } ++ } ++ case GIMPLE_ASSIGN: ++ switch (gimple_num_ops(def_stmt)) { ++ case 2: ++ walk_use_def_ptr(visited, gimple_assign_rhs1(def_stmt)); ++ return; ++ case 3: ++ if (skip_ptr_minus(def_stmt)) ++ return; ++ ++ walk_use_def_ptr(visited, gimple_assign_rhs1(def_stmt)); ++ walk_use_def_ptr(visited, gimple_assign_rhs2(def_stmt)); ++ return; ++ default: ++ return; ++ } ++ default: ++ debug_gimple_stmt((gimple)def_stmt); ++ error("%s: unknown gimple code", __func__); ++ gcc_unreachable(); ++ } ++} ++ ++// Look for a ptr - ptr expression (e.g., cpuset_common_file_read() s - page) ++static void insert_mark_not_intentional_asm_at_ptr(const_tree arg) ++{ ++ struct pointer_set_t *visited; ++ ++ visited = pointer_set_create(); ++ walk_use_def_ptr(visited, arg); ++ pointer_set_destroy(visited); ++} ++ +// Determine the return value and insert the asm stmt to mark the return stmt. +static void insert_asm_ret(gimple stmt) +{ @@ -116556,6 +116691,10 @@ index 0000000..5515dcb + + arg = gimple_call_arg(stmt, argnum - 1); + gcc_assert(arg != NULL_TREE); ++ ++ // skip all ptr - ptr expressions ++ insert_mark_not_intentional_asm_at_ptr(arg); ++ + create_size_overflow_asm(stmt, arg, argnum); +} + @@ -116615,35 +116754,17 @@ index 0000000..5515dcb + +/* + * Look up the intentional_overflow attribute that turns off ipa based duplication -+ * on the callee function, if found insert an asm stmt with "MARK_TURN_OFF". ++ * on the callee function. + */ -+static bool create_mark_turn_off_asm(gimple stmt) ++static bool is_mark_turn_off_attribute(gimple stmt) +{ + enum mark mark; -+ struct asm_data asm_data; + const_tree fndecl = gimple_call_fndecl(stmt); + + mark = get_intentional_attr_type(DECL_ORIGIN(fndecl)); -+ if (mark != MARK_TURN_OFF) -+ return false; -+ -+ asm_data.def_stmt = stmt; -+ asm_data.output = gimple_call_lhs(stmt); -+ -+ if (asm_data.output == NULL_TREE) { -+ asm_data.input = gimple_call_arg(stmt, 0); -+ if (is_gimple_constant(asm_data.input)) -+ return false; -+ asm_data.output = NULL; -+ create_asm_stmt(TURN_OFF_ASM_STR, build_string(2, "rm"), NULL, &asm_data); ++ if (mark == MARK_TURN_OFF) + return true; -+ } -+ -+ create_asm_input(stmt, 0, &asm_data); -+ gcc_assert(asm_data.input != NULL_TREE); -+ -+ create_asm_stmt(TURN_OFF_ASM_STR, build_string(1, "0"), build_string(3, "=rm"), &asm_data); -+ return true; ++ return false; +} + +// If the argument(s) of the callee function is/are in the hash table or are marked by an attribute then mark the call stmt with an asm stmt @@ -116660,8 +116781,10 @@ index 0000000..5515dcb + return; + fndecl = DECL_ORIGIN(fndecl); + -+ if (create_mark_turn_off_asm(stmt)) ++ if (is_mark_turn_off_attribute(stmt)) { ++ create_mark_asm(stmt, MARK_TURN_OFF); + return; ++ } + + search_interesting_args(fndecl, orig_argnums); + @@ -117531,7 +117654,7 @@ index 547628e..74de9f2 100644 + #endif diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c -index d83aa5e..e097f17 100644 +index d83aa5e..76e9c92 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -75,12 +75,17 @@ LIST_HEAD(vm_list); @@ -117563,7 +117686,27 @@ index d83aa5e..e097f17 100644 (void __user *)(unsigned long)mem->userspace_addr, mem->memory_size))) goto out; -@@ -1660,7 +1665,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp) +@@ -1493,8 +1498,17 @@ EXPORT_SYMBOL_GPL(kvm_read_guest_cached); + + int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len) + { +- return kvm_write_guest_page(kvm, gfn, (const void *) empty_zero_page, +- offset, len); ++ int r; ++ unsigned long addr; ++ ++ addr = gfn_to_hva(kvm, gfn); ++ if (kvm_is_error_hva(addr)) ++ return -EFAULT; ++ r = __clear_user((void __user *)addr + offset, len); ++ if (r) ++ return -EFAULT; ++ mark_page_dirty(kvm, gfn); ++ return 0; + } + EXPORT_SYMBOL_GPL(kvm_clear_guest_page); + +@@ -1660,7 +1674,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp) return 0; } @@ -117572,7 +117715,7 @@ index d83aa5e..e097f17 100644 .release = kvm_vcpu_release, .unlocked_ioctl = kvm_vcpu_ioctl, #ifdef CONFIG_COMPAT -@@ -2183,7 +2188,7 @@ static int kvm_vm_mmap(struct file *file, struct vm_area_struct *vma) +@@ -2183,7 +2197,7 @@ static int kvm_vm_mmap(struct file *file, struct vm_area_struct *vma) return 0; } @@ -117581,7 +117724,7 @@ index d83aa5e..e097f17 100644 .release = kvm_vm_release, .unlocked_ioctl = kvm_vm_ioctl, #ifdef CONFIG_COMPAT -@@ -2281,7 +2286,7 @@ out: +@@ -2281,7 +2295,7 @@ out: return r; } @@ -117590,7 +117733,7 @@ index d83aa5e..e097f17 100644 .unlocked_ioctl = kvm_dev_ioctl, .compat_ioctl = kvm_dev_ioctl, .llseek = noop_llseek, -@@ -2307,7 +2312,7 @@ static void hardware_enable_nolock(void *junk) +@@ -2307,7 +2321,7 @@ static void hardware_enable_nolock(void *junk) if (r) { cpumask_clear_cpu(cpu, cpus_hardware_enabled); @@ -117599,7 +117742,7 @@ index d83aa5e..e097f17 100644 printk(KERN_INFO "kvm: enabling virtualization on " "CPU%d failed\n", cpu); } -@@ -2361,10 +2366,10 @@ static int hardware_enable_all(void) +@@ -2361,10 +2375,10 @@ static int hardware_enable_all(void) kvm_usage_count++; if (kvm_usage_count == 1) { @@ -117612,7 +117755,7 @@ index d83aa5e..e097f17 100644 hardware_disable_all_nolock(); r = -EBUSY; } -@@ -2715,7 +2720,7 @@ static void kvm_sched_out(struct preempt_notifier *pn, +@@ -2715,7 +2729,7 @@ static void kvm_sched_out(struct preempt_notifier *pn, kvm_arch_vcpu_put(vcpu); } @@ -117621,7 +117764,7 @@ index d83aa5e..e097f17 100644 struct module *module) { int r; -@@ -2778,7 +2783,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, +@@ -2778,7 +2792,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, if (!vcpu_align) vcpu_align = __alignof__(struct kvm_vcpu); kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, vcpu_align, @@ -117630,7 +117773,7 @@ index d83aa5e..e097f17 100644 if (!kvm_vcpu_cache) { r = -ENOMEM; goto out_free_3; -@@ -2788,9 +2793,11 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, +@@ -2788,9 +2802,11 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, if (r) goto out_free; @@ -117642,7 +117785,7 @@ index d83aa5e..e097f17 100644 r = misc_register(&kvm_dev); if (r) { -@@ -2800,9 +2807,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, +@@ -2800,9 +2816,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, register_syscore_ops(&kvm_syscore_ops); |