From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Abeni Subject: Re: [PATCH] IB/IPoIB: Check the headroom size Date: Wed, 26 Apr 2017 09:46:34 +0200 Message-ID: <1493192794.2409.3.camel@redhat.com> References: <1493114155-12101-1-git-send-email-honli@redhat.com> <1493134815.3041.72.camel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Cc: Erez Shitrit , Honggang LI , Erez Shitrit , "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Linux Netdev List , David Miller To: Or Gerlitz , Doug Ledford Return-path: In-Reply-To: Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Wed, 2017-04-26 at 00:50 +0300, Or Gerlitz wrote: > so maybe @ least for the time being, we should be picking Hong's patch > with proper change log and without the giant stack dump till we have > something better. If you agree, can you do the re-write of the change > log? I think that Hong's patch is following the correct way to fix the issue: ipoib_hard_header() can't assume that the skb headroom is at least IPOIB_HARD_LEN bytes, as wrongly implied by commit fc791b633515 (my fault, I'm sorry). Perhaps we can make the code a little more robust with something alongside the following (only compile tested): --- diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index d1d3fb7..d53d2e1 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1160,6 +1160,11 @@ static int ipoib_hard_header(struct sk_buff *skb,                              const void *daddr, const void *saddr, unsigned len)  {         struct ipoib_header *header; +       int ret; + +       ret = skb_cow_head(skb, IPOIB_HARD_LEN); +       if (ret) +               return ret;           header = (struct ipoib_header *) skb_push(skb, sizeof *header); --- Paolo -- 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