[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPAsAGy51DQNpnst6W3n2aZGCBMLt5KZ_niieZuM_1pnqoEhDg@mail.gmail.com>
Date: Thu, 2 Jul 2015 23:26:19 +0300
From: Andrey Ryabinin <ryabinin.a.a@...il.com>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Andrey Ryabinin <a.ryabinin@...sung.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
Eric Van Hensbergen <ericvh@...il.com>,
linux-nfs@...r.kernel.org
Subject: Re: running out of tags in 9P (was Re: [git pull] vfs part 2)
2015-07-02 19:43 GMT+03:00 Al Viro <viro@...iv.linux.org.uk>:
> On Thu, Jul 02, 2015 at 03:19:57PM +0300, Andrey Ryabinin wrote:
>
>> Added:
>> + if (total > count)
>> + *(char *)0 = 0
>>
>> and never hit this condition.
>>
>
> OK, so it's definitely a mismatched response.
>
>> req->tc->tag = tag-1;
>> + if (WARN_ON(req->status != REQ_STATUS_IDLE))
>> + pr_err("req->status: %d\n", req->status);
>> req->status = REQ_STATUS_ALLOC;
>>
>> return req;
>
>> [ 150.259076] 9pnet: req->status: 4
>
> IOW, REQ_STATUS_RCVD. Hmm... Stray tag seen by req_done() after we'd already
> freed the tag in question? That, or it really would have to had wrapped
> around... Note that req_done() does *not* check anything about the req -
> not even that p9_tag_lookup() hasn't returned NULL, so a server sending you
> any response tagged with number well above anything you'd ever sent will
> reliably oops you.
>
> Frankly, the whole thing needs fuzzing from the server side - start throwing
> crap at the client and see how badly does it get fucked... Folks, it's
> a network protocol, with userland servers, no less. You *can't* assume
> them competent and non-malicious...
>
> How much traffic does it take to reproduce that fun, BTW? IOW, is attempting
> to log the sequence of tag {allocation,freeing}/tag of packet being {sent,
> received} something completely suicidal, or is it more or less feasible?
>
No idea. Usually it takes 1-2 minutes after trinity (100 threads) starts.
>> I didn't get this. c->reqs[row] is always non-NULL as it should be, so this warning
>> will trigger all the time.
>
> ????
> row = (tag / P9_ROW_MAXTAG);
> c->reqs[row] = kcalloc(P9_ROW_MAXTAG,
> sizeof(struct p9_req_t), GFP_ATOMIC);
>
> and you are seeing c->reqs[row] != NULL *BEFORE* that kcalloc()? All the time,
> no less? Just to make sure we are on the same page - the delta against
> mainline I would like tested is this:
>
Ah, I was looking at the second ' row = tag / P9_ROW_MAXTAG;' line
which is after kcalloc().
I'll check tomorrow then.
--
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