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


Groups > linux.kernel > #1335550 > unrolled thread

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

Started byTom Rini <trini@konsulko.com>
First post2016-02-16 16:40 +0100
Last post2016-02-17 23:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] kbuild: fixdep: Check fstat(2) return value Tom Rini <trini@konsulko.com> - 2016-02-16 16:40 +0100
    Re: [PATCH] kbuild: fixdep: Check fstat(2) return value Michal Marek <mmarek@suse.cz> - 2016-02-17 23:00 +0100

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

FromTom Rini <trini@konsulko.com>
Date2016-02-16 16:40 +0100
SubjectRe: [PATCH] kbuild: fixdep: Check fstat(2) return value
Message-ID<r2PTm-1fi-53@gated-at.bofh.it>
On Sat, Jan 16, 2016 at 02:11:16PM -0500, Tom Rini wrote:
> 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!

Ping?  Thanks!

-- 
Tom

[toc] | [next] | [standalone]


#1336796

FromMichal Marek <mmarek@suse.cz>
Date2016-02-17 23:00 +0100
Message-ID<r3iiC-3Xr-13@gated-at.bofh.it>
In reply to#1335550
On Tue, Feb 16, 2016 at 10:32:15AM -0500, Tom Rini wrote:
> Ping?  Thanks!

Applied now, thanks.

Michal

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web