Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp358081imm; Tue, 24 Jul 2018 21:12:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdMOvtvvRRCSyhFlOxewWNL/0kkx24GR/7ialDhgu9owXaFcfwE/Tg87uj7XwV4VWHuDut7 X-Received: by 2002:a17:902:9687:: with SMTP id n7-v6mr19041815plp.33.1532491979385; Tue, 24 Jul 2018 21:12:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532491979; cv=none; d=google.com; s=arc-20160816; b=rf56fobMyX7Pk43kw3p+Gr5ioqx0UXva75CjHvFlG6eZAhTh2gnyzddROQAcbaeK38 4iK9gnWoPBlnig32/HlA5Ris2X2FvYF392DCDsibpx1DZuW19pjrSx/9Lb5s6+6bjnlZ sMB94ZYORydU+M/+3KAxgTGG0sstgh1WPhzVDMz/XPOK06qOdq2IWvZkHHhWIpMb6S9T zgAal27dXP2saFYqp4DSHTjfxFdH87lxDe5L0wlKc/2PC4VsBd+Gr/8+ziUMNHAawQkD RHLMEGpWBS2MqUy2aJ3cMZlxxX0kXcnhR2jEp+bSOv8wryvpHr/XrFdUt/Z8CnaKx91K W3UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=u7HX6owvpzHrWZzjdtE+1XqOm8PLa6Ue4dtrTbB0g88=; b=pO18FpyKGrQ/kSlRJDzac/G2BEe27uwgMspTqPRC/rtAC8a2sBFMnSM4BEtj4KKCm5 aKdgukK2RloQQnT20GY+LXcIauFutwFwHl4F1V6GvUtSfFxue5xCcPIhkEP7A6eZli2o 1cfGaH22VYwCMFw4ECtcBhp4+fIZkxbk3Phm6QH8qdRr/eAfTxHIsfh8kPAFAloo/p1g suc0xUy2Xy1Bu1RnpwfxFAqbl0Zy+miu1WhMj7nkkZB/PHlCp5uHFLnquKHAFp/ty6mN MiEmv9Z2TNN/6kDiLvrzffmlTC5HwKwTf6IhhntPbG1QY8glDmTjTkLj0/0PUWbszPTq JN4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h65-v6si14530586pfb.70.2018.07.24.21.12.44; Tue, 24 Jul 2018 21:12:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727881AbeGYFVl (ORCPT + 99 others); Wed, 25 Jul 2018 01:21:41 -0400 Received: from nautica.notk.org ([91.121.71.147]:50871 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726773AbeGYFVl (ORCPT ); Wed, 25 Jul 2018 01:21:41 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id B7657C009; Wed, 25 Jul 2018 06:11:54 +0200 (CEST) Date: Wed, 25 Jul 2018 06:11:39 +0200 From: Dominique Martinet To: Tomas Bortoli Cc: davem@davemloft.net, v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller@googlegroups.com Subject: Re: [PATCH] 9p: validate PDU length Message-ID: <20180725041139.GB11041@nautica> References: <20180723154404.2406-1-tomasbortoli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180723154404.2406-1-tomasbortoli@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tomas Bortoli wrote on Mon, Jul 23, 2018: > diff --git a/net/9p/client.c b/net/9p/client.c > index 18c5271910dc..92240ccf476b 100644 > --- a/net/9p/client.c > +++ b/net/9p/client.c > @@ -524,6 +525,12 @@ static int p9_check_errors(struct p9_client *c, struct p9_req_t *req) > int ecode; > > err = p9_parse_header(req->rc, NULL, &type, NULL, 0); > + if (req->rc->size >= c->msize) { I was looking at this again, I think it's more appropriate to use req->rc->capacity at this point like you did in the first version of the patch. I had suggested msize in the common p9_parse_header function because that'd let us accept zc requests where the size in the pdu could be bigger than capacity, but this isn't the case in p9_check_errors. If you're ok with this I'll edit your commit directly, this is less work for me than having to check a new patch. Thanks, -- Dominique