From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 16 00:57:01 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FD97106566B for ; Tue, 16 Feb 2010 00:57:01 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-px0-f176.google.com (mail-px0-f176.google.com [209.85.216.176]) by mx1.freebsd.org (Postfix) with ESMTP id EA3478FC15 for ; Tue, 16 Feb 2010 00:57:00 +0000 (UTC) Received: by pxi6 with SMTP id 6so4696446pxi.14 for ; Mon, 15 Feb 2010 16:57:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=fRDh6jgK0yoS3wVUIVIdY5lETTqr7OLuKcdtfq3HMvc=; b=CrElESefyTh+0fdLxbCyPFf6d5IFPq2d4DmtKgY61zV4KG9Wk8HSp0StC5yTdxo/2R ZLrMv5Hi8VXsg20mqIpOYjX0lepZxGxhs42b1Uu9WapwRchSybNOfgofbTKV8UwL3W73 O72dVDMUl9d0GZXW4rcXqGtiLbUkZiUj9oCHE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=wIA+KVp7ul8ef0U9HZTvSJ6rFgntaA7gy0eyKRryu5zH7sUS7QmINcP9g+77RP/1XU Z4kRfmfsAYkUJ2BxzJkgKeT6zbrNp+PgRGSIr8oF+k2xNDs3mxzdXwiclgZrgm6L8Xrn flzVAkkBOTkkCL9iPZJV46Hbw4mGVWeT5iezI= MIME-Version: 1.0 Received: by 10.142.196.14 with SMTP id t14mr3898279wff.326.1266281820362; Mon, 15 Feb 2010 16:57:00 -0800 (PST) In-Reply-To: <7d6fde3d1002151655q184c8a21k8a0c6c07b9b0ae79@mail.gmail.com> References: <364299f41002151649y2e4d4120p918759afb1fd8f6c@mail.gmail.com> <7d6fde3d1002151655q184c8a21k8a0c6c07b9b0ae79@mail.gmail.com> Date: Mon, 15 Feb 2010 16:57:00 -0800 Message-ID: <7d6fde3d1002151657q560b701bre44419d56e61f7ac@mail.gmail.com> From: Garrett Cooper To: FreeBSD-Hackers Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: read(1) garbage when input redirected from make incorrectly X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 00:57:01 -0000 On Mon, Feb 15, 2010 at 4:55 PM, Garrett Cooper wrote: > Hi Hackers, > =A0 =A0I accidentally reproduced the following after executing read > properly in a pipeline with make: s/properly/improperly/ > [garrcoop@garrcoop-fbsd /usr/home/garrcoop]$ read DESTDIR SRCCONF < > /usr/bin/make -V DESTDIR -V SRCCONF > bash: read: `-V': not a valid identifier > [garrcoop@garrcoop-fbsd /usr/home/garrcoop]$ echo $DESTDIR > =A0ELF > [garrcoop@garrcoop-fbsd /usr/home/garrcoop]$ hexdump -C foo > 00000000 =A07f 45 4c 46 01 01 01 0a =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 |.ELF....| > 00000008 > [garrcoop@garrcoop-fbsd /usr/home/garrcoop]$ And just for completeness because I executed the above directly in bash... [root@garrcoop-fbsd /usr/home/garrcoop]# sh -c 'read DESTDIR SRCCONF < /usr/bin/make -V DESTDIR -V SRCCONF; echo $DESTDIR > foo; hexdump -C foo' read: -V: bad variable name 00000000 7f 45 4c 46 01 01 01 0a |.ELF....| 00000008 > =A0 =A0Is this an issue to be concerned about apart from cosmetic noise, > i.e. potential buffer access problem? I see the same garbage from > bash/coreutils on RHEL 4.6 as well as read(1) and /bin/sh on FreeBSD > with RELENG_8, so the issue appears to be consistent on multiple > OSes... Thanks, -Garrett