From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [V9fs-developer] [PATCH] Integer underflow in pdu_read() Date: Mon, 9 Jul 2018 20:31:52 +0100 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 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 To: Tomas Bortoli Return-path: Content-Disposition: inline In-Reply-To: <20180709192651.28095-1-tomasbortoli@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.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?