[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130604171435.GA20416@redhat.com>
Date: Tue, 4 Jun 2013 19:14:35 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.cz>,
Sergey Dyasly <dserrg@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/4] proc: avoid ->f_pos overflows in
proc_task_readdir() paths
On 06/03, Eric W. Biederman wrote:
>
> Oleg Nesterov <oleg@...hat.com> writes:
>
> > 1. proc_task_readdir() truncates f_pos to long, this can lead
> > to wrong result on 32bit.
> >
> This won't compile on some 32bit architectures like x86-32.
>
> switch(unsigned long long) requires helpers that the kernel does not
> included. Or at least the kernel has not included because such code
> is a problem. In fact that is the reason Linus put the case to
> unsigned long in there.
Hmm, ee568b25, suprise... I am wondering if the kernel still supports
the compilers which needs __cmpdi2 in this case...
But this doesn't matter. The patch should not blindly revert ee568b25,
thanks!
> There is another bug in here as well that we may return really crazy
> things in the case of seek simultaneous with readdir.
i_mutex? both vfs_readdir() and default_llseek() take it... Anyway, this
is another issue.
> I think we really need to put f_pos
> in a local variable.
Heh. I swear, this is what I did initially. But I was afraid you will
blame this change as "overcomplicated" ;)
OK, I'll redo/resend this one later.
Oleg.
--
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