From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 168D32B92 for ; Wed, 29 Aug 2018 15:59:27 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180829135925euoutp0259b8f2acc0729b90847ad1b15344d9e6~PX6ZWYxcz3201532015euoutp02E for ; Wed, 29 Aug 2018 13:59:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180829135925euoutp0259b8f2acc0729b90847ad1b15344d9e6~PX6ZWYxcz3201532015euoutp02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1535551166; bh=258E8I75WhWZIcOTDPYtSlY/ABQQ6vYCLerenvKMDZQ=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=dGfwcOujwnmecaq0t4oGaQHnV+MRJwaHaXfmh4A9WRIPgePMHK1Q77xDOK8VAEhSI n47SgRX3M6/KOhF9lxi1kXG1iboJVmS3tQE+Sj+RFCxixmIpVDVBExihg8frASankc GGNXjADMGnW/LeOdwJwuUAo1c5DroDy1JDQKE1yk= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180829135924eucas1p2bec66ae30b3bac43e545c170dc57fd58~PX6YZeSWP2716827168eucas1p24; Wed, 29 Aug 2018 13:59:24 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 28.62.04441.CB6A68B5; Wed, 29 Aug 2018 14:59:24 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20180829135924eucas1p284d5711018eeba8b0ec3aaa6c84cef10~PX6Xgs7eA2716827168eucas1p22; Wed, 29 Aug 2018 13:59:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180829135923eusmtrp1d946a80cf1ca78225654da4c2494747b~PX6XP4C2o0505305053eusmtrp1a; Wed, 29 Aug 2018 13:59:23 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-9e-5b86a6bc99f7 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1E.5A.04284.BB6A68B5; Wed, 29 Aug 2018 14:59:23 +0100 (BST) Received: from [106.109.129.180] (unknown [106.109.129.180]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20180829135923eusmtip2aa64b779e7f6a1bdf1449de3daa485af~PX6W1jigK2268622686eusmtip27; Wed, 29 Aug 2018 13:59:23 +0000 (GMT) To: dev@dpdk.org Cc: Maxime Coquelin , Tiwei Bie , Zhihong Wang , stable@dpdk.org From: Ilya Maximets Date: Wed, 29 Aug 2018 17:00:47 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180817113354.16140-1-i.maximets@samsung.com> Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPKsWRmVeSWpSXmKPExsWy7djP87p7lrVFG2xv1bB492k7k8WV9p/s Fsc697BY/Ov4w26xteE/k8Xmi5OYHNg8fi1YyuqxeM9LJo/3+66yefRtWcUYwBLFZZOSmpNZ llqkb5fAlfGsZStzwUXuio/nn7M1MO7i7GLk4JAQMJGY+caui5GTQ0hgBaPE06V8XYxcQPYX Rom3f8+zQzifGSXef2pig2k4uSYVIr6cUWLZ2v1sEM5HRokXrQtYQUYJC7hJrL/2jA3EFhEQ kPjcuRisiFmgl1Fi8r+z7CAJNgEdiVOrjzCC2CwCqhKTvpwGs0UFIiSOPFgIZvMKCEqc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C0jILScssJC0LGFlWMYqklhbnpucWG+oVJ+YWl+al 6yXn525iBEbYtmM/N+9gvLQx+BCjAAejEg/vhRlt0UKsiWXFlbmHGCU4mJVEePcuBArxpiRW VqUW5ccXleakFh9iNAX6bSKzlGhyPjD680riDU0NzS0sDc2NzY3NLJTEec8bVEYJCaQnlqRm p6YWpBbB9DFxcEo1MGZdOqWgmp39Iyf33f5bIZyJz09P+d1Ufzui4XzH/lTGzZ58/ueylghG TP100tdS/GH4vb65vUs1Gzk/N0eJFwlcVc28rlCmKW+i1KMitkolwOTmftZTM4wmfxCwNj/Q 1Cdd+Xy+tHm8FPtr3V0cF1NrH9tovi+X/5l0q+Jb2L35dT4/N562U2Ipzkg01GIuKk4EABPt 37LGAgAA Message-Id: <20180829135924eucas1p284d5711018eeba8b0ec3aaa6c84cef10~PX6Xgs7eA2716827168eucas1p22@eucas1p2.samsung.com> X-CMS-MailID: 20180829135924eucas1p284d5711018eeba8b0ec3aaa6c84cef10 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20180817113255eucas1p2042d22241265dafa241c2a6a2c949244 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180817113255eucas1p2042d22241265dafa241c2a6a2c949244 References: <20180817113354.16140-1-i.maximets@samsung.com> Subject: Re: [dpdk-dev] [PATCH] vhost: fix crash if set vring num handling failed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2018 13:59:27 -0000 Any thoughts on this? Best regards, Ilya Maximets. On 17.08.2018 14:33, Ilya Maximets wrote: > Allocation failures of shadow used ring and batched copy array > are not recoverable and leads to the segmentation faults like > this on the receiving/transmission path: > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 0x7f913fecf0 (LWP 43625)] > in copy_desc_to_mbuf () at /lib/librte_vhost/virtio_net.c:760 > 760 batch_copy[vq->batch_copy_nb_elems].dst = > > This could be easily reproduced in case of low memory or big > number of vhost-user ports. Fix that by propagating error to > the upper layer which will end up with disconnection. > > Fixes: f689586bc060 ("vhost: shadow used ring update") > Cc: stable@dpdk.org > > Signed-off-by: Ilya Maximets > --- > lib/librte_vhost/vhost_user.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index 9aa1ce118..4c7fd57fb 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -1693,7 +1693,9 @@ vhost_user_msg_handler(int vid, int fd) > break; > > case VHOST_USER_SET_VRING_NUM: > - vhost_user_set_vring_num(dev, &msg); > + ret = vhost_user_set_vring_num(dev, &msg); > + if (ret) > + return -1; > break; > case VHOST_USER_SET_VRING_ADDR: > vhost_user_set_vring_addr(&dev, &msg); >