Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #60726 > unrolled thread

Bug#896576: Reading from /proc/[pid]/environ returns garbage

Started byGuillaume <guillaume@atto.be>
First post2018-04-22 16:40 +0200
Last post2018-04-23 20:10 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.debian.kernel


Contents

  Bug#896576: Reading from /proc/[pid]/environ returns garbage Guillaume <guillaume@atto.be> - 2018-04-22 16:40 +0200
    Bug#896576: marked as done (Reading from /proc/[pid]/environ  returns garbage) "Debian Bug Tracking System" <owner@bugs.debian.org> - 2018-04-23 02:30 +0200
    Bug#896576: closed by Ben Hutchings <ben@decadent.org.uk> (Re: Bug#896576: Reading from /proc/[pid]/environ returns garbage) Guillaume <guillaume@atto.be> - 2018-04-23 20:10 +0200

#60726 — Bug#896576: Reading from /proc/[pid]/environ returns garbage

FromGuillaume <guillaume@atto.be>
Date2018-04-22 16:40 +0200
SubjectBug#896576: Reading from /proc/[pid]/environ returns garbage
Message-ID<vHojM-5ib-9@gated-at.bofh.it>
Package: linux-image-4.9.0-6-amd64
Version: 4.9.82-1+deb9u3

When I attempt to get the environment of a process by reading
/proc/[pid]/environ, it sometimes returns garbage.

The same garbage is seen when reading this magic 'environ' file using
cat, hexdump, or python. So I believe the tool reading it is not at fault.

I am filling this against a linux image package, because my
understanding is that /proc is a virtual file system managed by the
linux kernel.

Reproducing:

In my case I observed this with a couple sshd and dovecot processes, I
suggest you start by looking at theses when reproducing.

# cat /proc/10230/cmdline && echo
dovecot/imap-login
# cat /proc/10230/environ && echo
����������[TRUNCATED]
# hexdump -C /proc/10230/environ
00000000  ab ab ab ab ab ab ab ab  ab ab ab ab ab ab ab ab
|................|
*
000001fd

# cat /proc/7590/cmdline && echo
sshd: guillaume [priv]
# cat /proc/7590/environ && echo
riv]2
# hexdump -C /proc/7590/environ
00000000  72 69 76 5d 00 00 00 00  00 00 00 00 00 00 00 00
|riv]............|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|................|
*
00000730  00 00 00 00 00 00 00 00  00 00 00 32 00           |...........2.|

[toc] | [next] | [standalone]


#60734 — Bug#896576: marked as done (Reading from /proc/[pid]/environ returns garbage)

From"Debian Bug Tracking System" <owner@bugs.debian.org>
Date2018-04-23 02:30 +0200
SubjectBug#896576: marked as done (Reading from /proc/[pid]/environ returns garbage)
Message-ID<vHxwJ-2DD-1@gated-at.bofh.it>
In reply to#60726

[Multipart message — attachments visible in raw view] — view raw

Your message dated Mon, 23 Apr 2018 01:25:07 +0100
with message-id <8ed98d8803a1903560b03caa3626c93d713256b0.camel@decadent.org.uk>
and subject line Re: Bug#896576: Reading from /proc/[pid]/environ returns garbage
has caused the Debian Bug report #896576,
regarding Reading from /proc/[pid]/environ returns garbage
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
896576: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896576
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems

[toc] | [prev] | [next] | [standalone]


#60739 — Bug#896576: closed by Ben Hutchings <ben@decadent.org.uk> (Re: Bug#896576: Reading from /proc/[pid]/environ returns garbage)

FromGuillaume <guillaume@atto.be>
Date2018-04-23 20:10 +0200
SubjectBug#896576: closed by Ben Hutchings <ben@decadent.org.uk> (Re: Bug#896576: Reading from /proc/[pid]/environ returns garbage)
Message-ID<vHO4x-54z-5@gated-at.bofh.it>
In reply to#60726
Le 23/04/2018 à 02:27, Debian Bug Tracking System a écrit :
> The kernel only knows where it stored the environment for a process
> when it started.  If the process manipulates its environment after
> that, the kernel doesn't know about it.  This means that the "environ"
> file is not reliable, and this can't be fixed.  Sorry.

Thanks for the clarification, I now understand this isn't a kernel bug.

-- 
Jabber : guillaume@atto.be
PGP : 2054C46F0019B937

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web