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


Groups > linux.kernel > #1311013

Re: [PATCH] kbuild: fixdep: Check fstat(2) return value

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Tom Rini <trini@konsulko.com>
Newsgroups linux.kernel
Subject Re: [PATCH] kbuild: fixdep: Check fstat(2) return value
Date Sat, 16 Jan 2016 20:20:01 +0100
Message-ID <qREyd-ed-9@gated-at.bofh.it> (permalink)
References <qDbw6-1y2-15@gated-at.bofh.it>
X-Original-To linux-kbuild@vger.kernel.org
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=bXJXzrBKDUdAow0sRInj3QW+hcA/qD3w0Ykx4Ar1Ru8=; b=XtEcUam15EGd9G7/62Cise1ogYLMCZiUvpblotpcj05NoxXQUxi3CoxMOQOSewjr8z RGf/FeMg/JnNHy9+T/9b5VAY7FEW0V6Iap9MPEeFju4+4TJ5sBlQNs3nF8MhQB2cDcyF qN4nDFtfPv1e2UD7yR5rcRGyl/x0LM6Rpl15w=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=bXJXzrBKDUdAow0sRInj3QW+hcA/qD3w0Ykx4Ar1Ru8=; b=VMiAyaJnxktEOhpP80yuX+MtJXZxpgzmrBKb9wNoCvIIDhd7KEYZznpefklVwiZxNl fMAZ1vT6va8rmvmRlSfDn34E2QhCRQfOL3H7/22jsIyQNJvMJvKd6DlZtvtYEzF3r5so NBoTmxbxLqDVRc7PSXT7b4nsvpI6D8hnBlVLTvpg+DaAXWRXKZogZ2sIozcu2eMzREBW bFEOr1myAYy8fdNIZ6E4dxq34kRQgw9YGXQDBhAQG50CEk0qmJLDhl5wry8HrWrvU1Kj wXJgb1jFO+d765dcJQAXzDdYKaTw08zPadPsotWREcLiUzjhbnuYyPXYIARYFWb7xux2 CjdQ==
X-Gm-Message-State ALoCoQkLH70OuEGsisD5SHWN+BIuNwe/jDEC7tTw4HBbdjPNFOMnVtpE+JXedH2L6Lol/mC2ldDVbKyzjmX2krVGKAcR6im0Kg==
X-Received by 10.37.72.137 with SMTP id v131mr2875814yba.65.1452971647681; Sat, 16 Jan 2016 11:14:07 -0800 (PST)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc Michal Marek <mmarek@suse.com>, lk <linux-kernel@vger.kernel.org>, stable@vger.kernel.org
X-Original-Date Sat, 16 Jan 2016 14:14:27 -0500
X-Original-Message-ID <20160116191427.GU3359@bill-the-cat>
X-Original-References <1449523568-31084-1-git-send-email-trini@konsulko.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1311013

Show key headers only | View raw


On Mon, Dec 7, 2015 at 4:26 PM, Tom Rini <trini@konsulko.com> wrote:

> Coverity has recently added a check that will find when we don't check
> the return code from fstat(2).  Copy/paste the checking logic that
> print_deps() has with an appropriate re-wording of the perror() message.
>
> Cc: Michal Marek <mmarek@suse.com>
> Cc: linux-kbuild@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Tom Rini <trini@konsulko.com>
>
> ---
> Note that I don't have a CID here was I found this in U-Boot and the
> kernel hasn't yet done a build with this test being enabled.
> ---
>  scripts/basic/fixdep.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
> index c68fd61..e3d9678 100644
> --- a/scripts/basic/fixdep.c
> +++ b/scripts/basic/fixdep.c
> @@ -274,7 +274,11 @@ static void do_config_file(const char *filename)
>                 perror(filename);
>                 exit(2);
>         }
> -       fstat(fd, &st);
> +       if (fstat(fd, &st) < 0) {
> +               fprintf(stderr, "fixdep: error fstat'ing config file: ");
> +               perror(filename);
> +               exit(2);
> +       }
>         if (st.st_size == 0) {
>                 close(fd);
>                 return;

Adding stable@ since this applies to 4.4.  Any comments?  Thanks!

-- 
Tom

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] kbuild: fixdep: Check fstat(2) return value Tom Rini <trini@konsulko.com> - 2016-01-16 20:20 +0100

csiph-web