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] [day] [month] [year] [list]
Date:   Mon, 12 Dec 2022 21:08:49 +0100
From:   "Fabio M. De Francesco" <fmdefrancesco@...il.com>
To:     Al Viro <viro@...iv.linux.org.uk>,
        Al Viro <viro@...iv.linux.org.uk>
Cc:     Evgeniy Dushistov <dushistov@...l.ru>,
        Ira Weiny <ira.weiny@...el.com>, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        Evgeniy Dushistov <dushistov@...l.ru>,
        Ira Weiny <ira.weiny@...el.com>, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 2/3] fs/ufs: Change the signature of ufs_get_page()

On domenica 11 dicembre 2022 23:42:26 CET Al Viro wrote:
> On Sun, Dec 11, 2022 at 10:31:10PM +0100, Fabio M. De Francesco wrote:
> >  out_put:
> >  	ufs_put_page(page);
> > 
> > -out:
> > -	return err;
> > 
> >  out_unlock:
> >  	unlock_page(page);
> >  	goto out_put;
> 
> Something strange has happened, all right - look at the situation
> after that patch.  You've got
> 
> out_put:
> 	ufs_put_page(page);
> out_unlock:
> 	unlock_page(page);
> 	goto out_put;
> 
> Which is obviously bogus.

I finally could go back to this small series and while working to fix the 
errors that yesterday you had found out I think I saw what happened...

Are you talking about ufs_add_link, right?

If so, you wrote what follows at point 14 of one of your emails:

-----

14) ufs_add_link() - similar adjustment to new calling conventions
for ufs_get_page().  Uses of page_addr: fed to ufs_put_page() (same as
in ufs_find_entry() kaddr is guaranteed to point into the same page and
thus can be used instead) and calculation of position in directory, same
as we'd seen in ufs_set_link().  The latter becomes page_offset(page) +
offset_in_page(de), killing page_addr off.  BTW, we get
                kaddr = ufs_get_page(dir, n, &page);
                err = PTR_ERR(kaddr);
                if (IS_ERR(kaddr))
                        goto out;
with out: being just 'return err;', which suggests
                kaddr = ufs_get_page(dir, n, &page);
                if (IS_ERR(kaddr))
                        return ERR_PTR(kaddr);
instead (and that was the only goto out; so the label can be removed).
The value stored in err in case !IS_ERR(kaddr) is (thankfully) never
used - would've been a bug otherwise.  So this is an equivalent 
transformation.

-----

Did you notice "so the label can be removed"?
I must have misinterpreted what you wrote there. Did I?

I removed the "out" label, according to what it seemed to me the correct way 
to interpret your words.

However at that moment I didn't see the endless loop at the end of the 
function. Then I "fixed" (sigh!) it in 3/3 by terminating that endless loop
with a "return 0". 

However that was another mistake because after "got_it:" label we have "err = 
ufs_commit_chunk(page, pos, rec_len);". 

To summarize: I can delete _only_ the label and leave the "return err;" in the 
block after the "out_put:" label. 

Am I looking at it correctly now?

Thanks,

Fabio


Powered by blists - more mailing lists