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-prev] [day] [month] [year] [list]
Date:	Mon, 20 Jul 2009 10:32:01 +0530
From:	Jaswinder Singh Rajput <jaswinder@...nel.org>
To:	Catalin Marinas <catalin.marinas@....com>
Cc:	Takashi Iwai <tiwai@...e.de>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Sam Ravnborg <sam@...nborg.org>
Subject: Re: [PATCH] SOUND: OSS sequencer should be initialized after
 snd_seq_system_client_init

Hello Catalin,

On Sun, 2009-07-19 at 23:19 +0100, Catalin Marinas wrote:
> On Sun, 2009-07-19 at 21:58 +0530, Jaswinder Singh Rajput wrote:
> > [PATCH] SOUND: OSS sequencer should be initialized after snd_seq_system_client_init
> > 
> > When build SND_SEQUENCER in kernel then OSS sequencer(alsa_seq_oss_init)
> > is initialized before System (snd_seq_system_client_init) which leads to
> > memory leak :
> 
> Thanks for investigating this. I haven't looked at the code in detail
> but I find it a bit weird that initialisation order fixes the memory
> leak. Shouldn't the memory allocation logic change slightly to avoid the
> leak as well (that's in case someone manually inserts the modules in the
> wrong order)?
> 

No, you cannot change the order of modules because 
'insmod sound/core/seq/oss/snd-seq-oss.ko' need following symbols :

[  385.258252] snd_seq_oss: Unknown symbol snd_seq_kernel_client_enqueue
[  385.258435] snd_seq_oss: Unknown symbol snd_seq_set_queue_tempo
[  385.258639] snd_seq_oss: Unknown symbol snd_seq_delete_kernel_client
[  385.258751] snd_seq_oss: Unknown symbol snd_seq_autoload_lock
[  385.258871] snd_seq_oss: Unknown symbol snd_seq_kernel_client_dispatch
[  385.259782] snd_seq_oss: Unknown symbol snd_seq_kernel_client_enqueue_blocking
[  385.260191] snd_seq_oss: Unknown symbol snd_seq_autoload_unlock
[  385.260418] snd_seq_oss: Unknown symbol snd_seq_device_register_driver
[  385.260537] snd_seq_oss: Unknown symbol snd_midi_event_free
[  385.260701] snd_seq_oss: Unknown symbol snd_midi_event_no_status
[  385.260964] snd_seq_oss: Unknown symbol snd_use_lock_sync_helper
[  385.261469] snd_seq_oss: Unknown symbol snd_seq_device_unregister_driver
[  385.261659] snd_seq_oss: Unknown symbol snd_seq_event_port_detach
[  385.261768] snd_seq_oss: Unknown symbol snd_midi_event_new
[  385.261910] snd_seq_oss: Unknown symbol snd_midi_event_decode
[  385.262067] snd_seq_oss: Unknown symbol snd_seq_create_kernel_client
[  385.262233] snd_seq_oss: Unknown symbol snd_seq_kernel_client_write_poll
[  385.262432] snd_seq_oss: Unknown symbol snd_midi_event_encode_byte
[  385.262963] snd_seq_oss: Unknown symbol snd_seq_kernel_client_ctl

And we can get these symbols in this way :

1. insmod sound/core/seq/snd-seq-device.ko
[  385.258751] snd_seq_oss: Unknown symbol snd_seq_autoload_lock
[  385.260191] snd_seq_oss: Unknown symbol snd_seq_autoload_unlock
[  385.260418] snd_seq_oss: Unknown symbol snd_seq_device_register_driver
[  385.261469] snd_seq_oss: Unknown symbol snd_seq_device_unregister_driver

2. insmod sound/core/seq/snd-seq.ko
[  385.258252] snd_seq_oss: Unknown symbol snd_seq_kernel_client_enqueue
[  385.258435] snd_seq_oss: Unknown symbol snd_seq_set_queue_tempo
[  385.258639] snd_seq_oss: Unknown symbol snd_seq_delete_kernel_client
[  385.258871] snd_seq_oss: Unknown symbol snd_seq_kernel_client_dispatch
[  385.259782] snd_seq_oss: Unknown symbol snd_seq_kernel_client_enqueue_blocking
[  385.260964] snd_seq_oss: Unknown symbol snd_use_lock_sync_helper
[  385.261659] snd_seq_oss: Unknown symbol snd_seq_event_port_detach
[  385.262067] snd_seq_oss: Unknown symbol snd_seq_create_kernel_client
[  385.262233] snd_seq_oss: Unknown symbol snd_seq_kernel_client_write_poll
[  385.262963] snd_seq_oss: Unknown symbol snd_seq_kernel_client_ctl

3. insmod sound/core/seq/snd-seq-midi-event.ko
[  385.260701] snd_seq_oss: Unknown symbol snd_midi_event_no_status
[  385.260537] snd_seq_oss: Unknown symbol snd_midi_event_free
[  385.261768] snd_seq_oss: Unknown symbol snd_midi_event_new
[  385.261910] snd_seq_oss: Unknown symbol snd_midi_event_decode
[  385.262432] snd_seq_oss: Unknown symbol snd_midi_event_encode_byte

So the only order is :

1. insmod sound/core/seq/snd-seq-device.ko
2. insmod sound/core/seq/snd-seq.ko
3. insmod sound/core/seq/snd-seq-midi-event.ko
4. insmod sound/core/seq/oss/snd-seq-oss.ko

which is correct, if you change the order like we was getting in
build-in kernel, which leads to improper initialization and memory leak
was the side-effect.

Thanks,
--
JSR

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ