lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 17 Nov 2021 22:21:46 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     linux-kernel@...r.kernel.org
Cc:     Randy Dunlap <rdunlap@...radead.org>,
        kernel test robot <lkp@...el.com>,
        Arnd Bergmann <arnd@...db.de>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org
Subject: [PATCH] sound/oss/dmasound: fix build when some drivers are =m and others are =y

When CONFIG_DMASOUND_ATARI=y and CONFIG_DMASOUND_Q40=m,
dmasound_atari.o is built first (listed first in the Makefile),
so dmasound_core.o is built as builtin, not for use by loadable
modules. Then dmasound_q40.o is built and linked with the
already-built dmasound_core.o, but the latter does not support
use by loadable modules. This causes the missing symbol to be
undefined.

Fixes this build error:
ERROR: modpost: "dmasound_deinit" [sound/oss/dmasound/dmasound_q40.ko] undefined!

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") # "forever"
Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
Reported-by: kernel test robot <lkp@...el.com>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Jaroslav Kysela <perex@...ex.cz>
Cc: Takashi Iwai <tiwai@...e.com>
Cc: alsa-devel@...a-project.org
---
There may be some Makefile solution to this but I don't know what
it is. I didn't want to spend lots of time on these old drivers.

 sound/oss/dmasound/Makefile         |    6 +++---
 sound/oss/dmasound/dmasound_atari.c |    2 +-
 sound/oss/dmasound/dmasound_core.c  |   16 ----------------
 sound/oss/dmasound/dmasound_paula.c |    2 +-
 sound/oss/dmasound/dmasound_q40.c   |    2 +-
 5 files changed, 6 insertions(+), 22 deletions(-)

--- linux-next-20211117.orig/sound/oss/dmasound/dmasound_atari.c
+++ linux-next-20211117/sound/oss/dmasound/dmasound_atari.c
@@ -27,7 +27,7 @@
 #include <asm/atariints.h>
 #include <asm/atari_stram.h>
 
-#include "dmasound.h"
+#include "dmasound_core.c"
 
 #define DMASOUND_ATARI_REVISION 0
 #define DMASOUND_ATARI_EDITION 3
--- linux-next-20211117.orig/sound/oss/dmasound/dmasound_paula.c
+++ linux-next-20211117/sound/oss/dmasound/dmasound_paula.c
@@ -30,7 +30,7 @@
 #include <asm/amigaints.h>
 #include <asm/machdep.h>
 
-#include "dmasound.h"
+#include "dmasound_core.c"
 
 #define DMASOUND_PAULA_REVISION 0
 #define DMASOUND_PAULA_EDITION 4
--- linux-next-20211117.orig/sound/oss/dmasound/dmasound_q40.c
+++ linux-next-20211117/sound/oss/dmasound/dmasound_q40.c
@@ -25,7 +25,7 @@
 #include <asm/q40ints.h>
 #include <asm/q40_master.h>
 
-#include "dmasound.h"
+#include "dmasound_core.c"
 
 #define DMASOUND_Q40_REVISION 0
 #define DMASOUND_Q40_EDITION 3
--- linux-next-20211117.orig/sound/oss/dmasound/Makefile
+++ linux-next-20211117/sound/oss/dmasound/Makefile
@@ -3,6 +3,6 @@
 # Makefile for the DMA sound driver
 #
 
-obj-$(CONFIG_DMASOUND_ATARI)	+= dmasound_core.o dmasound_atari.o
-obj-$(CONFIG_DMASOUND_PAULA)	+= dmasound_core.o dmasound_paula.o
-obj-$(CONFIG_DMASOUND_Q40)	+= dmasound_core.o dmasound_q40.o
+obj-$(CONFIG_DMASOUND_ATARI)	+= dmasound_atari.o
+obj-$(CONFIG_DMASOUND_PAULA)	+= dmasound_paula.o
+obj-$(CONFIG_DMASOUND_Q40)	+= dmasound_q40.o
--- linux-next-20211117.orig/sound/oss/dmasound/dmasound_core.c
+++ linux-next-20211117/sound/oss/dmasound/dmasound_core.c
@@ -1570,19 +1570,3 @@ char dmasound_alaw2dma8[] = {
 	3,	3,	3,	3,	3,	3,	3,	3
 };
 #endif /* HAS_8BIT_TABLES */
-
-    /*
-     *  Visible symbols for modules
-     */
-
-EXPORT_SYMBOL(dmasound);
-EXPORT_SYMBOL(dmasound_init);
-#ifdef MODULE
-EXPORT_SYMBOL(dmasound_deinit);
-#endif
-EXPORT_SYMBOL(dmasound_write_sq);
-EXPORT_SYMBOL(dmasound_catchRadius);
-#ifdef HAS_8BIT_TABLES
-EXPORT_SYMBOL(dmasound_ulaw2dma8);
-EXPORT_SYMBOL(dmasound_alaw2dma8);
-#endif

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ