Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3972610pxb; Mon, 21 Feb 2022 09:20:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2Lsg5BMEAV6fEwqgo5NLYwLOxah0DT/eqKAKZLkEi1H8gB0nA4L+x2pD+g9+ybZsan9tt X-Received: by 2002:a17:906:b1d0:b0:6cf:7f39:50e0 with SMTP id bv16-20020a170906b1d000b006cf7f3950e0mr17382870ejb.760.1645464026587; Mon, 21 Feb 2022 09:20:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645464026; cv=none; d=google.com; s=arc-20160816; b=HmP3iJ8UeV9CMCpSa/KComKt7ZDFQB6wwqZ6ZFIO4ebCd6dsIeYLlLRmtcQmzhKnSO qx+iqqcNgIl3Qgvp7gXQCMlYkqdJ1EVgcF7UkO0jIuv6W750vglOZJi26KjdA/WgxyuU DODYw9cEbBtFjlqioCXA7BSAbdT3nTJXHuJtQFcffAl68wJ/VhXnK0E7Rge8Apzpq4wl m3G6d0IPkPTV1vJoCkZBxFkOspC/Y5NTv0G4ye/9+NxQ+T3qHy4rTtS/dRYLlzjWxqA5 VF2f8XaiP5FeoDYwp7//Nw3+L0dgm/4GceVww2CqlEm0WJcghgoxl/F6N6MMuaepIDMw YArw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SoyoRMJ/nAu1Wuy1hoTYHjBEoixwT5p2+nHN8seM7W0=; b=DXf9aMuCbLf7hIIXq+IMB3qtogVQO7Zf12wtlXeL3oAXCgkaZmrizrF3aA8oNDoDh8 xnxMsog4ykZ1YFbePRx+6BH8BW4hCeMf4Ir+m9unAGc4Cut3wpXweB/5IMws5D9fjFK7 +a86LI487oiPqc/eHE01guQnzb+kyL0YwEEZfVVPBmP/HHX9PdWU/JmchwvJ2AlYAQoE O6Ayw04SsZO+VCqSoOxJqwuiNElF1wl78iUXFc7DG8H32B3eg3cVqtwIHKIpOnYozCkK iFVm7eMLw4EPGlHSGKmUAhxYE3YmHvVkU6gDN5L0zG+oSWSezhHWI1L26CmNvX5uKEEo TFOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ioUPg4F6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16si4463672edj.216.2022.02.21.09.20.03; Mon, 21 Feb 2022 09:20:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ioUPg4F6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380933AbiBUQlT (ORCPT + 99 others); Mon, 21 Feb 2022 11:41:19 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:50126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381025AbiBUQkF (ORCPT ); Mon, 21 Feb 2022 11:40:05 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BEFD527CF4 for ; Mon, 21 Feb 2022 08:39:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645461558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SoyoRMJ/nAu1Wuy1hoTYHjBEoixwT5p2+nHN8seM7W0=; b=ioUPg4F6n/Kn2JYXxEcpss2iybZB8SV7BicR7QMmgJ216dhvyZqe2A64ybJIFljwIrM6LQ 6We4gq8tTZH9bUaX0tD8UbUBWTprIGjbUXQvFVIk3dKX2rjaMUP8Azl+iZr78rKOzm/+PX i72oLkIU4rNwTzcYDbUx8IcN5B1yq8g= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-619-TigVRQaAPlm4Jb1Q6JJnNw-1; Mon, 21 Feb 2022 11:39:17 -0500 X-MC-Unique: TigVRQaAPlm4Jb1Q6JJnNw-1 Received: by mail-qk1-f199.google.com with SMTP id q24-20020a05620a0c9800b0060d5d0b7a90so13536054qki.11 for ; Mon, 21 Feb 2022 08:39:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=SoyoRMJ/nAu1Wuy1hoTYHjBEoixwT5p2+nHN8seM7W0=; b=sVsyWNDw+oa9n9l7K4Vj226F2r9ATia5PFysClJamvX25MkoL84vozJuYSBDx7NLrr ad12ExdhbghFfWIst6PPCUvmG4q5VV/4VKZdMh9qaySm9EBIN1lpqxfLsNcAMMrGfij9 SPOrrVrgWeNCVmn7/hp5HeXHHNpdAidm7n2NPrwcw+JkL/eJ3iWwclrde4eVS4zWnY/j X/Ns8dkx5wiruBT+NaKgOoNckw2F40khBvZO4TjvJYvGrwHg9UVVxe+djlCUgrs9I35e lG+UuzdJJQAhgUosTR3b2lC0clVlgxnRlvn7/w4aCUAB89Vfe53pD8/JvWr5s8kiwFkR xoHg== X-Gm-Message-State: AOAM530gFO9f9fnMgU5rLSpzZt0ZBjBzIJdP7PQKo/2OeDxmTxf1Zgn8 /RmzACpqTDS81EIQvfYXUO2yjYdniW8Ic6YZSgaJbf4HtKye3AtqPGRDViiOv0xewpM69vXfaqX Wus+AUH8hDFPa2cwnqd2E47yj X-Received: by 2002:a05:6214:19ed:b0:42c:289b:860e with SMTP id q13-20020a05621419ed00b0042c289b860emr15949412qvc.73.1645461557328; Mon, 21 Feb 2022 08:39:17 -0800 (PST) X-Received: by 2002:a05:6214:19ed:b0:42c:289b:860e with SMTP id q13-20020a05621419ed00b0042c289b860emr15949399qvc.73.1645461557115; Mon, 21 Feb 2022 08:39:17 -0800 (PST) Received: from sgarzare-redhat (host-95-248-229-156.retail.telecomitalia.it. [95.248.229.156]) by smtp.gmail.com with ESMTPSA id s5sm7471966qtn.35.2022.02.21.08.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 08:39:16 -0800 (PST) Date: Mon, 21 Feb 2022 17:39:09 +0100 From: Stefano Garzarella To: Anirudh Rayabharam Cc: syzbot , Jason Wang , kvm , kernel list , Michael Tsirkin , netdev , syzkaller-bugs@googlegroups.com, Linux Virtualization Subject: Re: [syzbot] INFO: task hung in vhost_work_dev_flush Message-ID: <20220221163909.xfrgt6slp3ksqr2w@sgarzare-redhat> References: <00000000000057702a05d8532b18@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 21, 2022 at 09:23:04PM +0530, Anirudh Rayabharam wrote: >On Mon, Feb 21, 2022 at 03:12:33PM +0100, Stefano Garzarella wrote: >> #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ >> f71077a4d84b >> >> Patch sent upstream: >> https://lore.kernel.org/virtualization/20220221114916.107045-1-sgarzare@redhat.com/T/#u > >I don't see how your patch fixes this issue. It looks unrelated. It is >surprising that syzbot is happy with it. > >I have sent a patch for this issue here: >https://lore.kernel.org/lkml/20220221072852.31820-1-mail@anirudhrb.com/ It is related because the worker thread is accessing the iotlb that is going to be freed, so it could be corrupted/invalid. Your patch seems right, but simply prevents iotlb from being set for the the specific test case, so it remains NULL and iotlb_access_ok() exits immediately. Anyway, currently if nregions is 0 vhost_set_memory() sets an iotlb with no regions (the for loop is not executed), so I'm not sure iotlb_access_ok() cycles infinitely. Stefano