lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 11 Nov 2021 20:11:56 +0800
From:   Muchun Song <songmuchun@...edance.com>
To:     Ajay Garg <ajaygargnsit@...il.com>
Cc:     Hugh Dickins <hughd@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux Memory Management List <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: shmem: do not call PageHWPoison on a ERR-page

On Thu, Nov 11, 2021 at 7:40 PM Ajay Garg <ajaygargnsit@...il.com> wrote:
>
> >
> > How about the following changes since the above if block
> > already do the judgment?
> >
> > diff --git a/mm/shmem.c b/mm/shmem.c
> > index f0eee4e221a7..0c84b6624026 100644
> > --- a/mm/shmem.c
> > +++ b/mm/shmem.c
> > @@ -4195,13 +4195,13 @@ struct page *shmem_read_mapping_page_gfp(struct
> > address_space *mapping,
> >          BUG_ON(!shmem_mapping(mapping));
> >          error = shmem_getpage_gfp(inode, index, &page, SGP_CACHE,
> >                                    gfp, NULL, NULL, NULL);
> > -       if (error)
> > +       if (error) {
> >                  page = ERR_PTR(error);
> > -       else
> > +       } else {
> >                  unlock_page(page);
> > -
> > -       if (PageHWPoison(page))
> > -               page = ERR_PTR(-EIO);
> > +               if (PageHWPoison(page))
> > +                       page = ERR_PTR(-EIO);
> > +       }
> >
> >          return page;
>
>
> You have
>
> * simply put braces (not required for 1-liner if/else blocks)
> * contributed nothing to the issue the patch addresses.
>
> I hope this is not a deliberate joke/spam.

What? I put "if (PageHWPoison(page))" into the else branch,
it should be added braces since it's not 1-line blocks. Why do
you think it does not address the issue? What am I missing
here?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ