Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1602463 > unrolled thread

[PATCH 4.4 00/35] 4.4.55-stable review

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-03-16 16:10 +0100
Last post2017-03-16 23:40 +0100
Articles 20 on this page of 35 — 7 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 4.4 00/35] 4.4.55-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
    [PATCH 4.4 26/35] USB: iowarrior: fix NULL-deref in write Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
    [PATCH 4.4 18/35] usb: gadget: dummy_hcd: clear usb_gadget region before registration Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
    [PATCH 4.4 35/35] ext4: dont BUG when truncating encrypted inodes on the orphan list Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
    [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
      Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for  NF_CT_PROTO_DCCP/UDPLITE change Ben Hutchings <ben@decadent.org.uk> - 2017-03-19 18:20 +0100
        Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for  NF_CT_PROTO_DCCP/UDPLITE change Ralf Baechle <ralf@linux-mips.org> - 2017-03-20 11:10 +0100
        Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for  NF_CT_PROTO_DCCP/UDPLITE change Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-20 11:40 +0100
          Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE  change Arnd Bergmann <arnd@arndb.de> - 2017-03-20 11:50 +0100
            Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for  NF_CT_PROTO_DCCP/UDPLITE change Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-20 17:40 +0100
              Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for  NF_CT_PROTO_DCCP/UDPLITE change Ralf Baechle <ralf@linux-mips.org> - 2017-03-20 17:50 +0100
    [PATCH 4.4 34/35] dm: flush queued bios when process blocks to avoid deadlock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
    [PATCH 4.4 32/35] s390/kdump: Use "LINUX" ELF note name instead of "CORE" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
    [PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie calculation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
      Re: [PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie  calculation Ben Hutchings <ben@decadent.org.uk> - 2017-03-19 18:20 +0100
        Re: [PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie calculation Dan Williams <dan.j.williams@intel.com> - 2017-03-20 19:30 +0100
    [PATCH 4.4 09/35] mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
    [PATCH 4.4 27/35] USB: serial: io_ti: fix NULL-deref in interrupt callback Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
    [PATCH 4.4 07/35] MIPS: ip22: Fix ip28 build for modern gcc Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
    [PATCH 4.4 03/35] crypto: improve gcc optimization flags for serpent and wp512 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
    [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for CPU_FREQ_STAT change Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
      Re: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for  CPU_FREQ_STAT change Ben Hutchings <ben@decadent.org.uk> - 2017-03-19 17:10 +0100
        Re: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for  CPU_FREQ_STAT change Ralf Baechle <ralf@linux-mips.org> - 2017-03-20 11:20 +0100
          Re: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for  CPU_FREQ_STAT change Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-20 17:40 +0100
            Re: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for  CPU_FREQ_STAT change Ralf Baechle <ralf@linux-mips.org> - 2017-03-20 18:00 +0100
              Re: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for  CPU_FREQ_STAT change Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-20 18:40 +0100
        Re: [PATCH 4.4 08/35] MIPS: Update lemote2f_defconfig for  CPU_FREQ_STAT change Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-20 11:40 +0100
    [PATCH 4.4 24/35] USB: serial: omninet: fix reference leaks at open Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:10 +0100
    [PATCH 4.4 20/35] usb: gadget: function: f_fs: pass companion descriptor along Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:20 +0100
    [PATCH 4.4 19/35] usb: dwc3: gadget: make Set Endpoint Configuration macros safe Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:20 +0100
    [PATCH 4.4 15/35] MIPS: Netlogic: Fix CP0_EBASE redefinition warnings Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:20 +0100
    [PATCH 4.4 23/35] USB: serial: safe_serial: fix information leak in completion handler Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:20 +0100
    [PATCH 4.4 16/35] tracing: Add #undef to fix compile error Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-16 16:20 +0100
    Re: [PATCH 4.4 00/35] 4.4.55-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-03-16 20:30 +0100
    Re: [PATCH 4.4 00/35] 4.4.55-stable review Guenter Roeck <linux@roeck-us.net> - 2017-03-16 23:40 +0100

Page 1 of 2  [1] 2  Next page →


#1602463 — [PATCH 4.4 00/35] 4.4.55-stable review

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 00/35] 4.4.55-stable review
Message-ID<tlEJj-84L-9@gated-at.bofh.it>
This is the start of the stable review cycle for the 4.4.55 release.
There are 35 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Sat Mar 18 14:28:52 UTC 2017.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.55-rc1.gz
or in the git tree and branch at:
  git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 4.4.55-rc1

Theodore Ts'o <tytso@mit.edu>
    ext4: don't BUG when truncating encrypted inodes on the orphan list

Mikulas Patocka <mpatocka@redhat.com>
    dm: flush queued bios when process blocks to avoid deadlock

Dan Williams <dan.j.williams@intel.com>
    nfit, libnvdimm: fix interleave set cookie calculation

Michael Holzheu <holzheu@linux.vnet.ibm.com>
    s390/kdump: Use "LINUX" ELF note name instead of "CORE"

Janosch Frank <frankja@linux.vnet.ibm.com>
    KVM: s390: Fix guest migration for huge guests resulting in panic

Luis de Bethencourt <luisbg@osg.samsung.com>
    mvsas: fix misleading indentation

Krzysztof Kozlowski <krzk@kernel.org>
    serial: samsung: Continue to work if DMA request fails

Johan Hovold <johan@kernel.org>
    USB: serial: io_ti: fix information leak in completion handler

Johan Hovold <johan@kernel.org>
    USB: serial: io_ti: fix NULL-deref in interrupt callback

Johan Hovold <johan@kernel.org>
    USB: iowarrior: fix NULL-deref in write

Johan Hovold <johan@kernel.org>
    USB: iowarrior: fix NULL-deref at probe

Johan Hovold <johan@kernel.org>
    USB: serial: omninet: fix reference leaks at open

Johan Hovold <johan@kernel.org>
    USB: serial: safe_serial: fix information leak in completion handler

Guenter Roeck <linux@roeck-us.net>
    usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci controllers

Peter Chen <peter.chen@nxp.com>
    usb: host: xhci-dbg: HCIVERSION should be a binary number

Felipe Balbi <felipe.balbi@linux.intel.com>
    usb: gadget: function: f_fs: pass companion descriptor along

Felipe Balbi <felipe.balbi@linux.intel.com>
    usb: dwc3: gadget: make Set Endpoint Configuration macros safe

Peter Chen <peter.chen@nxp.com>
    usb: gadget: dummy_hcd: clear usb_gadget region before registration

Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
    powerpc: Emulation support for load/store instructions on LE

Rik van Riel <riel@redhat.com>
    tracing: Add #undef to fix compile error

James Hogan <james.hogan@imgtec.com>
    MIPS: Netlogic: Fix CP0_EBASE redefinition warnings

Ralf Baechle <ralf@linux-mips.org>
    MIPS: DEC: Avoid la pseudo-instruction in delay slots

Arnd Bergmann <arnd@arndb.de>
    mm: memcontrol: avoid unused function warning

Arnd Bergmann <arnd@arndb.de>
    cpmac: remove hopeless #warning

Arnd Bergmann <arnd@arndb.de>
    MIPS: ralink: Remove unused rt*_wdt_reset functions

John Crispin <john@phrozen.org>
    MIPS: ralink: Cosmetic change to prom_init().

Arnd Bergmann <arnd@arndb.de>
    mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy

Arnd Bergmann <arnd@arndb.de>
    MIPS: Update lemote2f_defconfig for CPU_FREQ_STAT change

Arnd Bergmann <arnd@arndb.de>
    MIPS: ip22: Fix ip28 build for modern gcc

Arnd Bergmann <arnd@arndb.de>
    MIPS: Update ip27_defconfig for SCSI_DH change

Arnd Bergmann <arnd@arndb.de>
    MIPS: ip27: Disable qlge driver in defconfig

Arnd Bergmann <arnd@arndb.de>
    MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change

Arnd Bergmann <arnd@arndb.de>
    crypto: improve gcc optimization flags for serpent and wp512

Johan Hovold <johan@kernel.org>
    USB: serial: digi_acceleport: fix OOB-event processing

Johan Hovold <johan@kernel.org>
    USB: serial: digi_acceleport: fix OOB data sanity check


-------------

Diffstat:

 Makefile                                    |  4 +--
 arch/mips/configs/ip22_defconfig            |  4 +--
 arch/mips/configs/ip27_defconfig            |  3 +-
 arch/mips/configs/lemote2f_defconfig        |  2 +-
 arch/mips/configs/malta_defconfig           |  4 +--
 arch/mips/configs/malta_kvm_defconfig       |  4 +--
 arch/mips/configs/malta_kvm_guest_defconfig |  4 +--
 arch/mips/configs/maltaup_xpa_defconfig     |  4 +--
 arch/mips/configs/nlm_xlp_defconfig         |  2 +-
 arch/mips/configs/nlm_xlr_defconfig         |  2 +-
 arch/mips/dec/int-handler.S                 | 40 +++++++++++++++++++--
 arch/mips/netlogic/common/reset.S           | 11 +++---
 arch/mips/netlogic/common/smpboot.S         |  4 +--
 arch/mips/ralink/prom.c                     |  9 +++--
 arch/mips/ralink/rt288x.c                   | 10 ------
 arch/mips/ralink/rt305x.c                   | 11 ------
 arch/mips/ralink/rt3883.c                   | 10 ------
 arch/mips/sgi-ip22/Platform                 |  2 +-
 arch/powerpc/lib/sstep.c                    | 20 -----------
 arch/s390/kernel/crash_dump.c               | 18 +++++-----
 arch/s390/mm/pgtable.c                      | 19 +++++++++-
 crypto/Makefile                             |  2 ++
 drivers/acpi/nfit.c                         | 16 ++++++++-
 drivers/md/dm.c                             | 55 +++++++++++++++++++++++++++++
 drivers/mtd/maps/pmcmsp-flash.c             |  4 +--
 drivers/net/ethernet/ti/cpmac.c             |  2 +-
 drivers/nvdimm/namespace_devs.c             | 28 +++++++++++----
 drivers/nvdimm/nd.h                         |  1 +
 drivers/nvdimm/region_devs.c                |  9 +++++
 drivers/scsi/mvsas/mv_sas.c                 |  4 +--
 drivers/tty/serial/samsung.c                |  6 ++--
 drivers/usb/dwc3/gadget.h                   | 14 ++++----
 drivers/usb/gadget/function/f_fs.c          | 15 ++++++--
 drivers/usb/gadget/udc/dummy_hcd.c          |  2 ++
 drivers/usb/host/xhci-dbg.c                 |  2 +-
 drivers/usb/host/xhci-plat.c                |  2 ++
 drivers/usb/misc/iowarrior.c                | 21 +++++++----
 drivers/usb/serial/digi_acceleport.c        | 14 +++++---
 drivers/usb/serial/io_ti.c                  |  8 ++++-
 drivers/usb/serial/omninet.c                |  6 ----
 drivers/usb/serial/safe_serial.c            |  5 +++
 fs/ext4/inode.c                             |  4 +++
 include/linux/libnvdimm.h                   |  2 ++
 include/trace/events/syscalls.h             |  1 +
 mm/memcontrol.c                             | 36 +++++++++----------
 45 files changed, 290 insertions(+), 156 deletions(-)

[toc] | [next] | [standalone]


#1602467 — [PATCH 4.4 26/35] USB: iowarrior: fix NULL-deref in write

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 26/35] USB: iowarrior: fix NULL-deref in write
Message-ID<tlFcn-97-39@gated-at.bofh.it>
In reply to#1602463
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johan Hovold <johan@kernel.org>

commit de46e56653de7b3b54baa625bd582635008b8d05 upstream.

Make sure to verify that we have the required interrupt-out endpoint for
IOWarrior56 devices to avoid dereferencing a NULL-pointer in write
should a malicious device lack such an endpoint.

Fixes: 946b960d13c1 ("USB: add driver for iowarrior devices.")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/misc/iowarrior.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -804,6 +804,14 @@ static int iowarrior_probe(struct usb_in
 		goto error;
 	}
 
+	if (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW56) {
+		if (!dev->int_out_endpoint) {
+			dev_err(&interface->dev, "no interrupt-out endpoint found\n");
+			retval = -ENODEV;
+			goto error;
+		}
+	}
+
 	/* we have to check the report_size often, so remember it in the endianness suitable for our machine */
 	dev->report_size = usb_endpoint_maxp(dev->int_in_endpoint);
 	if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) &&

[toc] | [prev] | [next] | [standalone]


#1602468 — [PATCH 4.4 18/35] usb: gadget: dummy_hcd: clear usb_gadget region before registration

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 18/35] usb: gadget: dummy_hcd: clear usb_gadget region before registration
Message-ID<tlFcn-97-37@gated-at.bofh.it>
In reply to#1602463
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Peter Chen <peter.chen@nxp.com>

commit 5bbc852676ae08e818241cf66a3ffe4be44225c4 upstream.

When the user does device unbind and rebind test, the kernel will
show below dump due to usb_gadget memory region is dirty after unbind.
Clear usb_gadget region for every new probe.

root@imx6qdlsolo:/sys/bus/platform/drivers/dummy_udc# echo dummy_udc.0 > bind
[  102.523312] kobject (eddd78b0): tried to init an initialized object, something is seriously wrong.
[  102.532447] CPU: 0 PID: 734 Comm: sh Not tainted 4.10.0-rc7-00872-g1b2b8e9 #1298
[  102.539866] Hardware name: Freescale i.MX6 SoloX (Device Tree)
[  102.545717] Backtrace:
[  102.548225] [<c010d090>] (dump_backtrace) from [<c010d338>] (show_stack+0x18/0x1c)
[  102.555822]  r7:ede34000 r6:60010013 r5:00000000 r4:c0f29418
[  102.561512] [<c010d320>] (show_stack) from [<c040c2a4>] (dump_stack+0xb4/0xe8)
[  102.568764] [<c040c1f0>] (dump_stack) from [<c040e6d4>] (kobject_init+0x80/0x9c)
[  102.576187]  r10:0000001f r9:eddd7000 r8:eeaf8c10 r7:eddd78a8 r6:c177891c r5:c0f3b060
[  102.584036]  r4:eddd78b0 r3:00000000
[  102.587641] [<c040e654>] (kobject_init) from [<c05359a4>] (device_initialize+0x28/0xf8)
[  102.595665]  r5:eebc4800 r4:eddd78a8
[  102.599268] [<c053597c>] (device_initialize) from [<c05382ac>] (device_register+0x14/0x20)
[  102.607556]  r7:eddd78a8 r6:00000000 r5:eebc4800 r4:eddd78a8
[  102.613256] [<c0538298>] (device_register) from [<c0668ef4>] (usb_add_gadget_udc_release+0x8c/0x1ec)
[  102.622410]  r5:eebc4800 r4:eddd7860
[  102.626015] [<c0668e68>] (usb_add_gadget_udc_release) from [<c0669068>] (usb_add_gadget_udc+0x14/0x18)
[  102.635351]  r10:0000001f r9:eddd7000 r8:eddd788c r7:bf003770 r6:eddd77f8 r5:eddd7818
[  102.643198]  r4:eddd785c r3:eddd7b24
[  102.646834] [<c0669054>] (usb_add_gadget_udc) from [<bf003428>] (dummy_udc_probe+0x170/0x1c4 [dummy_hcd])
[  102.656458] [<bf0032b8>] (dummy_udc_probe [dummy_hcd]) from [<c053d114>] (platform_drv_probe+0x54/0xb8)
[  102.665881]  r10:00000008 r9:c1778960 r8:bf004128 r7:fffffdfb r6:bf004128 r5:eeaf8c10
[  102.673727]  r4:eeaf8c10
[  102.676293] [<c053d0c0>] (platform_drv_probe) from [<c053b160>] (driver_probe_device+0x264/0x474)
[  102.685186]  r7:00000000 r6:00000000 r5:c1778960 r4:eeaf8c10
[  102.690876] [<c053aefc>] (driver_probe_device) from [<c05397c4>] (bind_store+0xb8/0x14c)
[  102.698994]  r10:eeb3bb4c r9:ede34000 r8:0000000c r7:eeaf8c44 r6:bf004128 r5:c0f3b668
[  102.706840]  r4:eeaf8c10
[  102.709402] [<c053970c>] (bind_store) from [<c0538ca8>] (drv_attr_store+0x28/0x34)
[  102.716998]  r9:ede34000 r8:00000000 r7:ee3863c0 r6:ee3863c0 r5:c0538c80 r4:c053970c
[  102.724776] [<c0538c80>] (drv_attr_store) from [<c029c930>] (sysfs_kf_write+0x50/0x54)
[  102.732711]  r5:c0538c80 r4:0000000c
[  102.736313] [<c029c8e0>] (sysfs_kf_write) from [<c029be84>] (kernfs_fop_write+0x100/0x214)
[  102.744599]  r7:ee3863c0 r6:eeb3bb40 r5:00000000 r4:00000000
[  102.750287] [<c029bd84>] (kernfs_fop_write) from [<c0222dd8>] (__vfs_write+0x34/0x120)
[  102.758231]  r10:00000000 r9:ede34000 r8:c0108bc4 r7:0000000c r6:ede35f80 r5:c029bd84
[  102.766077]  r4:ee223780
[  102.768638] [<c0222da4>] (__vfs_write) from [<c0224678>] (vfs_write+0xa8/0x170)
[  102.775974]  r9:ede34000 r8:c0108bc4 r7:ede35f80 r6:01861cb0 r5:ee223780 r4:0000000c
[  102.783743] [<c02245d0>] (vfs_write) from [<c0225498>] (SyS_write+0x4c/0xa8)
[  102.790818]  r9:ede34000 r8:c0108bc4 r7:0000000c r6:01861cb0 r5:ee223780 r4:ee223780
[  102.798595] [<c022544c>] (SyS_write) from [<c0108a20>] (ret_fast_syscall+0x0/0x1c)
[  102.806188]  r7:00000004 r6:b6e83d58 r5:01861cb0 r4:0000000c

Fixes: 90fccb529d24 ("usb: gadget: Gadget directory cleanup - group UDC drivers")
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Tested-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/gadget/udc/dummy_hcd.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -1033,6 +1033,8 @@ static int dummy_udc_probe(struct platfo
 	int		rc;
 
 	dum = *((void **)dev_get_platdata(&pdev->dev));
+	/* Clear usb_gadget region for new registration to udc-core */
+	memzero_explicit(&dum->gadget, sizeof(struct usb_gadget));
 	dum->gadget.name = gadget_name;
 	dum->gadget.ops = &dummy_ops;
 	dum->gadget.max_speed = USB_SPEED_SUPER;

[toc] | [prev] | [next] | [standalone]


#1602469 — [PATCH 4.4 35/35] ext4: dont BUG when truncating encrypted inodes on the orphan list

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 35/35] ext4: dont BUG when truncating encrypted inodes on the orphan list
Message-ID<tlFcn-97-35@gated-at.bofh.it>
In reply to#1602463
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Theodore Ts'o <tytso@mit.edu>

commit 0d06863f903ac5f4f6efb0273079d27de3e53a28 upstream.

Fix a BUG when the kernel tries to mount a file system constructed as
follows:

echo foo > foo.txt
mke2fs -Fq -t ext4 -O encrypt foo.img 100
debugfs -w foo.img << EOF
write foo.txt a
set_inode_field a i_flags 0x80800
set_super_value s_last_orphan 12
quit
EOF

root@kvm-xfstests:~# mount -o loop foo.img /mnt
[  160.238770] ------------[ cut here ]------------
[  160.240106] kernel BUG at /usr/projects/linux/ext4/fs/ext4/inode.c:3874!
[  160.240106] invalid opcode: 0000 [#1] SMP
[  160.240106] Modules linked in:
[  160.240106] CPU: 0 PID: 2547 Comm: mount Tainted: G        W       4.10.0-rc3-00034-gcdd33b941b67 #227
[  160.240106] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1 04/01/2014
[  160.240106] task: f4518000 task.stack: f47b6000
[  160.240106] EIP: ext4_block_zero_page_range+0x1a7/0x2b4
[  160.240106] EFLAGS: 00010246 CPU: 0
[  160.240106] EAX: 00000001 EBX: f7be4b50 ECX: f47b7dc0 EDX: 00000007
[  160.240106] ESI: f43b05a8 EDI: f43babec EBP: f47b7dd0 ESP: f47b7dac
[  160.240106]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[  160.240106] CR0: 80050033 CR2: bfd85b08 CR3: 34a00680 CR4: 000006f0
[  160.240106] Call Trace:
[  160.240106]  ext4_truncate+0x1e9/0x3e5
[  160.240106]  ext4_fill_super+0x286f/0x2b1e
[  160.240106]  ? set_blocksize+0x2e/0x7e
[  160.240106]  mount_bdev+0x114/0x15f
[  160.240106]  ext4_mount+0x15/0x17
[  160.240106]  ? ext4_calculate_overhead+0x39d/0x39d
[  160.240106]  mount_fs+0x58/0x115
[  160.240106]  vfs_kern_mount+0x4b/0xae
[  160.240106]  do_mount+0x671/0x8c3
[  160.240106]  ? _copy_from_user+0x70/0x83
[  160.240106]  ? strndup_user+0x31/0x46
[  160.240106]  SyS_mount+0x57/0x7b
[  160.240106]  do_int80_syscall_32+0x4f/0x61
[  160.240106]  entry_INT80_32+0x2f/0x2f
[  160.240106] EIP: 0xb76b919e
[  160.240106] EFLAGS: 00000246 CPU: 0
[  160.240106] EAX: ffffffda EBX: 08053838 ECX: 08052188 EDX: 080537e8
[  160.240106] ESI: c0ed0000 EDI: 00000000 EBP: 080537e8 ESP: bfa13660
[  160.240106]  DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b
[  160.240106] Code: 59 8b 00 a8 01 0f 84 09 01 00 00 8b 07 66 25 00 f0 66 3d 00 80 75 61 89 f8 e8 3e e2 ff ff 84 c0 74 56 83 bf 48 02 00 00 00 75 02 <0f> 0b 81 7d e8 00 10 00 00 74 02 0f 0b 8b 43 04 8b 53 08 31 c9
[  160.240106] EIP: ext4_block_zero_page_range+0x1a7/0x2b4 SS:ESP: 0068:f47b7dac
[  160.317241] ---[ end trace d6a773a375c810a5 ]---

The problem is that when the kernel tries to truncate an inode in
ext4_truncate(), it tries to clear any on-disk data beyond i_size.
Without the encryption key, it can't do that, and so it triggers a
BUG.

E2fsck does *not* provide this service, and in practice most file
systems have their orphan list processed by e2fsck, so to avoid
crashing, this patch skips this step if we don't have access to the
encryption key (which is the case when processing the orphan list; in
all other cases, we will have the encryption key, or the kernel
wouldn't have allowed the file to be opened).

An open question is whether the fact that e2fsck isn't clearing the
bytes beyond i_size causing problems --- and if we've lived with it
not doing it for so long, can we drop this from the kernel replay of
the orphan list in all cases (not just when we don't have the key for
encrypted inodes).

Addresses-Google-Bug: #35209576

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/inode.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3573,6 +3573,10 @@ static int ext4_block_truncate_page(hand
 	unsigned blocksize;
 	struct inode *inode = mapping->host;
 
+	/* If we are processing an encrypted inode during orphan list handling */
+	if (ext4_encrypted_inode(inode) && !ext4_has_encryption_key(inode))
+		return 0;
+
 	blocksize = inode->i_sb->s_blocksize;
 	length = blocksize - (offset & (blocksize - 1));
 

[toc] | [prev] | [next] | [standalone]


#1602470 — [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Message-ID<tlFcn-97-43@gated-at.bofh.it>
In reply to#1602463
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

commit 9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1 upstream.

In linux-4.10-rc, NF_CT_PROTO_UDPLITE and NF_CT_PROTO_DCCP are bool
symbols instead of tristate, and kernelci.org reports a bunch of
warnings for this, like:

arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
arch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
arch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
arch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
arch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE

This changes all the MIPS defconfigs with these symbols to have them
built-in.

Fixes: 9b91c96c5d1f ("netfilter: conntrack: built-in support for UDPlite")
Fixes: c51d39010a1b ("netfilter: conntrack: built-in support for DCCP")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14999/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/configs/ip22_defconfig            |    4 ++--
 arch/mips/configs/malta_defconfig           |    4 ++--
 arch/mips/configs/malta_kvm_defconfig       |    4 ++--
 arch/mips/configs/malta_kvm_guest_defconfig |    4 ++--
 arch/mips/configs/maltaup_xpa_defconfig     |    4 ++--
 arch/mips/configs/nlm_xlp_defconfig         |    2 +-
 arch/mips/configs/nlm_xlr_defconfig         |    2 +-
 7 files changed, 12 insertions(+), 12 deletions(-)

--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -68,8 +68,8 @@ CONFIG_NETFILTER_NETLINK_QUEUE=m
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -59,8 +59,8 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
--- a/arch/mips/configs/malta_kvm_defconfig
+++ b/arch/mips/configs/malta_kvm_defconfig
@@ -60,8 +60,8 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
--- a/arch/mips/configs/malta_kvm_guest_defconfig
+++ b/arch/mips/configs/malta_kvm_guest_defconfig
@@ -59,8 +59,8 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
--- a/arch/mips/configs/maltaup_xpa_defconfig
+++ b/arch/mips/configs/maltaup_xpa_defconfig
@@ -61,8 +61,8 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
--- a/arch/mips/configs/nlm_xlp_defconfig
+++ b/arch/mips/configs/nlm_xlp_defconfig
@@ -111,7 +111,7 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m
--- a/arch/mips/configs/nlm_xlr_defconfig
+++ b/arch/mips/configs/nlm_xlr_defconfig
@@ -91,7 +91,7 @@ CONFIG_NETFILTER=y
 CONFIG_NF_CONNTRACK=m
 CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_UDPLITE=y
 CONFIG_NF_CONNTRACK_AMANDA=m
 CONFIG_NF_CONNTRACK_FTP=m
 CONFIG_NF_CONNTRACK_H323=m

[toc] | [prev] | [next] | [standalone]


#1604052 — Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change

FromBen Hutchings <ben@decadent.org.uk>
Date2017-03-19 18:20 +0100
SubjectRe: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Message-ID<tmMEO-tl-21@gated-at.bofh.it>
In reply to#1602470

[Multipart message — attachments visible in raw view] — view raw

On Thu, 2017-03-16 at 23:29 +0900, Greg Kroah-Hartman wrote:
> 4.4-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Arnd Bergmann <arnd@arndb.de>
> 
> commit 9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1 upstream.
> 
> In linux-4.10-rc, NF_CT_PROTO_UDPLITE and NF_CT_PROTO_DCCP are bool
> symbols instead of tristate, and kernelci.org reports a bunch of
> warnings for this, like:
> 
> arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> arch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
> arch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> arch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
> arch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> 
> This changes all the MIPS defconfigs with these symbols to have them
> built-in.
> 
> Fixes: 9b91c96c5d1f ("netfilter: conntrack: built-in support for UDPlite")
> Fixes: c51d39010a1b ("netfilter: conntrack: built-in support for DCCP")
[...]

I don't think this was needed for 4.4 or 4.9, as those symbols were
still tristate type.

Ben.

-- 
Ben Hutchings
Power corrupts.  Absolute power is kind of neat.
                           - John Lehman, Secretary of the US Navy
1981-1987

[toc] | [prev] | [next] | [standalone]


#1604326 — Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change

FromRalf Baechle <ralf@linux-mips.org>
Date2017-03-20 11:10 +0100
SubjectRe: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Message-ID<tn2qe-3a9-21@gated-at.bofh.it>
In reply to#1604052
On Sun, Mar 19, 2017 at 04:05:16PM +0000, Ben Hutchings wrote:
> Date:   Sun, 19 Mar 2017 16:05:16 +0000
> From: Ben Hutchings <ben@decadent.org.uk>
> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
>  linux-kernel@vger.kernel.org
> Cc: stable@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
>  linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
> Subject: Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for
>  NF_CT_PROTO_DCCP/UDPLITE change
> Content-Type: multipart/signed; micalg="pgp-sha512";
>         protocol="application/pgp-signature";
>  boundary="=-AwAI9QrjXVRk/IPasf40"
> 
> On Thu, 2017-03-16 at 23:29 +0900, Greg Kroah-Hartman wrote:
> > 4.4-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Arnd Bergmann <arnd@arndb.de>
> > 
> > commit 9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1 upstream.
> > 
> > In linux-4.10-rc, NF_CT_PROTO_UDPLITE and NF_CT_PROTO_DCCP are bool
> > symbols instead of tristate, and kernelci.org reports a bunch of
> > warnings for this, like:
> > 
> > arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> > arch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
> > arch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> > arch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
> > arch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> > 
> > This changes all the MIPS defconfigs with these symbols to have them
> > built-in.
> > 
> > Fixes: 9b91c96c5d1f ("netfilter: conntrack: built-in support for UDPlite")
> > Fixes: c51d39010a1b ("netfilter: conntrack: built-in support for DCCP")
> [...]
> 
> I don't think this was needed for 4.4 or 4.9, as those symbols were
> still tristate type.

Indeed, there's no waring for "make ARCH=mips malta_kvm_guest_defconfig".

  Ralf

[toc] | [prev] | [next] | [standalone]


#1604351 — Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-20 11:40 +0100
SubjectRe: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Message-ID<tn2Tf-3oS-11@gated-at.bofh.it>
In reply to#1604052
On Sun, Mar 19, 2017 at 04:05:16PM +0000, Ben Hutchings wrote:
> On Thu, 2017-03-16 at 23:29 +0900, Greg Kroah-Hartman wrote:
> > 4.4-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Arnd Bergmann <arnd@arndb.de>
> > 
> > commit 9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1 upstream.
> > 
> > In linux-4.10-rc, NF_CT_PROTO_UDPLITE and NF_CT_PROTO_DCCP are bool
> > symbols instead of tristate, and kernelci.org reports a bunch of
> > warnings for this, like:
> > 
> > arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> > arch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
> > arch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> > arch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
> > arch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> > 
> > This changes all the MIPS defconfigs with these symbols to have them
> > built-in.
> > 
> > Fixes: 9b91c96c5d1f ("netfilter: conntrack: built-in support for UDPlite")
> > Fixes: c51d39010a1b ("netfilter: conntrack: built-in support for DCCP")
> [...]
> 
> I don't think this was needed for 4.4 or 4.9, as those symbols were
> still tristate type.

I don't know, Arnd was the one that reported it to me.

Arnd?

greg k-h

[toc] | [prev] | [next] | [standalone]


#1604356 — Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change

FromArnd Bergmann <arnd@arndb.de>
Date2017-03-20 11:50 +0100
SubjectRe: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Message-ID<tn32V-3u2-5@gated-at.bofh.it>
In reply to#1604351
On Mon, Mar 20, 2017 at 11:30 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Sun, Mar 19, 2017 at 04:05:16PM +0000, Ben Hutchings wrote:
>> On Thu, 2017-03-16 at 23:29 +0900, Greg Kroah-Hartman wrote:
>> > 4.4-stable review patch.  If anyone has any objections, please let me know.
>> >
>> > ------------------
>> >
>> > From: Arnd Bergmann <arnd@arndb.de>
>> >
>> > commit 9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1 upstream.
>> >
>> > In linux-4.10-rc, NF_CT_PROTO_UDPLITE and NF_CT_PROTO_DCCP are bool
>> > symbols instead of tristate, and kernelci.org reports a bunch of
>> > warnings for this, like:
>> >
>> > arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
>> > arch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
>> > arch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
>> > arch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
>> > arch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
>> >
>> > This changes all the MIPS defconfigs with these symbols to have them
>> > built-in.
>> >
>> > Fixes: 9b91c96c5d1f ("netfilter: conntrack: built-in support for UDPlite")
>> > Fixes: c51d39010a1b ("netfilter: conntrack: built-in support for DCCP")
>> [...]
>>
>> I don't think this was needed for 4.4 or 4.9, as those symbols were
>> still tristate type.
>
> I don't know, Arnd was the one that reported it to me.
>
> Arnd?

I thought I had only reported it for the v4.10-stable tree. I was a bit vague
about which of the ones I reported were needed on older trees as well,
but the changelog text is fairly specific.

      Arnd

[toc] | [prev] | [next] | [standalone]


#1604764 — Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-20 17:40 +0100
SubjectRe: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Message-ID<tn8vF-7pZ-47@gated-at.bofh.it>
In reply to#1604356
On Mon, Mar 20, 2017 at 11:42:39AM +0100, Arnd Bergmann wrote:
> On Mon, Mar 20, 2017 at 11:30 AM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > On Sun, Mar 19, 2017 at 04:05:16PM +0000, Ben Hutchings wrote:
> >> On Thu, 2017-03-16 at 23:29 +0900, Greg Kroah-Hartman wrote:
> >> > 4.4-stable review patch.  If anyone has any objections, please let me know.
> >> >
> >> > ------------------
> >> >
> >> > From: Arnd Bergmann <arnd@arndb.de>
> >> >
> >> > commit 9ddc16ad8e0bc7742fc96d5aaabc5b8698512cd1 upstream.
> >> >
> >> > In linux-4.10-rc, NF_CT_PROTO_UDPLITE and NF_CT_PROTO_DCCP are bool
> >> > symbols instead of tristate, and kernelci.org reports a bunch of
> >> > warnings for this, like:
> >> >
> >> > arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> >> > arch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
> >> > arch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> >> > arch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
> >> > arch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
> >> >
> >> > This changes all the MIPS defconfigs with these symbols to have them
> >> > built-in.
> >> >
> >> > Fixes: 9b91c96c5d1f ("netfilter: conntrack: built-in support for UDPlite")
> >> > Fixes: c51d39010a1b ("netfilter: conntrack: built-in support for DCCP")
> >> [...]
> >>
> >> I don't think this was needed for 4.4 or 4.9, as those symbols were
> >> still tristate type.
> >
> > I don't know, Arnd was the one that reported it to me.
> >
> > Arnd?
> 
> I thought I had only reported it for the v4.10-stable tree. I was a bit vague
> about which of the ones I reported were needed on older trees as well,
> but the changelog text is fairly specific.

You reported it there, but then on your other emails for other stable
trees, said that your previously mentioned patches fixed problems in
these trees as well.  A bit confusing, sorry I got it wrong.

Anyway, not a big deal, is this worth me reverting?  Does this cause an
issue with these arches on older kernels?

thanks,

greg k-h

[toc] | [prev] | [next] | [standalone]


#1604775 — Re: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change

FromRalf Baechle <ralf@linux-mips.org>
Date2017-03-20 17:50 +0100
SubjectRe: [PATCH 4.4 04/35] MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change
Message-ID<tn8Fj-7tv-5@gated-at.bofh.it>
In reply to#1604764
On Mon, Mar 20, 2017 at 05:29:30PM +0100, Greg Kroah-Hartman wrote:

> You reported it there, but then on your other emails for other stable
> trees, said that your previously mentioned patches fixed problems in
> these trees as well.  A bit confusing, sorry I got it wrong.
> 
> Anyway, not a big deal, is this worth me reverting?  Does this cause an
> issue with these arches on older kernels?

Can't imagine this is going to cause an issue and in case of doubt a "y"
should be safer than a "m" anyway ...

  Ralf

[toc] | [prev] | [next] | [standalone]


#1602471 — [PATCH 4.4 34/35] dm: flush queued bios when process blocks to avoid deadlock

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 34/35] dm: flush queued bios when process blocks to avoid deadlock
Message-ID<tlFcn-97-49@gated-at.bofh.it>
In reply to#1602463
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mikulas Patocka <mpatocka@redhat.com>

commit d67a5f4b5947aba4bfe9a80a2b86079c215ca755 upstream.

Commit df2cb6daa4 ("block: Avoid deadlocks with bio allocation by
stacking drivers") created a workqueue for every bio set and code
in bio_alloc_bioset() that tries to resolve some low-memory deadlocks
by redirecting bios queued on current->bio_list to the workqueue if the
system is low on memory.  However other deadlocks (see below **) may
happen, without any low memory condition, because generic_make_request
is queuing bios to current->bio_list (rather than submitting them).

** the related dm-snapshot deadlock is detailed here:
https://www.redhat.com/archives/dm-devel/2016-July/msg00065.html

Fix this deadlock by redirecting any bios on current->bio_list to the
bio_set's rescue workqueue on every schedule() call.  Consequently,
when the process blocks on a mutex, the bios queued on
current->bio_list are dispatched to independent workqueus and they can
complete without waiting for the mutex to be available.

The structure blk_plug contains an entry cb_list and this list can contain
arbitrary callback functions that are called when the process blocks.
To implement this fix DM (ab)uses the onstack plug's cb_list interface
to get its flush_current_bio_list() called at schedule() time.

This fixes the snapshot deadlock - if the map method blocks,
flush_current_bio_list() will be called and it redirects bios waiting
on current->bio_list to appropriate workqueues.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1267650
Depends-on: df2cb6daa4 ("block: Avoid deadlocks with bio allocation by stacking drivers")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/dm.c |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1467,11 +1467,62 @@ void dm_accept_partial_bio(struct bio *b
 }
 EXPORT_SYMBOL_GPL(dm_accept_partial_bio);
 
+/*
+ * Flush current->bio_list when the target map method blocks.
+ * This fixes deadlocks in snapshot and possibly in other targets.
+ */
+struct dm_offload {
+	struct blk_plug plug;
+	struct blk_plug_cb cb;
+};
+
+static void flush_current_bio_list(struct blk_plug_cb *cb, bool from_schedule)
+{
+	struct dm_offload *o = container_of(cb, struct dm_offload, cb);
+	struct bio_list list;
+	struct bio *bio;
+
+	INIT_LIST_HEAD(&o->cb.list);
+
+	if (unlikely(!current->bio_list))
+		return;
+
+	list = *current->bio_list;
+	bio_list_init(current->bio_list);
+
+	while ((bio = bio_list_pop(&list))) {
+		struct bio_set *bs = bio->bi_pool;
+		if (unlikely(!bs) || bs == fs_bio_set) {
+			bio_list_add(current->bio_list, bio);
+			continue;
+		}
+
+		spin_lock(&bs->rescue_lock);
+		bio_list_add(&bs->rescue_list, bio);
+		queue_work(bs->rescue_workqueue, &bs->rescue_work);
+		spin_unlock(&bs->rescue_lock);
+	}
+}
+
+static void dm_offload_start(struct dm_offload *o)
+{
+	blk_start_plug(&o->plug);
+	o->cb.callback = flush_current_bio_list;
+	list_add(&o->cb.list, &current->plug->cb_list);
+}
+
+static void dm_offload_end(struct dm_offload *o)
+{
+	list_del(&o->cb.list);
+	blk_finish_plug(&o->plug);
+}
+
 static void __map_bio(struct dm_target_io *tio)
 {
 	int r;
 	sector_t sector;
 	struct mapped_device *md;
+	struct dm_offload o;
 	struct bio *clone = &tio->clone;
 	struct dm_target *ti = tio->ti;
 
@@ -1484,7 +1535,11 @@ static void __map_bio(struct dm_target_i
 	 */
 	atomic_inc(&tio->io->io_count);
 	sector = clone->bi_iter.bi_sector;
+
+	dm_offload_start(&o);
 	r = ti->type->map(ti, clone);
+	dm_offload_end(&o);
+
 	if (r == DM_MAPIO_REMAPPED) {
 		/* the bio has been remapped so dispatch it */
 

[toc] | [prev] | [next] | [standalone]


#1602472 — [PATCH 4.4 32/35] s390/kdump: Use "LINUX" ELF note name instead of "CORE"

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 32/35] s390/kdump: Use "LINUX" ELF note name instead of "CORE"
Message-ID<tlFcn-97-47@gated-at.bofh.it>
In reply to#1602463
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Michael Holzheu <holzheu@linux.vnet.ibm.com>

commit a4a81d8eebdc1d209d034f62a082a5131e4242b5 upstream.

In binutils/libbfd (bfd/elf.c) it is enforced that all s390 specific ELF
notes like e.g. NT_S390_PREFIX or NT_S390_CTRS have "LINUX" specified
as note name. Otherwise the notes are ignored.

For /proc/vmcore we currently use "CORE" for these notes.

Up to now this has not been a real problem because the dump analysis tool
"crash" does not check the note name. But it will break all programs that
use libbfd for processing ELF notes.

So fix this and use "LINUX" for all s390 specific notes to comply with
libbfd.

Reported-by: Philipp Rudo <prudo@linux.vnet.ibm.com>
Reviewed-by: Philipp Rudo <prudo@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/s390/kernel/crash_dump.c |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

--- a/arch/s390/kernel/crash_dump.c
+++ b/arch/s390/kernel/crash_dump.c
@@ -23,6 +23,8 @@
 #define PTR_SUB(x, y) (((char *) (x)) - ((unsigned long) (y)))
 #define PTR_DIFF(x, y) ((unsigned long)(((char *) (x)) - ((unsigned long) (y))))
 
+#define LINUX_NOTE_NAME "LINUX"
+
 static struct memblock_region oldmem_region;
 
 static struct memblock_type oldmem_type = {
@@ -312,7 +314,7 @@ static void *nt_fpregset(void *ptr, stru
 static void *nt_s390_timer(void *ptr, struct save_area *sa)
 {
 	return nt_init(ptr, NT_S390_TIMER, &sa->timer, sizeof(sa->timer),
-			 KEXEC_CORE_NOTE_NAME);
+			 LINUX_NOTE_NAME);
 }
 
 /*
@@ -321,7 +323,7 @@ static void *nt_s390_timer(void *ptr, st
 static void *nt_s390_tod_cmp(void *ptr, struct save_area *sa)
 {
 	return nt_init(ptr, NT_S390_TODCMP, &sa->clk_cmp,
-		       sizeof(sa->clk_cmp), KEXEC_CORE_NOTE_NAME);
+		       sizeof(sa->clk_cmp), LINUX_NOTE_NAME);
 }
 
 /*
@@ -330,7 +332,7 @@ static void *nt_s390_tod_cmp(void *ptr,
 static void *nt_s390_tod_preg(void *ptr, struct save_area *sa)
 {
 	return nt_init(ptr, NT_S390_TODPREG, &sa->tod_reg,
-		       sizeof(sa->tod_reg), KEXEC_CORE_NOTE_NAME);
+		       sizeof(sa->tod_reg), LINUX_NOTE_NAME);
 }
 
 /*
@@ -339,7 +341,7 @@ static void *nt_s390_tod_preg(void *ptr,
 static void *nt_s390_ctrs(void *ptr, struct save_area *sa)
 {
 	return nt_init(ptr, NT_S390_CTRS, &sa->ctrl_regs,
-		       sizeof(sa->ctrl_regs), KEXEC_CORE_NOTE_NAME);
+		       sizeof(sa->ctrl_regs), LINUX_NOTE_NAME);
 }
 
 /*
@@ -348,7 +350,7 @@ static void *nt_s390_ctrs(void *ptr, str
 static void *nt_s390_prefix(void *ptr, struct save_area *sa)
 {
 	return nt_init(ptr, NT_S390_PREFIX, &sa->pref_reg,
-			 sizeof(sa->pref_reg), KEXEC_CORE_NOTE_NAME);
+			 sizeof(sa->pref_reg), LINUX_NOTE_NAME);
 }
 
 /*
@@ -357,7 +359,7 @@ static void *nt_s390_prefix(void *ptr, s
 static void *nt_s390_vx_high(void *ptr, __vector128 *vx_regs)
 {
 	return nt_init(ptr, NT_S390_VXRS_HIGH, &vx_regs[16],
-		       16 * sizeof(__vector128), KEXEC_CORE_NOTE_NAME);
+		       16 * sizeof(__vector128), LINUX_NOTE_NAME);
 }
 
 /*
@@ -370,12 +372,12 @@ static void *nt_s390_vx_low(void *ptr, _
 	int i;
 
 	note = (Elf64_Nhdr *)ptr;
-	note->n_namesz = strlen(KEXEC_CORE_NOTE_NAME) + 1;
+	note->n_namesz = strlen(LINUX_NOTE_NAME) + 1;
 	note->n_descsz = 16 * 8;
 	note->n_type = NT_S390_VXRS_LOW;
 	len = sizeof(Elf64_Nhdr);
 
-	memcpy(ptr + len, KEXEC_CORE_NOTE_NAME, note->n_namesz);
+	memcpy(ptr + len, LINUX_NOTE_NAME, note->n_namesz);
 	len = roundup(len + note->n_namesz, 4);
 
 	ptr += len;

[toc] | [prev] | [next] | [standalone]


#1602477 — [PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie calculation

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie calculation
Message-ID<tlFco-97-63@gated-at.bofh.it>
In reply to#1602463
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Williams <dan.j.williams@intel.com>

commit 86ef58a4e35e8fa66afb5898cf6dec6a3bb29f67 upstream.

The interleave-set cookie is a sum that sanity checks the composition of
an interleave set has not changed from when the namespace was initially
created.  The checksum is calculated by sorting the DIMMs by their
location in the interleave-set. The comparison for the sort must be
64-bit wide, not byte-by-byte as performed by memcmp() in the broken
case.

Fix the implementation to accept correct cookie values in addition to
the Linux "memcmp" order cookies, but only allow correct cookies to be
generated going forward. It does mean that namespaces created by
third-party-tooling, or created by newer kernels with this fix, will not
validate on older kernels. However, there are a couple mitigating
conditions:

    1/ platforms with namespace-label capable NVDIMMs are not widely
       available.

    2/ interleave-sets with a single-dimm are by definition not affected
       (nothing to sort). This covers the QEMU-KVM NVDIMM emulation case.

The cookie stored in the namespace label will be fixed by any write the
namespace label, the most straightforward way to achieve this is to
write to the "alt_name" attribute of a namespace in sysfs.

Fixes: eaf961536e16 ("libnvdimm, nfit: add interleave-set state-tracking infrastructure")
Reported-by: Nicholas Moulin <nicholas.w.moulin@linux.intel.com>
Tested-by: Nicholas Moulin <nicholas.w.moulin@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/nfit.c             |   16 +++++++++++++++-
 drivers/nvdimm/namespace_devs.c |   28 +++++++++++++++++++++-------
 drivers/nvdimm/nd.h             |    1 +
 drivers/nvdimm/region_devs.c    |    9 +++++++++
 include/linux/libnvdimm.h       |    2 ++
 5 files changed, 48 insertions(+), 8 deletions(-)

--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -965,7 +965,7 @@ static size_t sizeof_nfit_set_info(int n
 		+ num_mappings * sizeof(struct nfit_set_info_map);
 }
 
-static int cmp_map(const void *m0, const void *m1)
+static int cmp_map_compat(const void *m0, const void *m1)
 {
 	const struct nfit_set_info_map *map0 = m0;
 	const struct nfit_set_info_map *map1 = m1;
@@ -974,6 +974,14 @@ static int cmp_map(const void *m0, const
 			sizeof(u64));
 }
 
+static int cmp_map(const void *m0, const void *m1)
+{
+	const struct nfit_set_info_map *map0 = m0;
+	const struct nfit_set_info_map *map1 = m1;
+
+	return map0->region_offset - map1->region_offset;
+}
+
 /* Retrieve the nth entry referencing this spa */
 static struct acpi_nfit_memory_map *memdev_from_spa(
 		struct acpi_nfit_desc *acpi_desc, u16 range_index, int n)
@@ -1029,6 +1037,12 @@ static int acpi_nfit_init_interleave_set
 	sort(&info->mapping[0], nr, sizeof(struct nfit_set_info_map),
 			cmp_map, NULL);
 	nd_set->cookie = nd_fletcher64(info, sizeof_nfit_set_info(nr), 0);
+
+	/* support namespaces created with the wrong sort order */
+	sort(&info->mapping[0], nr, sizeof(struct nfit_set_info_map),
+			cmp_map_compat, NULL);
+	nd_set->altcookie = nd_fletcher64(info, sizeof_nfit_set_info(nr), 0);
+
 	ndr_desc->nd_set = nd_set;
 	devm_kfree(dev, info);
 
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -1534,6 +1534,7 @@ static int select_pmem_id(struct nd_regi
 static int find_pmem_label_set(struct nd_region *nd_region,
 		struct nd_namespace_pmem *nspm)
 {
+	u64 altcookie = nd_region_interleave_set_altcookie(nd_region);
 	u64 cookie = nd_region_interleave_set_cookie(nd_region);
 	struct nd_namespace_label *nd_label;
 	u8 select_id[NSLABEL_UUID_LEN];
@@ -1542,8 +1543,10 @@ static int find_pmem_label_set(struct nd
 	int rc = -ENODEV, l;
 	u16 i;
 
-	if (cookie == 0)
+	if (cookie == 0) {
+		dev_dbg(&nd_region->dev, "invalid interleave-set-cookie\n");
 		return -ENXIO;
+	}
 
 	/*
 	 * Find a complete set of labels by uuid.  By definition we can start
@@ -1552,13 +1555,24 @@ static int find_pmem_label_set(struct nd
 	for_each_label(l, nd_label, nd_region->mapping[0].labels) {
 		u64 isetcookie = __le64_to_cpu(nd_label->isetcookie);
 
-		if (isetcookie != cookie)
-			continue;
+		if (isetcookie != cookie) {
+			dev_dbg(&nd_region->dev, "invalid cookie in label: %pUb\n",
+					nd_label->uuid);
+			if (isetcookie != altcookie)
+				continue;
+
+			dev_dbg(&nd_region->dev, "valid altcookie in label: %pUb\n",
+					nd_label->uuid);
+		}
+
+		for (i = 0; nd_region->ndr_mappings; i++) {
+			if (has_uuid_at_pos(nd_region, nd_label->uuid, cookie, i))
+				continue;
+			if (has_uuid_at_pos(nd_region, nd_label->uuid, altcookie, i))
+				continue;
+			break;
+		}
 
-		for (i = 0; nd_region->ndr_mappings; i++)
-			if (!has_uuid_at_pos(nd_region, nd_label->uuid,
-						cookie, i))
-				break;
 		if (i < nd_region->ndr_mappings) {
 			/*
 			 * Give up if we don't find an instance of a
--- a/drivers/nvdimm/nd.h
+++ b/drivers/nvdimm/nd.h
@@ -245,6 +245,7 @@ struct nd_region *to_nd_region(struct de
 int nd_region_to_nstype(struct nd_region *nd_region);
 int nd_region_register_namespaces(struct nd_region *nd_region, int *err);
 u64 nd_region_interleave_set_cookie(struct nd_region *nd_region);
+u64 nd_region_interleave_set_altcookie(struct nd_region *nd_region);
 void nvdimm_bus_lock(struct device *dev);
 void nvdimm_bus_unlock(struct device *dev);
 bool is_nvdimm_bus_locked(struct device *dev);
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -379,6 +379,15 @@ u64 nd_region_interleave_set_cookie(stru
 	return 0;
 }
 
+u64 nd_region_interleave_set_altcookie(struct nd_region *nd_region)
+{
+	struct nd_interleave_set *nd_set = nd_region->nd_set;
+
+	if (nd_set)
+		return nd_set->altcookie;
+	return 0;
+}
+
 /*
  * Upon successful probe/remove, take/release a reference on the
  * associated interleave set (if present), and plant new btt + namespace
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -83,6 +83,8 @@ struct nd_cmd_desc {
 
 struct nd_interleave_set {
 	u64 cookie;
+	/* compatibility with initial buggy Linux implementation */
+	u64 altcookie;
 };
 
 struct nd_region_desc {

[toc] | [prev] | [next] | [standalone]


#1604050 — Re: [PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie calculation

FromBen Hutchings <ben@decadent.org.uk>
Date2017-03-19 18:20 +0100
SubjectRe: [PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie calculation
Message-ID<tmMEN-tl-5@gated-at.bofh.it>
In reply to#1602477

[Multipart message — attachments visible in raw view] — view raw

On Thu, 2017-03-16 at 23:29 +0900, Greg Kroah-Hartman wrote:
> 4.4-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Dan Williams <dan.j.williams@intel.com>
> 
> commit 86ef58a4e35e8fa66afb5898cf6dec6a3bb29f67 upstream.
> 
> The interleave-set cookie is a sum that sanity checks the composition of
> an interleave set has not changed from when the namespace was initially
> created.  The checksum is calculated by sorting the DIMMs by their
> location in the interleave-set. The comparison for the sort must be
> 64-bit wide, not byte-by-byte as performed by memcmp() in the broken
> case.
[...]
> --- a/drivers/acpi/nfit.c
> +++ b/drivers/acpi/nfit.c
[...]
> +static int cmp_map(const void *m0, const void *m1)
> +{
> +	const struct nfit_set_info_map *map0 = m0;
> +	const struct nfit_set_info_map *map1 = m1;
> +
> +	return map0->region_offset - map1->region_offset;
> +}
[...]

This is returning an int, thus it's effectively doing a 32-bit
comparison and not the 64-bit comparison you say is needed.

I think this function needs to do something like:

	return (map0->region_offset < map1->region_offset) ? -1 :
		(map0->region_offset == map1->region_offset) ? 0 : 1;

Ben.

-- 
Ben Hutchings
Power corrupts.  Absolute power is kind of neat.
                           - John Lehman, Secretary of the US Navy
1981-1987

[toc] | [prev] | [next] | [standalone]


#1604982 — Re: [PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie calculation

FromDan Williams <dan.j.williams@intel.com>
Date2017-03-20 19:30 +0100
SubjectRe: [PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie calculation
Message-ID<tnae5-cZ-11@gated-at.bofh.it>
In reply to#1604050
On Sun, Mar 19, 2017 at 9:38 AM, Ben Hutchings <ben@decadent.org.uk> wrote:
> On Thu, 2017-03-16 at 23:29 +0900, Greg Kroah-Hartman wrote:
>> 4.4-stable review patch.  If anyone has any objections, please let me know.
>>
>> ------------------
>>
>> From: Dan Williams <dan.j.williams@intel.com>
>>
>> commit 86ef58a4e35e8fa66afb5898cf6dec6a3bb29f67 upstream.
>>
>> The interleave-set cookie is a sum that sanity checks the composition of
>> an interleave set has not changed from when the namespace was initially
>> created.  The checksum is calculated by sorting the DIMMs by their
>> location in the interleave-set. The comparison for the sort must be
>> 64-bit wide, not byte-by-byte as performed by memcmp() in the broken
>> case.
> [...]
>> --- a/drivers/acpi/nfit.c
>> +++ b/drivers/acpi/nfit.c
> [...]
>> +static int cmp_map(const void *m0, const void *m1)
>> +{
>> +     const struct nfit_set_info_map *map0 = m0;
>> +     const struct nfit_set_info_map *map1 = m1;
>> +
>> +     return map0->region_offset - map1->region_offset;
>> +}
> [...]
>
> This is returning an int, thus it's effectively doing a 32-bit
> comparison and not the 64-bit comparison you say is needed.
>
> I think this function needs to do something like:
>
>         return (map0->region_offset < map1->region_offset) ? -1 :
>                 (map0->region_offset == map1->region_offset) ? 0 : 1;

Yes, you're right. We could end up with unexpected sign changes. Good catch.

[toc] | [prev] | [next] | [standalone]


#1602482 — [PATCH 4.4 09/35] mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 09/35] mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy
Message-ID<tlFco-97-67@gated-at.bofh.it>
In reply to#1602463
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

commit 906b268477bc03daaa04f739844c120fe4dbc991 upstream.

kernelci.org reports a warning for this driver, as it copies a local
variable into a 'const char *' string:

    drivers/mtd/maps/pmcmsp-flash.c:149:30: warning: passing argument 1 of 'strncpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

Using kstrndup() simplifies the code and avoids the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/maps/pmcmsp-flash.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/mtd/maps/pmcmsp-flash.c
+++ b/drivers/mtd/maps/pmcmsp-flash.c
@@ -139,15 +139,13 @@ static int __init init_msp_flash(void)
 		}
 
 		msp_maps[i].bankwidth = 1;
-		msp_maps[i].name = kmalloc(7, GFP_KERNEL);
+		msp_maps[i].name = kstrndup(flash_name, 7, GFP_KERNEL);
 		if (!msp_maps[i].name) {
 			iounmap(msp_maps[i].virt);
 			kfree(msp_parts[i]);
 			goto cleanup_loop;
 		}
 
-		msp_maps[i].name = strncpy(msp_maps[i].name, flash_name, 7);
-
 		for (j = 0; j < pcnt; j++) {
 			part_name[5] = '0' + i;
 			part_name[7] = '0' + j;

[toc] | [prev] | [next] | [standalone]


#1602487 — [PATCH 4.4 27/35] USB: serial: io_ti: fix NULL-deref in interrupt callback

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 27/35] USB: serial: io_ti: fix NULL-deref in interrupt callback
Message-ID<tlFco-97-73@gated-at.bofh.it>
In reply to#1602463
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johan Hovold <johan@kernel.org>

commit 0b1d250afb8eb9d65afb568bac9b9f9253a82b49 upstream.

Fix a NULL-pointer dereference in the interrupt callback should a
malicious device send data containing a bad port number by adding the
missing sanity check.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/io_ti.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -1674,6 +1674,12 @@ static void edge_interrupt_callback(stru
 	function    = TIUMP_GET_FUNC_FROM_CODE(data[0]);
 	dev_dbg(dev, "%s - port_number %d, function %d, info 0x%x\n", __func__,
 		port_number, function, data[1]);
+
+	if (port_number >= edge_serial->serial->num_ports) {
+		dev_err(dev, "bad port number %d\n", port_number);
+		goto exit;
+	}
+
 	port = edge_serial->serial->port[port_number];
 	edge_port = usb_get_serial_port_data(port);
 	if (!edge_port) {

[toc] | [prev] | [next] | [standalone]


#1602489 — [PATCH 4.4 07/35] MIPS: ip22: Fix ip28 build for modern gcc

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 07/35] MIPS: ip22: Fix ip28 build for modern gcc
Message-ID<tlFcp-97-91@gated-at.bofh.it>
In reply to#1602463
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

commit 23ca9b522383d3b9b7991d8586db30118992af4a upstream.

kernelci reports a failure of the ip28_defconfig build after upgrading its
gcc version:

arch/mips/sgi-ip22/Platform:29: *** gcc doesn't support needed option -mr10k-cache-barrier=store.  Stop.

The problem apparently is that the -mr10k-cache-barrier=store option is now
rejected for CPUs other than r10k. Explicitly including the CPU in the
check fixes this and is safe because both options were introduced in
gcc-4.4.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/15049/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/sgi-ip22/Platform |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/mips/sgi-ip22/Platform
+++ b/arch/mips/sgi-ip22/Platform
@@ -25,7 +25,7 @@ endif
 # Simplified: what IP22 does at 128MB+ in ksegN, IP28 does at 512MB+ in xkphys
 #
 ifdef CONFIG_SGI_IP28
-  ifeq ($(call cc-option-yn,-mr10k-cache-barrier=store), n)
+  ifeq ($(call cc-option-yn,-march=r10000 -mr10k-cache-barrier=store), n)
       $(error gcc doesn't support needed option -mr10k-cache-barrier=store)
   endif
 endif

[toc] | [prev] | [next] | [standalone]


#1602490 — [PATCH 4.4 03/35] crypto: improve gcc optimization flags for serpent and wp512

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-16 16:10 +0100
Subject[PATCH 4.4 03/35] crypto: improve gcc optimization flags for serpent and wp512
Message-ID<tlFcp-97-93@gated-at.bofh.it>
In reply to#1602463
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

commit 7d6e9105026788c497f0ab32fa16c82f4ab5ff61 upstream.

An ancient gcc bug (first reported in 2003) has apparently resurfaced
on MIPS, where kernelci.org reports an overly large stack frame in the
whirlpool hash algorithm:

crypto/wp512.c:987:1: warning: the frame size of 1112 bytes is larger than 1024 bytes [-Wframe-larger-than=]

With some testing in different configurations, I'm seeing large
variations in stack frames size up to 1500 bytes for what should have
around 300 bytes at most. I also checked the reference implementation,
which is essentially the same code but also comes with some test and
benchmarking infrastructure.

It seems that recent compiler versions on at least arm, arm64 and powerpc
have a partial fix for this problem, but enabling "-fsched-pressure", but
even with that fix they suffer from the issue to a certain degree. Some
testing on arm64 shows that the time needed to hash a given amount of
data is roughly proportional to the stack frame size here, which makes
sense given that the wp512 implementation is doing lots of loads for
table lookups, and the problem with the overly large stack is a result
of doing a lot more loads and stores for spilled registers (as seen from
inspecting the object code).

Disabling -fschedule-insns consistently fixes the problem for wp512,
in my collection of cross-compilers, the results are consistently better
or identical when comparing the stack sizes in this function, though
some architectures (notable x86) have schedule-insns disabled by
default.

The four columns are:
default: -O2
press:	 -O2 -fsched-pressure
nopress: -O2 -fschedule-insns -fno-sched-pressure
nosched: -O2 -no-schedule-insns (disables sched-pressure)

				default	press	nopress	nosched
alpha-linux-gcc-4.9.3		1136	848	1136	176
am33_2.0-linux-gcc-4.9.3	2100	2076	2100	2104
arm-linux-gnueabi-gcc-4.9.3	848	848	1048	352
cris-linux-gcc-4.9.3		272	272	272	272
frv-linux-gcc-4.9.3		1128	1000	1128	280
hppa64-linux-gcc-4.9.3		1128	336	1128	184
hppa-linux-gcc-4.9.3		644	308	644	276
i386-linux-gcc-4.9.3		352	352	352	352
m32r-linux-gcc-4.9.3		720	656	720	268
microblaze-linux-gcc-4.9.3	1108	604	1108	256
mips64-linux-gcc-4.9.3		1328	592	1328	208
mips-linux-gcc-4.9.3		1096	624	1096	240
powerpc64-linux-gcc-4.9.3	1088	432	1088	160
powerpc-linux-gcc-4.9.3		1080	584	1080	224
s390-linux-gcc-4.9.3		456	456	624	360
sh3-linux-gcc-4.9.3		292	292	292	292
sparc64-linux-gcc-4.9.3		992	240	992	208
sparc-linux-gcc-4.9.3		680	592	680	312
x86_64-linux-gcc-4.9.3		224	240	272	224
xtensa-linux-gcc-4.9.3		1152	704	1152	304

aarch64-linux-gcc-7.0.0		224	224	1104	208
arm-linux-gnueabi-gcc-7.0.1	824	824	1048	352
mips-linux-gcc-7.0.0		1120	648	1120	272
x86_64-linux-gcc-7.0.1		240	240	304	240

arm-linux-gnueabi-gcc-4.4.7	840			392
arm-linux-gnueabi-gcc-4.5.4	784	728	784	320
arm-linux-gnueabi-gcc-4.6.4	736	728	736	304
arm-linux-gnueabi-gcc-4.7.4	944	784	944	352
arm-linux-gnueabi-gcc-4.8.5	464	464	760	352
arm-linux-gnueabi-gcc-4.9.3	848	848	1048	352
arm-linux-gnueabi-gcc-5.3.1	824	824	1064	336
arm-linux-gnueabi-gcc-6.1.1	808	808	1056	344
arm-linux-gnueabi-gcc-7.0.1	824	824	1048	352

Trying the same test for serpent-generic, the picture is a bit different,
and while -fno-schedule-insns is generally better here than the default,
-fsched-pressure wins overall, so I picked that instead.

				default	press	nopress	nosched
alpha-linux-gcc-4.9.3		1392	864	1392	960
am33_2.0-linux-gcc-4.9.3	536	524	536	528
arm-linux-gnueabi-gcc-4.9.3	552	552	776	536
cris-linux-gcc-4.9.3		528	528	528	528
frv-linux-gcc-4.9.3		536	400	536	504
hppa64-linux-gcc-4.9.3		524	208	524	480
hppa-linux-gcc-4.9.3		768	472	768	508
i386-linux-gcc-4.9.3		564	564	564	564
m32r-linux-gcc-4.9.3		712	576	712	532
microblaze-linux-gcc-4.9.3	724	392	724	512
mips64-linux-gcc-4.9.3		720	384	720	496
mips-linux-gcc-4.9.3		728	384	728	496
powerpc64-linux-gcc-4.9.3	704	304	704	480
powerpc-linux-gcc-4.9.3		704	296	704	480
s390-linux-gcc-4.9.3		560	560	592	536
sh3-linux-gcc-4.9.3		540	540	540	540
sparc64-linux-gcc-4.9.3		544	352	544	496
sparc-linux-gcc-4.9.3		544	344	544	496
x86_64-linux-gcc-4.9.3		528	536	576	528
xtensa-linux-gcc-4.9.3		752	544	752	544

aarch64-linux-gcc-7.0.0		432	432	656	480
arm-linux-gnueabi-gcc-7.0.1	616	616	808	536
mips-linux-gcc-7.0.0		720	464	720	488
x86_64-linux-gcc-7.0.1		536	528	600	536

arm-linux-gnueabi-gcc-4.4.7	592			440
arm-linux-gnueabi-gcc-4.5.4	776	448	776	544
arm-linux-gnueabi-gcc-4.6.4	776	448	776	544
arm-linux-gnueabi-gcc-4.7.4	768	448	768	544
arm-linux-gnueabi-gcc-4.8.5	488	488	776	544
arm-linux-gnueabi-gcc-4.9.3	552	552	776	536
arm-linux-gnueabi-gcc-5.3.1	552	552	776	536
arm-linux-gnueabi-gcc-6.1.1	560	560	776	536
arm-linux-gnueabi-gcc-7.0.1	616	616	808	536

I did not do any runtime tests with serpent, so it is possible that stack
frame size does not directly correlate with runtime performance here and
it actually makes things worse, but it's more likely to help here, and
the reduced stack frame size is probably enough reason to apply the patch,
especially given that the crypto code is often used in deep call chains.

Link: https://kernelci.org/build/id/58797d7559b5149efdf6c3a9/logs/
Link: http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11488
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 crypto/Makefile |    2 ++
 1 file changed, 2 insertions(+)

--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_CRYPTO_SHA1) += sha1_generi
 obj-$(CONFIG_CRYPTO_SHA256) += sha256_generic.o
 obj-$(CONFIG_CRYPTO_SHA512) += sha512_generic.o
 obj-$(CONFIG_CRYPTO_WP512) += wp512.o
+CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns)  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
 obj-$(CONFIG_CRYPTO_TGR192) += tgr192.o
 obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o
 obj-$(CONFIG_CRYPTO_ECB) += ecb.o
@@ -85,6 +86,7 @@ obj-$(CONFIG_CRYPTO_BLOWFISH_COMMON) +=
 obj-$(CONFIG_CRYPTO_TWOFISH) += twofish_generic.o
 obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o
 obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o
+CFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure)  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
 obj-$(CONFIG_CRYPTO_AES) += aes_generic.o
 obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o
 obj-$(CONFIG_CRYPTO_CAST_COMMON) += cast_common.o

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.kernel


csiph-web