Bug 11854

Summary: v2.6.28-rc1: readlink /proc/*/exe returns uninitialized data to userspace
Product: Other Reporter: Rafael J. Wysocki (rjw)
Component: OtherAssignee: Alexey Dobriyan (adobriyan)
Status: CLOSED CODE_FIX    
Severity: normal CC: niraj17, vegard.nossum
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.28-rc1 Subsystem:
Regression: --- Bisected commit-id:

Description Rafael J. Wysocki 2008-10-25 13:34:24 UTC
Subject    : v2.6.28-rc1: readlink /proc/*/exe returns uninitialized data to userspace
Submitter  : "Vegard Nossum" <vegard.nossum@gmail.com>
Date       : 2008-10-25 17:14
References : http://marc.info/?l=linux-kernel&m=122495490201663&w=4

This entry is being used for tracking a regression from 2.6.27.  Please don't
close it until the problem is fixed in the mainline.
Comment 1 Rafael J. Wysocki 2008-11-02 13:28:58 UTC
On Sunday, 2 of November 2008, Vegard Nossum wrote:
> On Sun, Nov 2, 2008 at 5:07 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > This message has been generated automatically as a part of a report
> > of recent regressions.
> >
> > The following bug entry is on the current list of known regressions
> > from 2.6.27.  Please verify if it still should be listed and let me know
> > (either way).
> >
> >
> > Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=11854
> > Subject         : v2.6.28-rc1: readlink /proc/*/exe returns uninitialized
> data to userspace
> > Submitter       : Vegard Nossum <vegard.nossum@gmail.com>
> > Date            : 2008-10-25 17:14 (9 days old)
> > References      : http://marc.info/?l=linux-kernel&m=122495490201663&w=4
> 
> Been trying to reproduce this one since I saw it, and I think it can
> be written off as can't reproduce :-(
> 
> Maybe I can contribute a patch that verifies that the return value ==
> strlen(buffer), WARN_ON otherwise? And hope that somebody runs into
> it.
Comment 2 Vegard Nossum 2008-11-04 04:06:30 UTC
Is not a regression, has probably been there since at least 2.6.9, probably longer too :-)
Comment 3 Rafael J. Wysocki 2008-11-08 15:52:57 UTC
Dropped from the list of regressions, thanks.
Comment 4 Niraj Kumar 2008-11-28 01:10:10 UTC
I just tried it on 2.6.28-rc5 and it doesn't seem to be reproducible.

[root@f10-vm1 modules]# uname -a
Linux f10-vm1 2.6.28-rc5 #1 SMP Fri Nov 28 10:03:30 IST 2008 i686 i686 i386 GNU/Linux
[root@f10-vm1 modules]# strace -e trace=readlink readlink /proc/2766/exe
readlink("/proc/2766/exe", "/bin/bash"..., 64) = 9
/bin/bash
[root@f10-vm1 modules]# strace -e trace=readlink readlink /proc/744/exe
readlink("/proc/744/exe", "/sbin/udevd"..., 64) = 11
/sbin/udevd

Let me know if I have missed something here...
thanks!
Comment 5 Vegard Nossum 2008-11-28 01:15:54 UTC
Hi,

Please see this thread for more info: http://lkml.org/lkml/2008/11/4/105
And patch: http://lkml.org/lkml/2008/11/11/379

So we are waiting for this to hit 2.6.28, I guess.
Comment 6 Alexey Dobriyan 2009-03-08 05:09:03 UTC
commit dc711ca35f9d95a1eec02118e0c298b5e3068315 in mainline
and in -stable.