From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [patch] infiniband: uverbs: limit the number of entries Date: Thu, 7 Oct 2010 10:16:49 -0600 Message-ID: <20101007161649.GD21206@obsidianresearch.com> References: <20101007071610.GC11681@bicker> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20101007071610.GC11681@bicker> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Dan Carpenter Cc: Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rdma@vger.kernel.org On Thu, Oct 07, 2010 at 09:16:10AM +0200, Dan Carpenter wrote: > If we don't limit cmd.ne then the multiplications can overflow. This > will allocate a small amount of RAM successfully for the "resp" and > "wc" buffers. The heap will get corrupted when we call ib_poll_cq(). I think you could cap the number of returned entries to UVERBS_MAX_NUM_ENTRIES rather than return EINVAL. That might be more compatible with user space.. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html