Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp887853imm; Mon, 9 Jul 2018 12:32:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcXgDXtWBcYxt5pnErMLN/9MAndvn9usqJgd+Gu1pvA8f3YwdilPlaPD1Pl1Ak52gwkQshs X-Received: by 2002:a62:9541:: with SMTP id p62-v6mr22519251pfd.152.1531164773935; Mon, 09 Jul 2018 12:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531164773; cv=none; d=google.com; s=arc-20160816; b=IkgU4ku0GDDrTGbWLtmcHmGiEiKjL32Gumd71jyr7fxG5yrznIzsYN44Cpwd0BSjWU HszI8XUK0/uExA9UAKab4dGapC+dnKOkY1XlH7dPNfW+dv73attf7Fh/gXJVhtzzp9no eU5Z8OSM+4iEHc1RcgUCpN6ZQd5AE5pz4tRDk2WX4Eckif64uB0EWVaYN9pc+6zCC2aA 6oF+EEx7TIhbAZwI2zfRE/DrCz1B8tm3HEVRQBrqlDQ36JcIrprDmyPfnr8itmS15iJq iFbXG4Y8RzMP2px2dazn+vxVDuHHvNWHuCHrsZLOzJjKkOXgQ2J/eYJ1hxDYF6ILh1cF w+Dw== 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=rMqFA6UMjtMrwr6SDk2HhLHhZ8s46XbwjIG/IYmaim8=; b=C7Ks5rXwX2onaJtKFWVnL3DBdd/SquouHYi9+CI9GmPWQT+ciKlKV0+HyzAbtyvd5s kNMAeq7if4f83n2vnA8BTWDmnPWKTeG2Ff4pY49o6LVVMnvKf2x/dMtsvxAk5pWykitn Tnfv9tMMZmtx85mNHoxw1VNg9Ny62pqCQ2ojKrjuhxruy6fUZoW9C+e0GYvFaUi3TdAu ZEBqcCUPOhzyh9q+MARIunYlTkNUoPyLbZs4nr62ujRx+5hY0XD7Gpm4YuF4hzpQ+EST oZGLKLH5VQb4tKNhs/cOwrgoqeU6KkpNJFe/SzpY/M2Mos05DgPxb5qDJY0RIB1cbotY pJlA== 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 z127-v6si15001241pgb.455.2018.07.09.12.32.38; Mon, 09 Jul 2018 12:32:53 -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 S1754583AbeGITcD (ORCPT + 99 others); Mon, 9 Jul 2018 15:32:03 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:60834 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754520AbeGITcC (ORCPT ); Mon, 9 Jul 2018 15:32:02 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fcbt2-00052R-5G; Mon, 09 Jul 2018 19:31:52 +0000 Date: Mon, 9 Jul 2018 20:31:52 +0100 From: Al Viro To: Tomas Bortoli Cc: ericvh@gmail.com, rminnich@sandia.gov, lucho@ionkov.net, davem@davemloft.net, v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller@googlegroups.com Subject: Re: [V9fs-developer] [PATCH] Integer underflow in pdu_read() Message-ID: <20180709193151.GI30522@ZenIV.linux.org.uk> References: <20180709192651.28095-1-tomasbortoli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180709192651.28095-1-tomasbortoli@gmail.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2018 at 09:26:51PM +0200, Tomas Bortoli wrote: > The pdu_read() function suffers from an integer underflow. > When pdu->offset is greater than pdu->size, the length calculation will have > a wrong result, resulting in an out-of-bound read. > This patch modifies also pdu_write() in the same way to prevent the same > issue from happening there and for consistency. What does cause the calls of pdu_read() in such conditions and shouldn't *that* be dealt with?