Red Hat Bugzilla – Bug 452534
[RFE] Enable raw devices on s390x
Last modified: 2010-10-22 22:08:55 EDT
Description of problem:
Raw device support is not enabled on the s390 architecture (vanilla 2.6.18 s390x
driver config does not allow the driver to be enabled). Third party applications
may require access to devices using the old /dev/raw/rawN interface.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Install an s390x system
2. # grep RAW_D /boot/config-*
There were previously problems with the raw I/O driver on s390 that were fixed
back in 2005:
Author: Stephen Tweedie <email@example.com>
Date: Fri May 13 23:31:19 2005 -0400
[PATCH] Fix root hole in raw device
[Patch] Fix raw device ioctl pass-through
Raw character devices are supposed to pass ioctls through to the block
devices they are bound to. Unfortunately, they are using the wrong
function for this: ioctl_by_bdev(), instead of blkdev_ioctl().
ioctl_by_bdev() performs a set_fs(KERNEL_DS) before calling the ioctl,
redirecting the user-space buffer access to the kernel address space.
This is, needless to say, a bad thing.
This was noticed first on s390, where raw IO was non-functioning. The
s390 driver config does not actually allow raw IO to be enabled, which
was the first part of the problem. Secondly, the s390 kernel address
space is distinct from user, causing legal raw ioctls to fail. I've
reproduced this on a kernel built with 4G:4G split on x86, which fails
in the same way (-EFAULT if the address does not exist kernel-side;
returns success without actually populating the user buffer if it does.)
The patch below fixes both the config and address-space problems. It's
based closely on a patch by Jan Glauber <firstname.lastname@example.org>, which has
been tested on s390 at IBM. I've tested it on x86 4G:4G (split address
space) and x86_64 (common address space).
Kernel-address-space access has been assigned CAN-2005-1264.
Signed-off-by: Stephen Tweedie <email@example.com>
Signed-off-by: Dave Jones <firstname.lastname@example.org>
Signed-off-by: Greg Kroah-Hartman <email@example.com>
The remaining pieces are just the Kconfig patch to add options to enable the
driver on s390x and a change to the s390 config in the kernel configuration files.
Created attachment 310038 [details]
Kconfig patch for raw driver on s390x
Updating PM score.
I'm having troubles reserving an s390 system, unfortunately. However, it looks to me like raw devices are supported on s390 already. If you have access to an s390 system, please check to see if /dev/rawctl exists, and whether the raw command works for binding devices.
I managed to reserve a system and rawctl is not available.
The attached patch applied with minimal offsets and worked as advertised. I was not able to verify that I/O could be performed to a raw device because of the configuration of the system I was using. Is there any chance we can get testing from the customer on this? Simply performing some dd commands should be sufficient.
You can download this test kernel from http://people.redhat.com/dzickus/el5
Please do NOT transition this bugzilla state to VERIFIED until our QE team
has sent specific instructions indicating when to do so. However feel free
to provide a comment indicating that this fix has been verified.
~~ Attention - RHEL 5.4 Beta Released! ~~
RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner!
If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.
Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value.
Questions can be posted to this bug or your customer or partner representative.
Release note added. If any revisions are required, please set the
"requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.
This enables raw device support for IBM System z platforms.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.