Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1673061ioo; Sun, 22 May 2022 23:54:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDcnBEkrAqZFqPh1g1vDv+c0O6WsRf1ndJyYbFiVkbODsbepZpf/CL16ELcZjgP6uYGF3e X-Received: by 2002:a17:902:b28a:b0:15f:34c0:90d5 with SMTP id u10-20020a170902b28a00b0015f34c090d5mr21038568plr.133.1653288851771; Sun, 22 May 2022 23:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653288851; cv=none; d=google.com; s=arc-20160816; b=T02dZW0uiCqCCXdN+3Ff1F+4q3IjdjZKCRToc/aY/pWLS9HCM7UQNiBPhhVujWYK9h VuxCYU8bLJsGDip4lRSrJRRJHXKEXAReJdswexW95pPa7T5k638U0tHEulkZbBSiUlss FZ2ydikbc9nOPBwFEn3jfqz942bcocDnTlCNsIQxE1TLPJK8d+IWHnN8lMYVm2tRFxaP v7dEiE86ZXGe+StEUfyOthf6a3MDBq1pM2ujtn0PGjM/itzZJJpIZM7UDUVh3THDXktk rsrgolCwYiWZswAdb7/w+e4LFYFRTrqvz+wRcqVwaGaOvXARnHkwVLMEjJvh04bxsv8I gQog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=CCd/pDk/Xk+019KXS57x+NXHFX4o0pmZ9eQN5FcIC0o=; b=eVFAtUWKR8ABESSirL7advZl+2tse1dMt8aBG4euCPqJ3nKkwMrawWCLfHwYKUupmG SKX0UY35gZvDB0oSqQ/okr1QY2Cq2M03n1foKa0VoUOdRsm1yC66I5bffk1hKmullXA5 TQn1A0P80BG2DBzYTdJfvNWTh8kWzSOPV0beXqsLrth6uW8z0wl5K1iUFWbomSUA+I5x GA9pjGfxMwEOXL9kPRX2+i7qZ5/lSZE3DZ0p86fBeK42vyRGyDuorMBfoeOGyAoOS4xH nVU2oIgObj4OjkuvNzO0GQfWqmHrjoeRwysBsAoxL9/94Ona0mi+C+AvMG0n1hfKcGwv 657Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=A+RvI1aM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j7-20020a170902690700b0015eb29579dbsi8655382plk.187.2022.05.22.23.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 23:54:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=A+RvI1aM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7CB842608; Sun, 22 May 2022 23:20:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245554AbiEWErS (ORCPT + 99 others); Mon, 23 May 2022 00:47:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229948AbiEWErO (ORCPT ); Mon, 23 May 2022 00:47:14 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47E3426116 for ; Sun, 22 May 2022 21:47:13 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id pq9-20020a17090b3d8900b001df622bf81dso12572763pjb.3 for ; Sun, 22 May 2022 21:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CCd/pDk/Xk+019KXS57x+NXHFX4o0pmZ9eQN5FcIC0o=; b=A+RvI1aM4kHHzoMhgrE6eDXv2Y5GsECvz92Cw+GcuYV4Omq/K7+tDGsEbedIQ8AAyT uQoi+IDyqFU4tThm45EWDbVwoTW/rW4z3LLOv5Kh0BDxXgW3+eU7WOz0TtHQkXndXOz7 xDUIXbhHB5Uuge0ymRKxJmCFIKDb4PC9e2CKvKYyu8JcC4s2TFIXUY04kMEntBl7FLHj i3DBSWXF/dUqNQ8Lbj/FcSHvKH3sKtcIS0PhiX/DSP5IXNTs18nt18adQG36+H9LzA7g Zcsm03GKiQ3yVj34ilzz+81sMOP0Cw58YO1s1c5/g7jBcmKB6fFjEgj79SM7BnB+eyEV 3w8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CCd/pDk/Xk+019KXS57x+NXHFX4o0pmZ9eQN5FcIC0o=; b=xRyZ49z5pDb0hLtMa7Yu6PDxgzcUIzzAzxLn2M4b53Ma45XktVwIToFTxcEVjrH+io y8ZBRcvcnOV/s6zbR52mOit8dY0TasqGkGM9TaQfotAZSLBmDrOwW+GC7buMZsEeyX/2 +HlX4LcEuCaBO6NMWR7DqVi/w4Uh/+EAl1RBRUTWRmw4FWpSzQ3RsiKgZrMd76TGpFYL VB+DLToIrsgo74fzAyLN00ljKPK+dNd/oAGENIm/t5LS0lbw+LfuWtSQ7tFPqOGHgPYz LPAZRjh48ulUW38ilugM8GlK7F0MLiROOwnuTczKoGKDKDzw4hM5Ywzr/6pQxilJeAq/ rOTQ== X-Gm-Message-State: AOAM533dd3fJhLu92II0Z5bq6cemKy8PSjlLCGmQdUACSIAYh11XZoS9 RjeYxh2mw3JpAmZPxuhkuTGqAYPKn/fUo1GkRA== X-Received: by 2002:a17:902:d711:b0:161:f859:bed7 with SMTP id w17-20020a170902d71100b00161f859bed7mr13178025ply.31.1653281232821; Sun, 22 May 2022 21:47:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Zheyu Ma Date: Mon, 23 May 2022 12:47:01 +0800 Message-ID: Subject: Re: [BUG] vDPA/ifcvf: got a warning when removing the module To: Jason Wang Cc: mst , Zhu Lingshan , Yongji Xie , Eli Cohen , Parav Pandit , virtualization , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, May 23, 2022 at 12:15 PM Jason Wang wrote: > > On Sat, May 21, 2022 at 10:27 PM Zheyu Ma wrote: > > > > Hello, > > > > I found a bug in the ifcvf driver. > > When removing the module, I got the following warning: > > > > [ 14.478123] general protection fault, probably for non-canonical > > address 0xdffffc0000000005: 0000 [#1] PREEMPT SMP KASAN PTI > > [ 14.478701] KASAN: null-ptr-deref in range > > [0x0000000000000028-0x000000000000002f] > > [ 14.479922] RIP: 0010:vdpa_mgmtdev_unregister+0x39/0x150 > > [ 14.484063] Call Trace: > > [ 14.484186] > > [ 14.484292] ? _raw_spin_unlock_irqrestore+0x3d/0x60 > > [ 14.484536] ifcvf_remove+0x3a/0x50 [ifcvf] > > [ 14.484743] pci_device_remove+0x92/0x240 > > > > The reason is that the 'ifcvf_mgmt_dev' is zero which means that > > ifcvf_vdpa_dev_add() was not executed. > > Since I am not familiar with the driver, I cannot find a proper solution for it. > > > > Looks like the drv data needs to be set in probe(). Could you pleas > try to the attached patch? (compile test only). This patch works for me, thanks! Tested-by: Zheyu Ma Regards, Zheyu Ma