* Re: [PATCH 4.14 31/64] spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers
@ 2018-09-27 11:46 Sudip Mukherjee
2018-09-27 12:04 ` Kirill Kapranov
0 siblings, 1 reply; 5+ messages in thread
From: Sudip Mukherjee @ 2018-09-27 11:46 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, Stable, Kirill Kapranov, Mark Brown
Hi Greg,
On Thu, Sep 27, 2018 at 10:03 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> 4.14-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Kirill Kapranov <kirill.kapranov@compulab.co.il>
>
> commit 1a4327fbf4554d5b78d75b19a13d40d6de220159 upstream.
>
> On systems where some controllers get a dynamic ID assigned and some have
> a fixed number (e.g. from ACPI tables), the current implementation might
> run into an IDR collision: in case of a fixed bus number is gotten by a
> driver (but not marked busy in IDR tree) and a driver with dynamic bus
> number gets the same ID and predictably fails.
>
> Fix this by means of checking-in fixed IDsin IDR as far as dynamic ones
> at the moment of the controller registration.
>
> Fixes: 9b61e302210e (spi: Pick spi bus number from Linux idr or spi alias)
> Signed-off-by: Kirill Kapranov <kirill.kapranov@compulab.co.il>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Cc: stable@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There is another later patch which fixes this patch.
04b2d03a7565 ("spi: Fix double IDR allocation with DT aliases") , can
you please add it to the release also..
--
Regards
Sudip
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 4.14 31/64] spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers
2018-09-27 11:46 [PATCH 4.14 31/64] spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers Sudip Mukherjee
@ 2018-09-27 12:04 ` Kirill Kapranov
2018-09-27 19:20 ` Greg Kroah-Hartman
2018-09-27 21:44 ` Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Kirill Kapranov @ 2018-09-27 12:04 UTC (permalink / raw)
To: Sudip Mukherjee, Greg Kroah-Hartman; +Cc: linux-kernel, Stable, Mark Brown
Hi Greg,
Sudip is absolutely right, the patch he mentioned,
04b2d03a7565 ("spi: Fix double IDR allocation with DT aliases"),
MUST be added too with the mine.
Sudip, thank you for reminding.
--
Best Regards,
Kirill
> Hi Greg,
>
> On Thu, Sep 27, 2018 at 10:03 AM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
>> 4.14-stable review patch. If anyone has any objections, please let me know.
>>
>> ------------------
>>
>> From: Kirill Kapranov <kirill.kapranov@compulab.co.il>
>>
>> commit 1a4327fbf4554d5b78d75b19a13d40d6de220159 upstream.
>>
>> On systems where some controllers get a dynamic ID assigned and some have
>> a fixed number (e.g. from ACPI tables), the current implementation might
>> run into an IDR collision: in case of a fixed bus number is gotten by a
>> driver (but not marked busy in IDR tree) and a driver with dynamic bus
>> number gets the same ID and predictably fails.
>>
>> Fix this by means of checking-in fixed IDsin IDR as far as dynamic ones
>> at the moment of the controller registration.
>>
>> Fixes: 9b61e302210e (spi: Pick spi bus number from Linux idr or spi alias)
>> Signed-off-by: Kirill Kapranov <kirill.kapranov@compulab.co.il>
>> Signed-off-by: Mark Brown <broonie@kernel.org>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> There is another later patch which fixes this patch.
>
> 04b2d03a7565 ("spi: Fix double IDR allocation with DT aliases") , can
> you please add it to the release also..
>
>
> --
> Regards
> Sudip
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 4.14 31/64] spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers
2018-09-27 12:04 ` Kirill Kapranov
@ 2018-09-27 19:20 ` Greg Kroah-Hartman
2018-09-27 21:44 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2018-09-27 19:20 UTC (permalink / raw)
To: Kirill Kapranov; +Cc: Sudip Mukherjee, linux-kernel, Stable, Mark Brown
On Thu, Sep 27, 2018 at 03:04:20PM +0300, Kirill Kapranov wrote:
> Hi Greg,
>
> Sudip is absolutely right, the patch he mentioned,
> 04b2d03a7565 ("spi: Fix double IDR allocation with DT aliases"),
> MUST be added too with the mine.
>
> Sudip, thank you for reminding.
Thanks, I'll go queue this up now.
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 4.14 31/64] spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers
2018-09-27 12:04 ` Kirill Kapranov
2018-09-27 19:20 ` Greg Kroah-Hartman
@ 2018-09-27 21:44 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2018-09-27 21:44 UTC (permalink / raw)
To: Kirill Kapranov; +Cc: Sudip Mukherjee, Greg Kroah-Hartman, linux-kernel, Stable
[-- Attachment #1: Type: text/plain, Size: 286 bytes --]
On Thu, Sep 27, 2018 at 03:04:20PM +0300, Kirill Kapranov wrote:
> Sudip is absolutely right, the patch he mentioned,
> 04b2d03a7565 ("spi: Fix double IDR allocation with DT aliases"),
> MUST be added too with the mine.
> Sudip, thank you for reminding.
Yes, they're both required.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 4.14 00/64] 4.14.73-stable review
@ 2018-09-27 9:03 Greg Kroah-Hartman
2018-09-27 9:03 ` [PATCH 4.14 31/64] spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2018-09-27 9:03 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, torvalds, akpm, linux, shuah, patches,
ben.hutchings, lkft-triage, stable
This is the start of the stable review cycle for the 4.14.73 release.
There are 64 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 Sep 29 09:02:21 UTC 2018.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.73-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.14.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 4.14.73-rc1
Thomas Gleixner <tglx@linutronix.de>
tick/nohz: Prevent bogus softirq pending warning
Steve Wise <swise@opengridcomputing.com>
iw_cxgb4: only allow 1 flush on user qps
Nadav Amit <namit@vmware.com>
vmw_balloon: include asm/io.h
Zachary Zhang <zhangzg@marvell.com>
PCI: aardvark: Size bridges before resources allocation
Steve Muckle <smuckle@google.com>
sched/fair: Fix vruntime_normalized() for remote non-migration wakeup
Eric Biggers <ebiggers@google.com>
ext4: show test_dummy_encryption mount option in /proc/mounts
Li Dongyang <dongyangli@ddn.com>
ext4: don't mark mmp buffer head dirty
Theodore Ts'o <tytso@mit.edu>
ext4: fix online resizing for bigalloc file systems with a 1k block size
Theodore Ts'o <tytso@mit.edu>
ext4: fix online resize's handling of a too-small final block group
Theodore Ts'o <tytso@mit.edu>
ext4: recalucate superblock checksum after updating free blocks/inodes
Theodore Ts'o <tytso@mit.edu>
ext4: avoid arithemetic overflow that can trigger a BUG
Theodore Ts'o <tytso@mit.edu>
ext4: avoid divide by zero fault when deleting corrupted inline directories
Theodore Ts'o <tytso@mit.edu>
ext4: check to make sure the rename(2)'s destination is not freed
Gustavo A. R. Silva <gustavo@embeddedor.com>
tty: vt_ioctl: fix potential Spectre v1
Lyude Paul <lyude@redhat.com>
drm/atomic: Use drm_drv_uses_atomic_modeset() for debugfs creation
Alex Deucher <alexander.deucher@amd.com>
drm/amdgpu: add new polaris pci id
Emil Lundmark <lndmrk@chromium.org>
drm: udl: Destroy framebuffer only if it was initialized
Boris Brezillon <boris.brezillon@bootlin.com>
drm/vc4: Fix the "no scaling" case on multi-planar YUV formats
Lyude Paul <lyude@redhat.com>
drm/nouveau/drm/nouveau: Prevent handling ACPI HPD events too early
Lyude Paul <lyude@redhat.com>
drm/nouveau/drm/nouveau: Use pm_runtime_get_noresume() in connector_detect()
Lyude Paul <lyude@redhat.com>
drm/nouveau/drm/nouveau: Fix bogus drm_kms_helper_poll_enable() placement
Lyude Paul <lyude@redhat.com>
drm/nouveau/drm/nouveau: Don't forget to cancel hpd_work on suspend/unload
Lyude Paul <lyude@redhat.com>
drm/nouveau: Fix deadlocks in nouveau_connector_detect()
Junxiao Bi <junxiao.bi@oracle.com>
ocfs2: fix ocfs2 read block panic
Richard Weinberger <richard@nod.at>
Revert "ubifs: xattr: Don't operate on deleted inodes"
Vincent Pelletier <plr.vincent@gmail.com>
scsi: target: iscsi: Use bin2hex instead of a re-implementation
Vincent Pelletier <plr.vincent@gmail.com>
scsi: target: iscsi: Use hex2bin instead of a re-implementation
Lubomir Rintel <lkundrak@v3.sk>
Revert "uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name"
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Revert "rpmsg: core: add support to power domains for devices"
Joel Fernandes (Google) <joel@joelfernandes.org>
mm: shmem.c: Correctly annotate new inodes for lockdep
Vaibhav Nagarnaik <vnagarnaik@google.com>
ring-buffer: Allow for rescheduling when removing pages
Mika Westerberg <mika.westerberg@linux.intel.com>
Revert "PCI: Add ACS quirk for Intel 300 series"
Kirill Kapranov <kirill.kapranov@compulab.co.il>
spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers
Boris Ostrovsky <boris.ostrovsky@oracle.com>
xen/x86/vpmu: Zero struct pt_regs before calling into sample handling code
Juergen Gross <jgross@suse.com>
xen/netfront: don't bug in case of too many frags
Mario Limonciello <mario.limonciello@dell.com>
platform/x86: alienware-wmi: Correct a memory leak
Takashi Sakamoto <o-takashi@sakamocchi.jp>
ALSA: oxfw: fix memory leak of private data
Takashi Sakamoto <o-takashi@sakamocchi.jp>
ALSA: oxfw: fix memory leak of discovered stream formats at error path
Takashi Sakamoto <o-takashi@sakamocchi.jp>
ALSA: oxfw: fix memory leak for model-dependent data at error path
Takashi Sakamoto <o-takashi@sakamocchi.jp>
ALSA: fireworks: fix memory leak of response buffer at error path
Takashi Sakamoto <o-takashi@sakamocchi.jp>
ALSA: firewire-tascam: fix memory leak of private data
Takashi Sakamoto <o-takashi@sakamocchi.jp>
ALSA: firewire-digi00x: fix memory leak of private data
Takashi Sakamoto <o-takashi@sakamocchi.jp>
ALSA: fireface: fix memory leak in ff400_switch_fetching_mode()
Willy Tarreau <w@1wt.eu>
ALSA: emu10k1: fix possible info leak to userspace on SNDRV_EMU10K1_IOCTL_INFO
Takashi Sakamoto <o-takashi@sakamocchi.jp>
ALSA: bebob: use address returned by kmalloc() instead of kernel stack for streaming DMA mapping
Takashi Sakamoto <o-takashi@sakamocchi.jp>
ALSA: bebob: fix memory leak for M-Audio FW1814 and ProjectMix I/O at error path
Jiada Wang <jiada_wang@mentor.com>
ASoC: rsnd: fixup not to call clk_get/set under non-atomic
Sébastien Szymanski <sebastien.szymanski@armadeus.com>
ASoC: cs4265: fix MMTLR Data switch control
Suren Baghdasaryan <surenb@google.com>
NFC: Fix the number of pipes
Suren Baghdasaryan <surenb@google.com>
NFC: Fix possible memory corruption when handling SHDLC I-Frame commands
Sabrina Dubroca <sd@queasysnail.net>
tls: clear key material from kernel memory when do_tls_setsockopt_conf fails
Sabrina Dubroca <sd@queasysnail.net>
tls: zero the crypto information from tls_context before freeing
Sabrina Dubroca <sd@queasysnail.net>
tls: don't copy the key out of tls12_crypto_info_aes_gcm_128
Davide Caratti <dcaratti@redhat.com>
net/sched: act_sample: fix NULL dereference in the data path
Paolo Abeni <pabeni@redhat.com>
udp6: add missing checks on edumux packet processing
Vasily Khoruzhick <vasilykh@arista.com>
neighbour: confirm neigh entries when ARP packet is received
Paolo Abeni <pabeni@redhat.com>
udp4: fix IP_CMSG_CHECKSUM for connected sockets
Bjørn Mork <bjorn@mork.no>
qmi_wwan: set DTR for modems in forced USB2 mode
Guillaume Nault <g.nault@alphalink.fr>
pppoe: fix reception of frames with no mac header
Colin Ian King <colin.king@canonical.com>
net: hp100: fix always-true check for link up state
Willy Tarreau <w@1wt.eu>
net/appletalk: fix minor pointer leak to userspace in SIOCFINDIPDDPRT
Eric Dumazet <edumazet@google.com>
ipv6: fix possible use-after-free in ip6_xmit()
Toke Høiland-Jørgensen <toke@toke.dk>
gso_segment: Reset skb->mac_len after modifying network header
-------------
Diffstat:
Makefile | 4 +-
arch/x86/xen/pmu.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 14 ++++---
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
drivers/gpu/drm/drm_atomic.c | 2 +-
drivers/gpu/drm/drm_debugfs.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_connector.c | 42 +++++++++++++++----
drivers/gpu/drm/nouveau/nouveau_display.c | 42 ++++++++++++++-----
drivers/gpu/drm/nouveau/nouveau_display.h | 2 +-
drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +-
drivers/gpu/drm/udl/udl_fb.c | 8 ++--
drivers/gpu/drm/vc4/vc4_plane.c | 25 ++++++-----
drivers/infiniband/hw/cxgb4/qp.c | 6 +++
drivers/misc/vmw_balloon.c | 1 +
drivers/net/appletalk/ipddp.c | 8 +++-
drivers/net/ethernet/hp/hp100.c | 2 +-
drivers/net/ppp/pppoe.c | 3 ++
drivers/net/usb/qmi_wwan.c | 14 +++----
drivers/net/xen-netfront.c | 8 +++-
drivers/pci/host/pci-aardvark.c | 1 +
drivers/pci/quirks.c | 6 ---
drivers/platform/x86/alienware-wmi.c | 1 +
drivers/rpmsg/rpmsg_core.c | 7 ----
drivers/spi/spi.c | 9 ++++
drivers/target/iscsi/iscsi_target_auth.c | 45 ++++++++------------
drivers/tty/vt/vt_ioctl.c | 4 ++
fs/ext4/dir.c | 20 ++++-----
fs/ext4/ext4.h | 3 ++
fs/ext4/inline.c | 4 +-
fs/ext4/inode.c | 9 +++-
fs/ext4/mmp.c | 1 -
fs/ext4/namei.c | 6 +++
fs/ext4/resize.c | 23 +++++++++-
fs/ext4/super.c | 4 ++
fs/ocfs2/buffer_head_io.c | 1 +
fs/ubifs/xattr.c | 24 -----------
include/net/nfc/hci.h | 2 +-
include/net/tls.h | 14 ++++---
include/uapi/linux/keyctl.h | 2 +-
kernel/sched/fair.c | 3 +-
kernel/time/tick-sched.c | 2 +-
kernel/trace/ring_buffer.c | 2 +
mm/shmem.c | 2 +
net/core/neighbour.c | 13 +++---
net/ipv4/af_inet.c | 1 +
net/ipv4/udp.c | 49 ++++++++++++----------
net/ipv6/ip6_offload.c | 1 +
net/ipv6/ip6_output.c | 6 +--
net/ipv6/udp.c | 65 ++++++++++++++++-------------
net/nfc/hci/core.c | 10 +++++
net/sched/act_sample.c | 2 +-
net/tls/tls_main.c | 17 ++++++--
net/tls/tls_sw.c | 7 +---
security/keys/dh.c | 2 +-
sound/firewire/bebob/bebob.c | 2 +
sound/firewire/bebob/bebob_maudio.c | 28 ++++++-------
sound/firewire/digi00x/digi00x.c | 1 +
sound/firewire/fireface/ff-protocol-ff400.c | 9 ++--
sound/firewire/fireworks/fireworks.c | 2 +
sound/firewire/oxfw/oxfw.c | 10 +++++
sound/firewire/tascam/tascam.c | 1 +
sound/pci/emu10k1/emufx.c | 2 +-
sound/soc/codecs/cs4265.c | 4 +-
sound/soc/sh/rcar/core.c | 11 +++++
sound/soc/sh/rcar/rsnd.h | 7 ++++
sound/soc/sh/rcar/ssi.c | 16 ++++---
66 files changed, 401 insertions(+), 248 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 4.14 31/64] spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers
2018-09-27 9:03 [PATCH 4.14 00/64] 4.14.73-stable review Greg Kroah-Hartman
@ 2018-09-27 9:03 ` Greg Kroah-Hartman
0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2018-09-27 9:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, stable, Kirill Kapranov, Mark Brown
4.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kirill Kapranov <kirill.kapranov@compulab.co.il>
commit 1a4327fbf4554d5b78d75b19a13d40d6de220159 upstream.
On systems where some controllers get a dynamic ID assigned and some have
a fixed number (e.g. from ACPI tables), the current implementation might
run into an IDR collision: in case of a fixed bus number is gotten by a
driver (but not marked busy in IDR tree) and a driver with dynamic bus
number gets the same ID and predictably fails.
Fix this by means of checking-in fixed IDsin IDR as far as dynamic ones
at the moment of the controller registration.
Fixes: 9b61e302210e (spi: Pick spi bus number from Linux idr or spi alias)
Signed-off-by: Kirill Kapranov <kirill.kapranov@compulab.co.il>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/spi/spi.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2135,6 +2135,15 @@ int spi_register_controller(struct spi_c
if (WARN(id < 0, "couldn't get idr"))
return id;
ctlr->bus_num = id;
+ } else {
+ /* devices with a fixed bus num must check-in with the num */
+ mutex_lock(&board_lock);
+ id = idr_alloc(&spi_master_idr, ctlr, ctlr->bus_num,
+ ctlr->bus_num + 1, GFP_KERNEL);
+ mutex_unlock(&board_lock);
+ if (WARN(id < 0, "couldn't get idr"))
+ return id == -ENOSPC ? -EBUSY : id;
+ ctlr->bus_num = id;
}
INIT_LIST_HEAD(&ctlr->queue);
spin_lock_init(&ctlr->queue_lock);
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-09-28 4:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-27 11:46 [PATCH 4.14 31/64] spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers Sudip Mukherjee
2018-09-27 12:04 ` Kirill Kapranov
2018-09-27 19:20 ` Greg Kroah-Hartman
2018-09-27 21:44 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2018-09-27 9:03 [PATCH 4.14 00/64] 4.14.73-stable review Greg Kroah-Hartman
2018-09-27 9:03 ` [PATCH 4.14 31/64] spi: fix IDR collision on systems with both fixed and dynamic SPI bus numbers Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).