grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ls: prevent double open


From: Daniel Kiper
Subject: Re: [PATCH] ls: prevent double open
Date: Fri, 10 Nov 2017 22:35:30 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Oct 18, 2017 at 10:30:37AM -0600, Eric Snowberg wrote:
> > On Oct 17, 2017, at 7:22 AM, Daniel Kiper <address@hidden> wrote:
> > On Mon, Oct 16, 2017 at 01:11:12PM -0700, Eric Snowberg wrote:
> >> Prevent a double open.  This can cause problems with some ieee1275
> >> devices, causing the system to hang.  The double open can occur
> >> as follows:
> >>
> >> grub_ls_list_files (char *dirname, int longlist, int all, int human)
> >>       dev = grub_device_open (device_name);
> >>       dev remains open while:
> >>       grub_normal_print_device_info (device_name);
> >>                dev = grub_device_open (name);
> >>
> >> Signed-off-by: Eric Snowberg <address@hidden>
> >
> > In general LGTM. One nitpick...
> >
> >> ---
> >> grub-core/commands/ls.c |    2 ++
> >> 1 files changed, 2 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/grub-core/commands/ls.c b/grub-core/commands/ls.c
> >> index 0eaf836..a7318ab 100644
> >> --- a/grub-core/commands/ls.c
> >> +++ b/grub-core/commands/ls.c
> >> @@ -201,6 +201,8 @@ grub_ls_list_files (char *dirname, int longlist, int 
> >> all, int human)
> >>       if (grub_errno == GRUB_ERR_UNKNOWN_FS)
> >>    grub_errno = GRUB_ERR_NONE;
> >>
> >> +      grub_device_close (dev);
> >> +      dev = NULL;
> >
> > I would put a comment before why it is needed.
> >
>
> Ok, I’ll add a comment and submit a V2.

I was going to apply this today but have not found v2... :-(((
If you post it I will apply it immediately.

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]