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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1OHxvZ-00030j-7t@pomaz-ex.szeredi.hu>
Date:	Fri, 28 May 2010 13:40:37 +0200
From:	Miklos Szeredi <miklos@...redi.hu>
To:	Changli Gao <xiaosuo@...il.com>
CC:	miklos@...redi.hu, axboe@...nel.dk, viro@...iv.linux.org.uk,
	mszeredi@...e.cz, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/4] splice: fix updating sd->pos wrongly

On Fri, 28 May 2010, Changli Gao wrote:
> On Fri, May 28, 2010 at 7:11 PM, Miklos Szeredi <miklos@...redi.hu> wrote:
> > On Fri, 28 May 2010, Changli Gao wrote:
> >>  Before checking the sd->pos, sd->pos
> >> already is updated with the value returned by splice_read(), so if in
> >> file is seekabble, sd->pos is non-zero when I checking it.
> >
> > I see the logic now.  But it's really confusing, at least some
> > comments would be needed.
> >
> > But I think it would be better not to try reusing sd->pos for reading,
> > but supplying an "loff_t *read_ppos" to splice_direct_to_actor and
> > leaving sd->pos alone (for the write side to use and update as
> > necessary).
> >
> 
>                if (ret < read_len) {
> 
> I think is much like a hack too. :)
> 
> -                       sd->pos = prev_pos + ret;
> +                       if (sd->pos)
> +                               sd->pos = prev_pos + ret;
>                        goto out_release;
>                }
> 
> Anyway, it can fix the issue I mentioned above. Any future cleanup
> should not be mixed in, IMO.

Okay, but please add a comment and explaing in the patch header,
because others are going to look a that code and go "WTF???"

Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ