Skip to content

Commit 2491068

Browse files
committed
Merge Linux 4.4.258 into 11
Changes in 4.4.258 tracing: Do not count ftrace events in top level enable output fgraph: Initialize tracing_graph_pause at task creation af_key: relax availability checks for skb size calculation iwlwifi: pcie: add a NULL check in iwl_pcie_txq_unmap iwlwifi: mvm: guard against device removal in reprobe SUNRPC: Move simple_get_bytes and simple_get_netobj into private header SUNRPC: Handle 0 length opaque XDR object data properly lib/string: Add strscpy_pad() function include/trace/events/writeback.h: fix -Wstringop-truncation warnings memcg: fix a crash in wb_workfn when a device disappears squashfs: add more sanity checks in id lookup squashfs: add more sanity checks in inode lookup squashfs: add more sanity checks in xattr id lookup memblock: do not start bottom-up allocations with kernel_end netfilter: xt_recent: Fix attempt to update deleted entry h8300: fix PREEMPTION build, TI_PRE_COUNT undefined usb: dwc3: ulpi: fix checkpatch warning usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one net: watchdog: hold device global xmit lock during tx disable vsock: fix locking in vsock_shutdown() x86/build: Disable CET instrumentation in the kernel for 32-bit too trace: Use -mcount-record for dynamic ftrace tracing: Fix SKIP_STACK_VALIDATION=1 build due to bad merge with -mrecord-mcount tracing: Avoid calling cc-option -mrecord-mcount for every Makefile Xen/x86: don't bail early from clear_foreign_p2m_mapping() Xen/x86: also check kernel mapping in set_foreign_p2m_mapping() Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages() Xen/gntdev: correct error checking in gntdev_map_grant_pages() xen/arm: don't ignore return errors from set_phys_to_machine xen-blkback: don't "handle" error by BUG() xen-netback: don't "handle" error by BUG() xen-scsiback: don't "handle" error by BUG() xen-blkback: fix error handling in xen_blkbk_map() scsi: qla2xxx: Fix crash during driver load on big endian machines kvm: check tlbs_dirty directly Linux 4.4.258
2 parents d75f665 + 4fd124d commit 2491068

File tree

41 files changed

+388
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+388
-223
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 257
3+
SUBLEVEL = 258
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

@@ -786,6 +786,13 @@ ifdef CONFIG_FUNCTION_TRACER
786786
ifndef CC_FLAGS_FTRACE
787787
CC_FLAGS_FTRACE := -pg
788788
endif
789+
ifdef CONFIG_FTRACE_MCOUNT_RECORD
790+
# gcc 5 supports generating the mcount tables directly
791+
ifeq ($(call cc-option-yn,-mrecord-mcount),y)
792+
CC_FLAGS_FTRACE += -mrecord-mcount
793+
export CC_USING_RECORD_MCOUNT := 1
794+
endif
795+
endif
789796
export CC_FLAGS_FTRACE
790797
ifdef CONFIG_HAVE_FENTRY
791798
CC_USING_FENTRY := $(call cc-option, -mfentry -DCC_USING_FENTRY)

arch/arm/xen/p2m.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
9393
for (i = 0; i < count; i++) {
9494
if (map_ops[i].status)
9595
continue;
96-
set_phys_to_machine(map_ops[i].host_addr >> XEN_PAGE_SHIFT,
97-
map_ops[i].dev_bus_addr >> XEN_PAGE_SHIFT);
96+
if (unlikely(!set_phys_to_machine(map_ops[i].host_addr >> XEN_PAGE_SHIFT,
97+
map_ops[i].dev_bus_addr >> XEN_PAGE_SHIFT))) {
98+
return -ENOMEM;
99+
}
98100
}
99101

100102
return 0;

arch/h8300/kernel/asm-offsets.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ int main(void)
6262
OFFSET(TI_FLAGS, thread_info, flags);
6363
OFFSET(TI_CPU, thread_info, cpu);
6464
OFFSET(TI_PRE, thread_info, preempt_count);
65+
#ifdef CONFIG_PREEMPTION
66+
DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
67+
#endif
6568

6669
return 0;
6770
}

arch/x86/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ endif
6161
KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
6262
KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
6363

64+
# Intel CET isn't enabled in the kernel
65+
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
66+
6467
ifeq ($(CONFIG_X86_32),y)
6568
BITS := 32
6669
UTS_MACHINE := i386
@@ -139,9 +142,6 @@ else
139142
KBUILD_CFLAGS += -mno-red-zone
140143
KBUILD_CFLAGS += -mcmodel=kernel
141144

142-
# Intel CET isn't enabled in the kernel
143-
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
144-
145145
# -funit-at-a-time shrinks the kernel .text considerably
146146
# unfortunately it makes reading oopses harder.
147147
KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)

arch/x86/xen/p2m.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,8 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
725725
unsigned long mfn, pfn;
726726

727727
/* Do not add to override if the map failed. */
728-
if (map_ops[i].status)
728+
if (map_ops[i].status != GNTST_okay ||
729+
(kmap_ops && kmap_ops[i].status != GNTST_okay))
729730
continue;
730731

731732
if (map_ops[i].flags & GNTMAP_contains_pte) {
@@ -763,17 +764,15 @@ int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
763764
unsigned long mfn = __pfn_to_mfn(page_to_pfn(pages[i]));
764765
unsigned long pfn = page_to_pfn(pages[i]);
765766

766-
if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT)) {
767+
if (mfn != INVALID_P2M_ENTRY && (mfn & FOREIGN_FRAME_BIT))
768+
set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
769+
else
767770
ret = -EINVAL;
768-
goto out;
769-
}
770-
771-
set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
772771
}
773772
if (kunmap_ops)
774773
ret = HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref,
775-
kunmap_ops, count);
776-
out:
774+
kunmap_ops, count) ?: ret;
775+
777776
return ret;
778777
}
779778
EXPORT_SYMBOL_GPL(clear_foreign_p2m_mapping);

drivers/block/xen-blkback/blkback.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -825,8 +825,11 @@ static int xen_blkbk_map(struct xen_blkif *blkif,
825825
pages[i]->page = persistent_gnt->page;
826826
pages[i]->persistent_gnt = persistent_gnt;
827827
} else {
828-
if (get_free_page(blkif, &pages[i]->page))
829-
goto out_of_memory;
828+
if (get_free_page(blkif, &pages[i]->page)) {
829+
put_free_pages(blkif, pages_to_gnt, segs_to_map);
830+
ret = -ENOMEM;
831+
goto out;
832+
}
830833
addr = vaddr(pages[i]->page);
831834
pages_to_gnt[segs_to_map] = pages[i]->page;
832835
pages[i]->persistent_gnt = NULL;
@@ -842,10 +845,8 @@ static int xen_blkbk_map(struct xen_blkif *blkif,
842845
break;
843846
}
844847

845-
if (segs_to_map) {
848+
if (segs_to_map)
846849
ret = gnttab_map_refs(map, NULL, pages_to_gnt, segs_to_map);
847-
BUG_ON(ret);
848-
}
849850

850851
/*
851852
* Now swizzle the MFN in our domain with the MFN from the other domain
@@ -860,7 +861,7 @@ static int xen_blkbk_map(struct xen_blkif *blkif,
860861
pr_debug("invalid buffer -- could not remap it\n");
861862
put_free_pages(blkif, &pages[seg_idx]->page, 1);
862863
pages[seg_idx]->handle = BLKBACK_INVALID_HANDLE;
863-
ret |= 1;
864+
ret |= !ret;
864865
goto next;
865866
}
866867
pages[seg_idx]->handle = map[new_map_idx].handle;
@@ -912,15 +913,18 @@ static int xen_blkbk_map(struct xen_blkif *blkif,
912913
}
913914
segs_to_map = 0;
914915
last_map = map_until;
915-
if (map_until != num)
916+
if (!ret && map_until != num)
916917
goto again;
917918

918-
return ret;
919+
out:
920+
for (i = last_map; i < num; i++) {
921+
/* Don't zap current batch's valid persistent grants. */
922+
if(i >= last_map + segs_to_map)
923+
pages[i]->persistent_gnt = NULL;
924+
pages[i]->handle = BLKBACK_INVALID_HANDLE;
925+
}
919926

920-
out_of_memory:
921-
pr_alert("%s: out of memory\n", __func__);
922-
put_free_pages(blkif, pages_to_gnt, segs_to_map);
923-
return -ENOMEM;
927+
return ret;
924928
}
925929

926930
static int xen_blkbk_map_seg(struct pending_req *pending_req)

drivers/net/wireless/iwlwifi/mvm/ops.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,7 @@ static void iwl_mvm_reprobe_wk(struct work_struct *wk)
909909
reprobe = container_of(wk, struct iwl_mvm_reprobe, work);
910910
if (device_reprobe(reprobe->dev))
911911
dev_err(reprobe->dev, "reprobe failed!\n");
912+
put_device(reprobe->dev);
912913
kfree(reprobe);
913914
module_put(THIS_MODULE);
914915
}
@@ -991,7 +992,7 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)
991992
module_put(THIS_MODULE);
992993
return;
993994
}
994-
reprobe->dev = mvm->trans->dev;
995+
reprobe->dev = get_device(mvm->trans->dev);
995996
INIT_WORK(&reprobe->work, iwl_mvm_reprobe_wk);
996997
schedule_work(&reprobe->work);
997998
} else if (mvm->cur_ucode == IWL_UCODE_REGULAR) {

drivers/net/wireless/iwlwifi/pcie/tx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,11 @@ static void iwl_pcie_txq_unmap(struct iwl_trans *trans, int txq_id)
585585
struct iwl_txq *txq = &trans_pcie->txq[txq_id];
586586
struct iwl_queue *q = &txq->q;
587587

588+
if (!txq) {
589+
IWL_ERR(trans, "Trying to free a queue that wasn't allocated?\n");
590+
return;
591+
}
592+
588593
spin_lock_bh(&txq->lock);
589594
while (q->write_ptr != q->read_ptr) {
590595
IWL_DEBUG_TX_REPLY(trans, "Q %d Free %d\n",

drivers/net/xen-netback/netback.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,13 +1792,11 @@ int xenvif_tx_action(struct xenvif_queue *queue, int budget)
17921792
return 0;
17931793

17941794
gnttab_batch_copy(queue->tx_copy_ops, nr_cops);
1795-
if (nr_mops != 0) {
1795+
if (nr_mops != 0)
17961796
ret = gnttab_map_refs(queue->tx_map_ops,
17971797
NULL,
17981798
queue->pages_to_map,
17991799
nr_mops);
1800-
BUG_ON(ret);
1801-
}
18021800

18031801
work_done = xenvif_tx_submit(queue);
18041802

drivers/scsi/qla2xxx/qla_tmpl.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,8 @@ qla27xx_template_checksum(void *p, ulong size)
871871
static inline int
872872
qla27xx_verify_template_checksum(struct qla27xx_fwdt_template *tmp)
873873
{
874-
return qla27xx_template_checksum(tmp, tmp->template_size) == 0;
874+
return qla27xx_template_checksum(tmp,
875+
le32_to_cpu(tmp->template_size)) == 0;
875876
}
876877

877878
static inline int
@@ -887,7 +888,7 @@ qla27xx_execute_fwdt_template(struct scsi_qla_host *vha)
887888
ulong len;
888889

889890
if (qla27xx_fwdt_template_valid(tmp)) {
890-
len = tmp->template_size;
891+
len = le32_to_cpu(tmp->template_size);
891892
tmp = memcpy(vha->hw->fw_dump, tmp, len);
892893
ql27xx_edit_template(vha, tmp);
893894
qla27xx_walk_template(vha, tmp, tmp, &len);
@@ -903,7 +904,7 @@ qla27xx_fwdt_calculate_dump_size(struct scsi_qla_host *vha)
903904
ulong len = 0;
904905

905906
if (qla27xx_fwdt_template_valid(tmp)) {
906-
len = tmp->template_size;
907+
len = le32_to_cpu(tmp->template_size);
907908
qla27xx_walk_template(vha, tmp, NULL, &len);
908909
}
909910

@@ -915,7 +916,7 @@ qla27xx_fwdt_template_size(void *p)
915916
{
916917
struct qla27xx_fwdt_template *tmp = p;
917918

918-
return tmp->template_size;
919+
return le32_to_cpu(tmp->template_size);
919920
}
920921

921922
ulong

0 commit comments

Comments
 (0)