From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932339AbWDGORM (ORCPT ); Fri, 7 Apr 2006 10:17:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932342AbWDGORM (ORCPT ); Fri, 7 Apr 2006 10:17:12 -0400 Received: from [151.97.230.9] ([151.97.230.9]:154 "EHLO ssc.unict.it") by vger.kernel.org with ESMTP id S932339AbWDGORL (ORCPT ); Fri, 7 Apr 2006 10:17:11 -0400 From: "Paolo 'Blaisorblade' Giarrusso" Subject: [PATCH] [RFC] [Oops fix] module support: record in vermagic ability to unload a module Date: Fri, 07 Apr 2006 16:16:16 +0200 To: Andrew Morton Cc: linux-kernel@vger.kernel.org Message-Id: <20060407141616.15173.53025.stgit@zion.home.lan> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org From: Paolo 'Blaisorblade' Giarrusso An UML user reported (against 2.6.13.3/UML) he got kernel Oopses when trying to rmmod (on a kernel with module unloading enabled) a module compiled with module unloading disabled. As crashing is a very correct thing to do in that case, a solution is altering the vermagic string to include this too. Possibly, however, the code should not crash in this case, even if the module didn't support unloading - it should simply abort the module removal. In this case, fixing that bug would be a better solution. I've not investigated though. Thanks to Hayim for reporting. Cc: Hayim Shaul Cc: Rusty Russell Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- include/linux/vermagic.h | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h index fadc535..dc7c621 100644 --- a/include/linux/vermagic.h +++ b/include/linux/vermagic.h @@ -12,6 +12,11 @@ #else #define MODULE_VERMAGIC_PREEMPT "" #endif +#ifdef CONFIG_MODULE_UNLOAD +#define MODULE_VERMAGIC_MODULE_UNLOAD "mod_unload " +#else +#define MODULE_VERMAGIC_MODULE_UNLOAD "" +#endif #ifndef MODULE_ARCH_VERMAGIC #define MODULE_ARCH_VERMAGIC "" #endif @@ -19,5 +24,5 @@ #define VERMAGIC_STRING \ UTS_RELEASE " " \ MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ - MODULE_ARCH_VERMAGIC \ + MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC \ "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)