From: Greg Kroah-Hartman Date: Thu, 2 Feb 2017 10:57:22 +0000 (+0100) Subject: some 3.18 build fixes X-Git-Tag: v4.9.8~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa113d7395146bca83d2548de8f1c8a50f64dfaa;p=thirdparty%2Fkernel%2Fstable-queue.git some 3.18 build fixes --- diff --git a/queue-3.18/atm-iphase-fix-misleading-indention.patch b/queue-3.18/atm-iphase-fix-misleading-indention.patch new file mode 100644 index 00000000000..ad2f81fe31f --- /dev/null +++ b/queue-3.18/atm-iphase-fix-misleading-indention.patch @@ -0,0 +1,34 @@ +From cbb41b91e68a302087762823136c9067138cff7c Mon Sep 17 00:00:00 2001 +From: Tillmann Heidsieck +Date: Sat, 10 Oct 2015 21:47:19 +0200 +Subject: atm: iphase: fix misleading indention + +From: Tillmann Heidsieck + +commit cbb41b91e68a302087762823136c9067138cff7c upstream. + +Fix a smatch warning: +drivers/atm/iphase.c:1178 rx_pkt() warn: curly braces intended? + +The code is correct, the indention is misleading. In case the allocation +of skb fails, we want to skip to the end. + +Signed-off-by: Tillmann Heidsieck +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/atm/iphase.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/atm/iphase.c ++++ b/drivers/atm/iphase.c +@@ -1175,7 +1175,7 @@ static int rx_pkt(struct atm_dev *dev) + if (!(skb = atm_alloc_charge(vcc, len, GFP_ATOMIC))) { + if (vcc->vci < 32) + printk("Drop control packets\n"); +- goto out_free_desc; ++ goto out_free_desc; + } + skb_put(skb,len); + // pwang_test diff --git a/queue-3.18/module-fix-types-of-device-tables-aliases.patch b/queue-3.18/module-fix-types-of-device-tables-aliases.patch new file mode 100644 index 00000000000..dd05f5f7a06 --- /dev/null +++ b/queue-3.18/module-fix-types-of-device-tables-aliases.patch @@ -0,0 +1,71 @@ +From 6301939d97d079f0d3dbe71e750f4daf5d39fc33 Mon Sep 17 00:00:00 2001 +From: Andrey Ryabinin +Date: Fri, 13 Feb 2015 14:40:13 -0800 +Subject: module: fix types of device tables aliases + +From: Andrey Ryabinin + +commit 6301939d97d079f0d3dbe71e750f4daf5d39fc33 upstream. + +MODULE_DEVICE_TABLE() macro used to create aliases to device tables. +Normally alias should have the same type as aliased symbol. + +Device tables are arrays, so they have 'struct type##_device_id[x]' +types. Alias created by MODULE_DEVICE_TABLE() will have non-array type - + 'struct type##_device_id'. + +This inconsistency confuses compiler, it could make a wrong assumption +about variable's size which leads KASan to produce a false positive report +about out of bounds access. + +For every global variable compiler calls __asan_register_globals() passing +information about global variable (address, size, size with redzone, name +...) __asan_register_globals() poison symbols redzone to detect possible +out of bounds accesses. + +When symbol has an alias __asan_register_globals() will be called as for +symbol so for alias. Compiler determines size of variable by size of +variable's type. Alias and symbol have the same address, so if alias have +the wrong size part of memory that actually belongs to the symbol could be +poisoned as redzone of alias symbol. + +By fixing type of alias symbol we will fix size of it, so +__asan_register_globals() will not poison valid memory. + +Signed-off-by: Andrey Ryabinin +Cc: Dmitry Vyukov +Cc: Konstantin Serebryany +Cc: Dmitry Chernenkov +Signed-off-by: Andrey Konovalov +Cc: Yuri Gribov +Cc: Konstantin Khlebnikov +Cc: Sasha Levin +Cc: Christoph Lameter +Cc: Joonsoo Kim +Cc: Dave Hansen +Cc: Andi Kleen +Cc: Ingo Molnar +Cc: Thomas Gleixner +Cc: "H. Peter Anvin" +Cc: Christoph Lameter +Cc: Pekka Enberg +Cc: David Rientjes +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/module.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/module.h ++++ b/include/linux/module.h +@@ -135,7 +135,7 @@ void trim_init_extable(struct module *m) + #ifdef MODULE + /* Creates an alias so file2alias.c can find device table. */ + #define MODULE_DEVICE_TABLE(type, name) \ +- extern const struct type##_device_id __mod_##type##__##name##_device_table \ ++extern const typeof(name) __mod_##type##__##name##_device_table \ + __attribute__ ((unused, alias(__stringify(name)))) + #else /* !MODULE */ + #define MODULE_DEVICE_TABLE(type, name) diff --git a/queue-3.18/module_device_table-fix-some-callsites.patch b/queue-3.18/module_device_table-fix-some-callsites.patch new file mode 100644 index 00000000000..ef1b74cfc54 --- /dev/null +++ b/queue-3.18/module_device_table-fix-some-callsites.patch @@ -0,0 +1,70 @@ +From 0f989f749b51ec1fd94bb5a42f8ad10c8b9f73cb Mon Sep 17 00:00:00 2001 +From: Andrew Morton +Date: Fri, 13 Feb 2015 14:39:11 -0800 +Subject: MODULE_DEVICE_TABLE: fix some callsites + +From: Andrew Morton + +commit 0f989f749b51ec1fd94bb5a42f8ad10c8b9f73cb upstream. + +The patch "module: fix types of device tables aliases" newly requires that +invocations of + +MODULE_DEVICE_TABLE(type, name); + +come *after* the definition of `name'. That is reasonable, but some +drivers weren't doing this. Fix them. + +Cc: James Bottomley +Cc: Andrey Ryabinin +Cc: David Miller +Cc: Hans Verkuil +Acked-by: Mauro Carvalho Chehab +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + Documentation/video4linux/v4l2-pci-skeleton.c | 2 +- + drivers/net/ethernet/emulex/benet/be_main.c | 1 - + drivers/scsi/be2iscsi/be_main.c | 1 - + 3 files changed, 1 insertion(+), 3 deletions(-) + +--- a/Documentation/video4linux/v4l2-pci-skeleton.c ++++ b/Documentation/video4linux/v4l2-pci-skeleton.c +@@ -42,7 +42,6 @@ + MODULE_DESCRIPTION("V4L2 PCI Skeleton Driver"); + MODULE_AUTHOR("Hans Verkuil"); + MODULE_LICENSE("GPL v2"); +-MODULE_DEVICE_TABLE(pci, skeleton_pci_tbl); + + /** + * struct skeleton - All internal data for one instance of device +@@ -95,6 +94,7 @@ static const struct pci_device_id skelet + /* { PCI_DEVICE(PCI_VENDOR_ID_, PCI_DEVICE_ID_) }, */ + { 0, } + }; ++MODULE_DEVICE_TABLE(pci, skeleton_pci_tbl); + + /* + * HDTV: this structure has the capabilities of the HDTV receiver. +--- a/drivers/net/ethernet/emulex/benet/be_main.c ++++ b/drivers/net/ethernet/emulex/benet/be_main.c +@@ -26,7 +26,6 @@ + #include + + MODULE_VERSION(DRV_VER); +-MODULE_DEVICE_TABLE(pci, be_dev_ids); + MODULE_DESCRIPTION(DRV_DESC " " DRV_VER); + MODULE_AUTHOR("Emulex Corporation"); + MODULE_LICENSE("GPL"); +--- a/drivers/scsi/be2iscsi/be_main.c ++++ b/drivers/scsi/be2iscsi/be_main.c +@@ -48,7 +48,6 @@ static unsigned int be_iopoll_budget = 1 + static unsigned int be_max_phys_size = 64; + static unsigned int enable_msix = 1; + +-MODULE_DEVICE_TABLE(pci, beiscsi_pci_id_table); + MODULE_DESCRIPTION(DRV_DESC " " BUILD_STR); + MODULE_VERSION(BUILD_STR); + MODULE_AUTHOR("Emulex Corporation"); diff --git a/queue-3.18/series b/queue-3.18/series new file mode 100644 index 00000000000..077a4d46564 --- /dev/null +++ b/queue-3.18/series @@ -0,0 +1,3 @@ +module-fix-types-of-device-tables-aliases.patch +module_device_table-fix-some-callsites.patch +atm-iphase-fix-misleading-indention.patch