Bug 460106 - regression, rhel4.7+, on the try to read /proc/self/mem getting improper return value
regression, rhel4.7+, on the try to read /proc/self/mem getting improper retu...
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
urgent Severity urgent
: rc
: ---
Assigned To: Anton Arapov
Martin Jenner
: ZStream
: 459765 (view as bug list)
Depends On:
Blocks: 461304 464747
  Show dependency treegraph
Reported: 2008-08-26 04:31 EDT by CAI Qian
Modified: 2014-06-18 04:02 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-05-18 15:03:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
proposed patch (466 bytes, patch)
2008-08-28 04:22 EDT, Anton Arapov
no flags Details | Diff

  None (edit)
Description CAI Qian 2008-08-26 04:31:26 EDT
Description of problem:
In RHEL 4.6 and 4.7, read of /proc/self/mem and /proc/self/task/<pid>/mem returned different failures,

$ cat /proc/self/mem
RHEL 4.6: Input/output error
RHEL 4.7: Invalid argument

Version-Release number of selected component (if applicable):

How reproducible:
Comment 1 Prarit Bhargava 2008-08-27 09:12:14 EDT
I recall that Anton had a patch where he changed some proc read output ... it went into RHEL4 ~ build 68 or so.

Anton, is this really a bug?

Comment 2 Prarit Bhargava 2008-08-27 10:14:10 EDT
I just went and looked at the logs for 68.10 -- Anton, your patch changed the default behavior here but I still wonder if this really is a bug.

I guess Cai has a point -- "Invalid argument" indicates that the reader did something wrong...

Comment 3 Anton Arapov 2008-08-27 11:30:47 EDT
I do not think that my patch in 68.10 changed behaviour for this issue at all. It was addressed to completely another thing.
I had something assigned in the past regarding the reading of /proc/.../mem, but somebody complaint that he was not able to read it at all by cat, and he must not, so it was closed as WONTFIX.

regarding this particular report, I do not understand the issue...
And just checked this on RHEL4.6, result is: "Invalid argument"

Comment 4 Prarit Bhargava 2008-08-27 11:45:07 EDT

cat /proc/self/mem on RHEL4.6 shows "Input/Output error" (-67.EL).

cat /proc/self/mem on RHEL4.7 (from kernels 68.10 and onward) show "Invalid Argument".

Removal of patch 

changes the behavior of cat /proc/self/mem back to "Input/Output error"

(As seen on dell-pe6800-01.rhts.bos.redhat.com which was installed with RHEL4.6 as a base, and binary search through kernels.  I then identified the patch inux-2.6.9-Don-t-truncate-proc-PID-environ-at-4096-characters.patch
 as having been added in 68.10 which is where the error return value changed.  After building latest-and-greatest kernel without this patch, the return code is again "Input/Output error".)

The question of whether or not this is a nuisance or a real bug is still open.  While it does change the return code, does it really matter?  ie) Is a userspace program really going to care *why* the read failed?  OTOH, "Invalid Argument" indicates that the user/reader did something wrong...

Comment 5 Anton Arapov 2008-08-28 02:24:47 EDT
Agreed ... I've tested it on -78 kernel. Didn't notice that. In this particular case user-space stuff shouldn't care about the return code, the program shouldn't be able to read mem this way. 

OTOH, I/O error is correct return code and shouldn't be changed after my patch, but it was changed... I will look into it.
Comment 7 Anton Arapov 2008-08-28 02:47:18 EDT
@@ -1587,7 +1634,6 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
 		case PROC_TID_MEM:
 		case PROC_TGID_MEM:
 			inode->i_op = &proc_mem_inode_operations;
-			inode->i_fop = &proc_mem_operations;

this is the problem... 
/me looking how this happend...
Comment 8 Anton Arapov 2008-08-28 02:49:21 EDT
Yep, it was my bad, I posted the wrongly generated patch, and nobody noticed that....
Comment 10 Anton Arapov 2008-08-28 04:22:00 EDT
Created attachment 315182 [details]
proposed patch
Comment 12 Anton Arapov 2008-08-28 05:11:39 EDT
I want to nominate this bug for RHEL4.7 z-stream as well, but do not have rights to put the rhel-4.7.z flag into '?' state.
Comment 13 Prarit Bhargava 2008-08-28 06:26:16 EDT
Anton, if this doesn't hurt customers, should it be a z-stream candidate?

Comment 14 Anton Arapov 2008-08-28 06:28:11 EDT
This is regression. And I can't vouch for tools customers may have...
Comment 15 RHEL Product and Program Management 2008-08-28 08:13:53 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 16 RHEL Product and Program Management 2008-09-03 09:17:20 EDT
Updating PM score.
Comment 19 RHEL Product and Program Management 2008-09-09 09:52:11 EDT
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.
Comment 20 Vivek Goyal 2008-09-09 17:43:52 EDT
Committed in 78.8.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/
Comment 21 Peter Martuccelli 2008-09-22 13:21:07 EDT
*** Bug 459765 has been marked as a duplicate of this bug. ***
Comment 29 errata-xmlrpc 2009-05-18 15:03:31 EDT
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.


Note You need to log in before you can comment on or make changes to this bug.