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]
Message-ID: <AANLkTill8Y1RNTzZ9BFmVHPxLyx7CZIL5okqUCRVrrmH@mail.gmail.com>
Date:	Fri, 28 May 2010 18:00:32 +0800
From:	Changli Gao <xiaosuo@...il.com>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	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, May 28, 2010 at 5:42 PM, Miklos Szeredi <miklos@...redi.hu> wrote:
> On Wed, 26 May 2010, Changli Gao wrote:
>> fix updating sd->pos wrongly.
>>
>> In error path, we don't need to updating sd->pos, if the file isn't seekable.
>
> This patch is nonsense.  Why should we handle sd->pos != 0 case
> differently?
>

If the in file isn't seekable, its splice_read won't update *ppos, so
in the error path, we'd better not change it too. Otherwise, some
assumption will go wrong.

ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
                        struct pipe_inode_info *pipe, size_t len,
                        unsigned int flags)
{
        struct sock *sk = sock->sk;
        struct tcp_splice_state tss = {
                .pipe = pipe,
                .len = len,
                .flags = flags,
        };
        long timeo;
        ssize_t spliced;
        int ret;

        /*
         * We can't seek on a socket input
         */
        if (unlikely(*ppos))
                return -ESPIPE;


-- 
Regards,
Changli Gao(xiaosuo@...il.com)
--
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