Received: by 10.192.165.148 with SMTP id m20csp782785imm; Fri, 27 Apr 2018 07:27:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoyZjFCQFhKOpIA1/bJcdSrnDYjqkKrNGqyOOnPA9f0bmhOUZ1zlSqaGOT2h64NfDGM2zs9 X-Received: by 10.98.208.68 with SMTP id p65mr2451225pfg.64.1524839241068; Fri, 27 Apr 2018 07:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524839241; cv=none; d=google.com; s=arc-20160816; b=Dq7Pf1Y0DmrcCN0eEefuBkbJWZP2IPIYAaZY0jxPkvfzrI6s+KSls8/srzA4jN1/+l NFb8bsybq69qAZaUcVfbiaqcVZTr238PUmUDgiazRUPgfrf1PXfJztBvHF+YzKjZ+GkA vq4xpt2tQ9gxoC+TAdrv+oig9rj7WAP5T77w1GdjpbkRG4X7u2sx6I00Np5hqNst53ct vt5dwNXASFt7wjyvbJsJKhYf4gtzCR+o1JGyDj4K5jY4Z41VPUL1gHN0M2LG2Khr2G+H Y2qgnMjFqCUGW/gmqH3AKTf2O4VszOLBvOsqVsFU4NRCvRlz9GQIyBnO9sftyd8epRLO LhCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=Z6McPc9kflWCggidt5K9wA+2OC2rwNv771RrmIGDbgA=; b=X8897jxLQIpWL8GADrU/sBS7QzTl6yy6w6D1iavztbaZ4lFCYTiZGy1WE9XvXcoFDD Krie4/7U9iFJSHkGUegZlxcNP4bI5Xx5LC6MNa/QHf004IKky8BRui/SF7sTKrTdSZLz 7tyQS5VfiyA7cuD3MgOMWSkU/zO1qeecv3LoQee5iylfzje4H6ivqaRicIubrrGTwRb8 fvleLCzLCqM2M6q5ToxoeoMJHdCc/kZOaHsWF0MVW7CCop5tCP4qcW9lq2IzgIZm+2UP FarxQt1+CfpvzlayKj4XH3lH+jURdn/BLi1mHYN782t8Z5/CUexbP1OHzhyGs8tRqXuj PkGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si1366960pfa.148.2018.04.27.07.27.06; Fri, 27 Apr 2018 07:27:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935194AbeD0OZ2 (ORCPT + 99 others); Fri, 27 Apr 2018 10:25:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:56452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934829AbeD0OLm (ORCPT ); Fri, 27 Apr 2018 10:11:42 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0CFF221897; Fri, 27 Apr 2018 14:11:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CFF221897 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiumei Mu , Cong Wang , Jorgen Hansen , Stefan Hajnoczi , "David S. Miller" Subject: [PATCH 4.16 54/81] VSOCK: make af_vsock.ko removable again Date: Fri, 27 Apr 2018 15:58:56 +0200 Message-Id: <20180427135746.445847070@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135743.216853156@linuxfoundation.org> References: <20180427135743.216853156@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Hajnoczi [ Upstream commit 05e489b1596f0aa1025a1fa572676631cd9665da ] Commit c1eef220c1760762753b602c382127bfccee226d ("vsock: always call vsock_init_tables()") introduced a module_init() function without a corresponding module_exit() function. Modules with an init function can only be removed if they also have an exit function. Therefore the vsock module was considered "permanent" and could not be removed. This patch adds an empty module_exit() function so that "rmmod vsock" works. No explicit cleanup is required because: 1. Transports call vsock_core_exit() upon exit and cannot be removed while sockets are still alive. 2. vsock_diag.ko does not perform any action that requires cleanup by vsock.ko. Fixes: c1eef220c176 ("vsock: always call vsock_init_tables()") Reported-by: Xiumei Mu Cc: Cong Wang Cc: Jorgen Hansen Signed-off-by: Stefan Hajnoczi Reviewed-by: Jorgen Hansen Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/vmw_vsock/af_vsock.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -2018,7 +2018,13 @@ const struct vsock_transport *vsock_core } EXPORT_SYMBOL_GPL(vsock_core_get_transport); +static void __exit vsock_exit(void) +{ + /* Do nothing. This function makes this module removable. */ +} + module_init(vsock_init_tables); +module_exit(vsock_exit); MODULE_AUTHOR("VMware, Inc."); MODULE_DESCRIPTION("VMware Virtual Socket Family");