From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6001DC4708D for ; Thu, 27 May 2021 04:57:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40D6E6113E for ; Thu, 27 May 2021 04:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234649AbhE0E65 (ORCPT ); Thu, 27 May 2021 00:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234594AbhE0E6x (ORCPT ); Thu, 27 May 2021 00:58:53 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73EAFC061574 for ; Wed, 26 May 2021 21:57:20 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id j10so4163953edw.8 for ; Wed, 26 May 2021 21:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YJ0dWA2LN7YqfF1ySTSNQvt81ovDnTZhfscP6j/isLs=; b=gKB8fvK0cCWN4lEkm4wDH6rz4Sa0FsxRwsg5F16JeFZeSk5+GIGcIQz76DqI7jCKna 1n5SBDwT2tPkv3xz9FZpqyHuntur92hGyhaJqhPLvrxOpxjMAwWwnzEI+ond1RyDNj2M hSKTWiLfyXawwcHjtm/qvhYeQS3O4ky+w5QeGyceqwSLyP/TheaH2Ne18IVUbd8qIt3/ KCdb3Z51nRn7l+3Pmv10fGurtavWFZ1jh73TQbyQtJqZwO5c78iH8kmQAAcbOJ6mGvgX 3uDqtsAOrG8BYjKnqsMxPZMs+PQNCK4Ce6nPSunMJjOob1tFMqZxwaa9xuHBoDSMyEVR hSNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YJ0dWA2LN7YqfF1ySTSNQvt81ovDnTZhfscP6j/isLs=; b=bb7cEf1FaTM4JsnQ3/mcJryus1p+9BwhFM1up/kusmdrDsBOh5bkatVWL327wgqlcn 4YgwLhlz6J4WatKLksmUpqedp8AA07+9iuyywxt1xSJPKDWIIfP8M7pT51jGIsNryBNM vfkRzKQ455WBjpeYwoaDZLtdV5m6MVy3oe2MJqGQuPmYHwAsOQWJ3WstVb1pWeo7ugb1 LtGv1dmLUCtnfuzSCo+FY1wIHBG2LBBl2EvceQwRzk1oW7UNu/dSfJmS10wPyc+9Je2X 0XPOlLCizXxxvKOhC8GqezIPrmjLAUgTGD5rmU67kCSz2AdvubeaOCxXLBMRMEy2Ion9 gYSg== X-Gm-Message-State: AOAM5330m/DMsghVmipfJpNjSro2Fx/a69mDyFNVTXiVj0ry6w02BNvT 1JybXURshPvc2zaZJBt9ligjTpz4yZ4p7aS7g8cB X-Google-Smtp-Source: ABdhPJz7HIu5MQLRpH/FbPdTqRTue+3JMybVC+vY85i/I/de3bl/zvWYSVdjNKEUlXy6fDXCcVP8dUSaDhAFYIw47Ng= X-Received: by 2002:a05:6402:4252:: with SMTP id g18mr1953908edb.195.1622091439123; Wed, 26 May 2021 21:57:19 -0700 (PDT) MIME-Version: 1.0 References: <20210517095513.850-1-xieyongji@bytedance.com> <20210517095513.850-12-xieyongji@bytedance.com> <3740c7eb-e457-07f3-5048-917c8606275d@redhat.com> In-Reply-To: <3740c7eb-e457-07f3-5048-917c8606275d@redhat.com> From: Yongji Xie Date: Thu, 27 May 2021 12:57:08 +0800 Message-ID: Subject: Re: Re: [PATCH v7 11/12] vduse: Introduce VDUSE - vDPA Device in Userspace To: Jason Wang Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , Stefano Garzarella , Parav Pandit , Christoph Hellwig , Christian Brauner , Randy Dunlap , Matthew Wilcox , Al Viro , Jens Axboe , bcrl@kvack.org, Jonathan Corbet , =?UTF-8?Q?Mika_Penttil=C3=A4?= , Dan Carpenter , joro@8bytes.org, virtualization , netdev@vger.kernel.org, kvm , linux-fsdevel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 27, 2021 at 12:13 PM Jason Wang wrote: > > > =E5=9C=A8 2021/5/17 =E4=B8=8B=E5=8D=885:55, Xie Yongji =E5=86=99=E9=81=93= : > > + > > +static int vduse_dev_msg_sync(struct vduse_dev *dev, > > + struct vduse_dev_msg *msg) > > +{ > > + init_waitqueue_head(&msg->waitq); > > + spin_lock(&dev->msg_lock); > > + vduse_enqueue_msg(&dev->send_list, msg); > > + wake_up(&dev->waitq); > > + spin_unlock(&dev->msg_lock); > > + wait_event_killable(msg->waitq, msg->completed); > > > What happens if the userspace(malicous) doesn't give a response forever? > > It looks like a DOS. If yes, we need to consider a way to fix that. > How about using wait_event_killable_timeout() instead? Thanks, Yongji