From: David Miller Subject: Re: [PATCH net-next] ptr_ring: fix integer overflow Date: Mon, 29 Jan 2018 12:01:24 -0500 (EST) Message-ID: <20180129.120124.892750865825553841.davem@davemloft.net> References: <1516865502-20835-1-git-send-email-jasowang@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: mst@redhat.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, john.fastabend@gmail.com To: jasowang@redhat.com Return-path: In-Reply-To: <1516865502-20835-1-git-send-email-jasowang@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Jason Wang Date: Thu, 25 Jan 2018 15:31:42 +0800 > We try to allocate one more entry for lockless peeking. The adding > operation may overflow which causes zero to be passed to kmalloc(). > In this case, it returns ZERO_SIZE_PTR without any notice by ptr > ring. Try to do producing or consuming on such ring will lead NULL > dereference. Fix this detect and fail early. > > Fixes: bcecb4bbf88a ("net: ptr_ring: otherwise safe empty checks can overrun array bounds") > Reported-by: syzbot+87678bcf753b44c39b67@syzkaller.appspotmail.com > Cc: John Fastabend > Signed-off-by: Jason Wang I'm dropping this because I am to understand that Michael Tsirkin's patch series covers this issue. Let me know if I still need to apply this. Thanks.