From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Mike Frysinger <vapier@gentoo.org>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Peter Oberparleiter <oberpar@linux.vnet.ibm.com>,
Sebastian Ott <sebott@linux.vnet.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [PATCH 3.10 20/86] s390/cio: fix driver callback initialization for ccw consoles
Date: Sun, 4 May 2014 11:40:55 -0400 [thread overview]
Message-ID: <20140504154143.126299536@linuxfoundation.org> (raw)
In-Reply-To: <20140504154140.444932005@linuxfoundation.org>
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Ott <sebott@linux.vnet.ibm.com>
commit 2253e8d79237c69086ded391e6767afe16972527 upstream.
ccw consoles are in use before they can be properly registered with
the driver core. For devices which are in use by a device driver we
rely on the ccw_device's pointer to the driver callbacks to be valid.
For ccw consoles this pointer is NULL until they are registered later
during boot and we dereferenced this pointer. This worked by
chance on 64 bit builds (cdev->drv was NULL but the optional callback
cdev->drv->path_event was also NULL by coincidence) and was unnoticed
until we received reports about boot failures on 31 bit systems.
Fix it by initializing the driver pointer for ccw consoles.
Reported-by: Mike Frysinger <vapier@gentoo.org>
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/s390/include/asm/ccwdev.h | 2 +-
drivers/s390/char/con3215.c | 2 +-
drivers/s390/char/con3270.c | 6 +-----
drivers/s390/char/raw3270.c | 10 +++++++++-
drivers/s390/char/raw3270.h | 2 +-
drivers/s390/cio/device.c | 3 ++-
6 files changed, 15 insertions(+), 10 deletions(-)
--- a/arch/s390/include/asm/ccwdev.h
+++ b/arch/s390/include/asm/ccwdev.h
@@ -219,7 +219,7 @@ extern void ccw_device_get_id(struct ccw
#define to_ccwdev(n) container_of(n, struct ccw_device, dev)
#define to_ccwdrv(n) container_of(n, struct ccw_driver, driver)
-extern struct ccw_device *ccw_device_probe_console(void);
+extern struct ccw_device *ccw_device_probe_console(struct ccw_driver *);
extern void ccw_device_wait_idle(struct ccw_device *);
extern int ccw_device_force_console(struct ccw_device *);
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -922,7 +922,7 @@ static int __init con3215_init(void)
raw3215_freelist = req;
}
- cdev = ccw_device_probe_console();
+ cdev = ccw_device_probe_console(&raw3215_ccw_driver);
if (IS_ERR(cdev))
return -ENODEV;
--- a/drivers/s390/char/con3270.c
+++ b/drivers/s390/char/con3270.c
@@ -576,7 +576,6 @@ static struct console con3270 = {
static int __init
con3270_init(void)
{
- struct ccw_device *cdev;
struct raw3270 *rp;
void *cbuf;
int i;
@@ -591,10 +590,7 @@ con3270_init(void)
cpcmd("TERM AUTOCR OFF", NULL, 0, NULL);
}
- cdev = ccw_device_probe_console();
- if (IS_ERR(cdev))
- return -ENODEV;
- rp = raw3270_setup_console(cdev);
+ rp = raw3270_setup_console();
if (IS_ERR(rp))
return PTR_ERR(rp);
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -776,16 +776,24 @@ raw3270_setup_device(struct ccw_device *
}
#ifdef CONFIG_TN3270_CONSOLE
+/* Tentative definition - see below for actual definition. */
+static struct ccw_driver raw3270_ccw_driver;
+
/*
* Setup 3270 device configured as console.
*/
-struct raw3270 __init *raw3270_setup_console(struct ccw_device *cdev)
+struct raw3270 __init *raw3270_setup_console(void)
{
+ struct ccw_device *cdev;
unsigned long flags;
struct raw3270 *rp;
char *ascebc;
int rc;
+ cdev = ccw_device_probe_console(&raw3270_ccw_driver);
+ if (IS_ERR(cdev))
+ return ERR_CAST(cdev);
+
rp = kzalloc(sizeof(struct raw3270), GFP_KERNEL | GFP_DMA);
ascebc = kzalloc(256, GFP_KERNEL);
rc = raw3270_setup_device(cdev, rp, ascebc);
--- a/drivers/s390/char/raw3270.h
+++ b/drivers/s390/char/raw3270.h
@@ -190,7 +190,7 @@ raw3270_put_view(struct raw3270_view *vi
wake_up(&raw3270_wait_queue);
}
-struct raw3270 *raw3270_setup_console(struct ccw_device *cdev);
+struct raw3270 *raw3270_setup_console(void);
void raw3270_wait_cons_dev(struct raw3270 *);
/* Notifier for device addition/removal */
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -1610,7 +1610,7 @@ out_unlock:
return rc;
}
-struct ccw_device *ccw_device_probe_console(void)
+struct ccw_device *ccw_device_probe_console(struct ccw_driver *drv)
{
struct io_subchannel_private *io_priv;
struct ccw_device *cdev;
@@ -1632,6 +1632,7 @@ struct ccw_device *ccw_device_probe_cons
kfree(io_priv);
return cdev;
}
+ cdev->drv = drv;
set_io_private(sch, io_priv);
ret = ccw_device_console_enable(cdev, sch);
if (ret) {
next prev parent reply other threads:[~2014-05-04 15:40 UTC|newest]
Thread overview: 95+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-04 15:40 [PATCH 3.10 00/86] 3.10.39-stable review Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 01/86] arm64: Do not synchronise I and D caches for special ptes Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 02/86] arm64: Make DMA coherent and strongly ordered mappings not executable Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 03/86] ASoC: cs42l51: Fix SOC_DOUBLE_R_SX_TLV shift values for ADC, PCM, and Analog kcontrols Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 04/86] ASoC: cs42l52: Fix mask bits for SOC_VALUE_ENUM_SINGLE Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 05/86] ASoC: cs42l73: " Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 06/86] ARM: OMAP2+: INTC: Acknowledge stuck active interrupts Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 07/86] ARM: OMAP4: Fix definition of IS_PM44XX_ERRATUM Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 08/86] ARM: OMAP3: hwmod data: Correct clock domains for USB modules Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 09/86] ARM: dts: Keep G3D regulator always on for exynos5250-arndale Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 10/86] ARM: 7954/1: mm: remove remaining domain support from ARMv6 Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 11/86] ARM: 8007/1: Remove extraneous kcmp syscall ignore Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 12/86] ARM: 8027/1: fix do_div() bug in big-endian systems Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 13/86] ARM: 8030/1: ARM : kdump : add arch_crash_save_vmcoreinfo Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 14/86] ARM: mvebu: ensure the mdio node has a clock reference on Armada 370/XP Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 15/86] ARM: 7728/1: mm: Use phys_addr_t properly for ioremap functions Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 16/86] ALSA: hda - Enable beep for ASUS 1015E Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 17/86] ALSA: ice1712: Fix boundary checks in PCM pointer ops Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 18/86] ALSA: hda - Fix silent speaker output due to mute LED fixup Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 19/86] ALSA: hda/realtek - Add support of ALC288 codec Greg Kroah-Hartman
2014-05-04 15:40 ` Greg Kroah-Hartman [this message]
2014-05-04 15:40 ` [PATCH 3.10 21/86] mei: me: do not load the driver if the FW doesnt support MEI interface Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 22/86] mfd: sec-core: Fix possible NULL pointer dereference when i2c_new_dummy error Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 23/86] mfd: 88pm860x: Fix possible NULL pointer dereference on " Greg Kroah-Hartman
2014-05-04 15:40 ` [PATCH 3.10 24/86] mfd: 88pm860x: Fix I2C device resource leak on regmap init fail Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 25/86] mfd: max77686: Fix possible NULL pointer dereference on i2c_new_dummy error Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 26/86] mfd: max77693: " Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 27/86] mfd: max8925: " Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 28/86] mfd: max8998: " Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 29/86] mfd: max8997: " Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 30/86] mfd: tps65910: Fix possible invalid pointer dereference on regmap_add_irq_chip fail Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 31/86] w1: fix w1_send_slave dropping a slave id Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 32/86] staging:serqt_usb2: Fix sparse warning restricted __le16 degrades to integer Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 33/86] staging: r8712u: Fix case where ethtype was never obtained and always be checked against 0 Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 34/86] xfs: fix directory hash ordering bug Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 35/86] ftrace/x86: One more missing sync after fixup of function modification failure Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 36/86] x86-64, modify_ldt: Ban 16-bit segments on 64-bit kernels Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 37/86] USB: fix crash during hotplug of PCI USB controller card Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 38/86] iio: querying buffer scan_mask should return 0/1 Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 39/86] nfsd4: session needs room for following op to error out Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 40/86] nfsd4: buffer-length check for SUPPATTR_EXCLCREAT Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 41/86] nfsd4: fix test_stateid error reply encoding Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 42/86] nfsd: notify_change needs elevated write count Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 43/86] nfsd: check passed sockets net matches NFSd superblocks one Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 44/86] nfsd4: fix setclientid encode size Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 45/86] NFSD: Traverse unconfirmed client through hash-table Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 46/86] nfsd: set timeparms.to_maxval in setup_callback_client Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 47/86] IB/ipath: Fix potential buffer overrun in sending diag packet routine Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 48/86] IB/nes: Return an error on ib_copy_from_udata() failure instead of NULL Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 49/86] IB/mthca: Return an error on ib_copy_to_udata() failure Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 50/86] IB/ehca: Returns " Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 51/86] ib_srpt: Use correct ib_sg_dma primitives Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 52/86] SCSI: qla2xxx: fix error handling of qla2x00_mem_alloc() Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 53/86] SCSI: arcmsr: upper 32 of dma address lost Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 54/86] iscsi-target: Fix ERL=2 ASYNC_EVENT connection pointer bug Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 55/86] target/tcm_fc: Fix use-after-free of ft_tpg Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 56/86] x86/efi: Correct EFI boot stub use of code32_start Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 57/86] reiserfs: fix race in readdir Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 58/86] usb: gadget: tcm_usb_gadget: stop format strings Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 59/86] usb: gadget: zero: Fix SuperSpeed enumeration for alternate setting 1 Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 60/86] xhci: Prevent runtime pm from autosuspending during initialization Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 61/86] xhci: extend quirk for Renesas cards Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 62/86] usb/xhci: fix compilation warning when !CONFIG_PCI && !CONFIG_PM Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 63/86] media: uvcvideo: Do not use usb_set_interface on bulk EP Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 64/86] media: v4l2-compat-ioctl32: fix wrong VIDIOC_SUBDEV_G/S_EDID32 support Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 65/86] media: m88rs2000: prevent frontend crash on continuous transponder scans Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 66/86] media: m88rs2000: add caps FE_CAN_INVERSION_AUTO Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 67/86] media: em28xx: fix PCTV 290e LNA oops Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 68/86] media: saa7134: fix WARN_ON during resume Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 69/86] media: omap3isp: preview: Fix the crop margins Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 70/86] media: media: gspca: sn9c20x: add ID for Genius Look 1320 V2 Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 71/86] usb: dwc3: fix wrong bit mask in dwc3_event_devt Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 72/86] usb: musb: avoid NULL pointer dereference Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 73/86] hvc: ensure hvc_init is only ever called once in hvc_console.c Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 74/86] usb: phy: Add ulpi IDs for SMSC USB3320 and TI TUSB1210 Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 75/86] USB: unbind all interfaces before rebinding any Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 76/86] mtip32xx: Set queue bounce limit Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 77/86] sh: fix format string bug in stack tracer Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 78/86] mm: try_to_unmap_cluster() should lock_page() before mlocking Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 79/86] mm: hugetlb: fix softlockup when a large number of hugepages are freed Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 80/86] hung_task: check the value of "sysctl_hung_task_timeout_sec" Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 81/86] ocfs2: dlm: fix lock migration crash Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 82/86] ocfs2: dlm: fix recovery hung Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 83/86] ocfs2: do not put bh when buffer_uptodate failed Greg Kroah-Hartman
2014-05-04 15:41 ` [PATCH 3.10 84/86] ext4: fix jbd2 warning under heavy xattr load Greg Kroah-Hartman
2014-05-04 15:42 ` [PATCH 3.10 85/86] ext4: use i_size_read in ext4_unaligned_aio() Greg Kroah-Hartman
2014-05-04 15:42 ` [PATCH 3.10 86/86] USB: pl2303: add ids for Hewlett-Packard HP POS pole displays Greg Kroah-Hartman
2014-05-04 18:15 ` [PATCH 3.10 00/86] 3.10.39-stable review Guenter Roeck
2014-05-05 20:43 ` Greg Kroah-Hartman
2014-05-06 0:09 ` Guenter Roeck
2014-05-06 0:28 ` Greg Kroah-Hartman
2014-05-06 1:14 ` Guenter Roeck
2014-05-05 15:49 ` Guenter Roeck
2014-05-05 20:44 ` Greg Kroah-Hartman
2014-05-06 14:55 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140504154143.126299536@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oberpar@linux.vnet.ibm.com \
--cc=schwidefsky@de.ibm.com \
--cc=sebott@linux.vnet.ibm.com \
--cc=stable@vger.kernel.org \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).