 vdpa/vp_vdpa: fix kfree a wrong pointer in vp_vdpa_remove · gregkh/linux@8fe1268 · GitHub Skip to content Navigation Menu Toggle navigation Sign in Appearance settings Platform AI CODE CREATION GitHub Copilot Write better code with AI GitHub Spark Build and deploy intelligent apps GitHub Models Manage and compare prompts MCP Registry New Integrate external tools DEVELOPER WORKFLOWS Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes APPLICATION SECURITY GitHub Advanced Security Find and fix vulnerabilities Code security Secure your code as you build Secret protection  EXPLORE Why GitHub Documentation Blog Changelog Marketplace View all features Solutions BY COMPANY SIZE Enterprises Small and medium teams Startups Nonprofits BY USE CASE App Modernization DevSecOps DevOps CI/CD View all use cases BY INDUSTRY Healthcare Financial services Manufacturing Government View all industries View all solutions Resources EXPLORE BY TOPIC AI Software Development DevOps Security View all topics EXPLORE BY TYPE Customer stories Events &amp; webinars Ebooks &amp; reports Business insights GitHub Skills SUPPORT &amp; SERVICES Documentation Customer support Community forum Trust center Partners View all resources Open Source COMMUNITY GitHub Sponsors Fund open source developers PROGRAMS Security Lab Maintainer Community Accelerator GitHub Stars Archive Program REPOSITORIES Topics Trending Collections Enterprise ENTERPRISE SOLUTIONS Enterprise platform AI-powered developer platform AVAILABLE ADD-ONS GitHub Advanced Security Enterprise-grade security features Copilot for Business Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... --> Search Clear Search syntax tips Provide feedback --> We read every piece of feedback, and take your input very seriously.  Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly --> Name Query To see all available qualifiers, see our documentation . Cancel Create saved search Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} gregkh / linux Public Notifications You must be signed in to change notification settings Fork 676 Star 636 Code Actions Security and quality 0 Insights Additional navigation options Code Actions Security and quality Insights Commit 8fe1268 Browse files Browse files Rong Wang authored and gregkh committed vdpa/vp_vdpa: fix kfree a wrong pointer in vp_vdpa_remove [ Upstream commit ed843d6 ] In vp_vdpa_remove(), the code kfree(&amp;vp_vdpa_mgtdev-&gt;mgtdev.id_table) uses a reference of pointer as the argument of kfree, which is the wrong pointer and then may hit crash like this: Unable to handle kernel paging request at virtual address 00ffff003363e30c Internal error: Oops: 96000004 [#1] SMP Call trace: rb_next+0x20/0x5c ext4_readdir+0x494/0x5c4 [ext4] iterate_dir+0x168/0x1b4 __se_sys_getdents64+0x68/0x170 __arm64_sys_getdents64+0x24/0x30 el0_svc_common.constprop.0+0x7c/0x1bc do_el0_svc+0x2c/0x94 el0_svc+0x20/0x30 el0_sync_handler+0xb0/0xb4 el0_sync+0x160/0x180 Code: 54000220 f9400441 b4000161 aa0103e0 (f9400821) SMP: stopping secondary CPUs Starting crashdump kernel... Fixes: ffbda8e ("vdpa/vp_vdpa : add vdpa tool support in vp_vdpa") Signed-off-by: Rong Wang &lt;wangrong68@huawei.com&gt; Signed-off-by: Nanyong Sun &lt;sunnanyong@huawei.com&gt; Message-Id: &lt;20221207120813.2837529-1-sunnanyong@huawei.com&gt; Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt; Reviewed-by: Cindy Lu &lt;lulu@redhat.com&gt; Acked-by: Jason Wang &lt;jasowang@redhat.com&gt; Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt; 1 parent 67fb59f commit 8fe1268 Copy full SHA for 8fe1268 1 file changed + 1 - 1 Lines changed: 1 addition &amp; 1 deletion File tree Expand file tree Collapse file tree Open diff view settings Filter options drivers/vdpa/virtio_pci vp_vdpa.c Expand file tree Collapse file tree Open diff view settings Collapse file ‎ drivers/vdpa/virtio_pci/vp_vdpa.c ‎ Copy file name to clipboard Expand all lines: drivers/vdpa/virtio_pci/vp_vdpa.c + 1 - 1 Lines changed: 1 addition &amp; 1 deletion Original file line number Diff line number Diff line change @@ -629,7 +629,7 @@ static void vp_vdpa_remove(struct pci_dev *pdev) 629 629 mdev = vp_vdpa_mgtdev -&gt; mdev ; 630 630 vp_modern_remove ( mdev ); 631 631 vdpa_mgmtdev_unregister ( &amp; vp_vdpa_mgtdev -&gt; mgtdev ); 632 - kfree ( &amp; vp_vdpa_mgtdev -&gt; mgtdev . id_table ); 632 + kfree ( vp_vdpa_mgtdev -&gt; mgtdev . id_table ); 633 633 kfree ( mdev ); 634 634 kfree ( vp_vdpa_mgtdev ); 635 635 } 0 commit comments Comments 0 ( 0 ) Footer &copy; 2026 GitHub,&nbsp;Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. 