- 15 Jan, 2016 1 commit
-
-
Takashi Iwai authored
A slave timer instance might be still accessible in a racy way while operating the master instance as it lacks of locking. Since the master operation is mostly protected with timer->lock, we should cope with it while changing the slave instance, too. Also, some linked lists (active_list and ack_list) of slave instances aren't unlinked immediately at stopping or closing, and this may lead to unexpected accesses. This patch tries to address these issues. It adds spin lock of timer->lock (either from master or slave, which is equivalent) in a few places. For avoiding a deadlock, we ensure that the global slave_active_lock is always locked at first before each timer lock. Also, ack and active_list of slave instances are properly unlinked at snd_timer_stop() and snd_timer_close(). Last but not least, remove the superfluous call of _snd_timer_stop() at removing slave links. This is a noop, and calling it may confuse readers wrt locking. Further cleanup will follow in a later patch. Actually we've got reports of use-after-free by syzkaller fuzzer, and this hopefully fixes these issues. Reported-by:
Dmitry Vyukov <dvyukov@google.com> Cc: <stable@vger.kernel.org> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 14 Jan, 2016 1 commit
-
-
Takashi Iwai authored
ALSA timer ioctls have an open race and this may lead to a use-after-free of timer instance object. A simplistic fix is to make each ioctl exclusive. We have already tread_sem for controlling the tread, and extend this as a global mutex to be applied to each ioctl. The downside is, of course, the worse concurrency. But these ioctls aren't to be parallel accessible, in anyway, so it should be fine to serialize there. Reported-by:
Dmitry Vyukov <dvyukov@google.com> Tested-by:
Dmitry Vyukov <dvyukov@google.com> Cc: <stable@vger.kernel.org> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 13 Jan, 2016 1 commit
-
-
Takashi Iwai authored
ALSA timer instance object has a couple of linked lists and they are unlinked unconditionally at snd_timer_stop(). Meanwhile snd_timer_interrupt() unlinks it, but it calls list_del() which leaves the element list itself unchanged. This ends up with unlinking twice, and it was caught by syzkaller fuzzer. The fix is to use list_del_init() variant properly there, too. Reported-by:
Dmitry Vyukov <dvyukov@google.com> Tested-by:
Dmitry Vyukov <dvyukov@google.com> Cc: <stable@vger.kernel.org> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 27 May, 2015 1 commit
-
-
Jie Yang authored
We may disable proc fs only for sound part, to reduce ALSA memory footprint. So add CONFIG_SND_PROC_FS and replace the old CONFIG_PROC_FSs in alsa code. With sound proc fs disabled, we can save about 9KB memory size on X86_64 platform. Signed-off-by:
Jie Yang <yang.jie@intel.com> Reviewed-by:
Mark Brown <broonie@kernel.org> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 10 Mar, 2015 1 commit
-
-
Takashi Iwai authored
The kernel memory allocators already report the errors when the requested allocation fails, thus we don't need to warn it again in each caller side. Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 02 Feb, 2015 3 commits
-
-
Takashi Iwai authored
Now that all callers have been replaced with snd_device_register_for_dev(), let's drop the obsolete device registration code and concentrate only on the code handling struct device directly. That said, - remove the old snd_device_register(), - rename snd_device_register_for_dev() with snd_device_register(), - drop superfluous arguments from snd_device_register(), - change snd_unregister_device() to pass the device pointer directly Reviewed-by:
Jaroslav Kysela <perex@perex.cz> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
Takashi Iwai authored
This is a relatively straightforward change, using the struct device directly for managing the ALSA timer device. Reviewed-by:
Jaroslav Kysela <perex@perex.cz> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
Takashi Iwai authored
... instead of just printing errors. Reviewed-by:
Jaroslav Kysela <perex@perex.cz> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 19 Jan, 2015 1 commit
-
-
Takashi Iwai authored
No functional change, refactoring with the standard helpers. Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 12 Jun, 2014 1 commit
-
-
Thomas Gleixner authored
do_posix_clock_monotonic_gettime() is a leftover from the initial posix timer implementation which maps to ktime_get_ts(). Signed-off-by:
Thomas Gleixner <tglx@linutronix.de> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 14 Feb, 2014 1 commit
-
-
Takashi Iwai authored
Use the standard pr_xxx() helpers instead of home-baked snd_print*(). Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 10 Feb, 2014 1 commit
-
-
Takashi Iwai authored
Replace the lengthy #if defined(XXX) || defined(XXX_MODULE) with the new IS_ENABLED() macro. The patch still doesn't cover all ifdefs. For example, the dependency on CONFIG_GAMEPORT is still open-coded because this also has an extra dependency on MODULE. Similarly, an open-coded ifdef in pcm_oss.c and some sequencer-related stuff are left untouched. Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 11 Mar, 2012 1 commit
-
-
Paul Gortmaker authored
For files that are actively using linux/device.h, make sure that they call it out. This will allow us to clean up some of the implicit uses of linux/device.h within include/* without introducing build regressions. Yes, this was created by "cheating" -- i.e. the headers were cleaned up, and then the fallout was found and fixed, and then the two commits were reordered. This ensures we don't introduce build regressions into the git history. Signed-off-by:
Paul Gortmaker <paul.gortmaker@windriver.com>
-
- 31 Oct, 2011 1 commit
-
-
Paul Gortmaker authored
The implicit presence of module.h lured several users into incorrectly thinking that they only needed/used modparam.h but once we clean up the module.h presence, these will show up as build failures, so fix 'em now. Signed-off-by:
Paul Gortmaker <paul.gortmaker@windriver.com>
-
- 08 Aug, 2011 2 commits
-
-
Takashi Iwai authored
Just to be sure. Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
Takashi Iwai authored
A slave-timer instance has no timer reference, and this results in NULL-dereference at stopping the timer, typically called at closing the device. Reference: https://bugzilla.kernel.org/show_bug.cgi?id=40682 Cc: <stable@kernel.org> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 16 Mar, 2011 1 commit
-
-
Nicolas Kaiser authored
Merge list_del() + list_add_tail() to list_move_tail(). Signed-off-by:
Nicolas Kaiser <nikai@nikai.net> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 24 Nov, 2010 1 commit
-
-
Kay Sievers authored
If CONFIG_SND_DYNAMIC_MINORS is used, assign /dev/snd/seq and /dev/snd/timer the usual static minors, and export specific module aliases to generate udev module on-demand loading instructions: $ cat /lib/modules/2.6.33.4-smp/modules.devname # Device nodes to trigger on-demand module loading. microcode cpu/microcode c10:184 fuse fuse c10:229 ppp_generic ppp c108:0 tun net/tun c10:200 uinput uinput c10:223 dm_mod mapper/control c10:236 snd_timer snd/timer c116:33 snd_seq snd/seq c116:1 The last two lines instruct udev to create device nodes, even when the modules are not loaded at that time. As soon as userspace accesses any of these nodes, the in-kernel module-loader will load the module, and the device can be used. The header file minor calculation needed to be simplified to make __stringify() (supports only two indirections) in the MODULE_ALIAS macro work. This is part of systemd's effort to get rid of unconditional module load instructions and needless init scripts. Cc: Lennart Poettering <lennart@poettering.net> Signed-off-by:
Kay Sievers <kay.sievers@vrfy.org> Signed-off-by:
Clemens Ladisch <clemens@ladisch.de> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 22 Nov, 2010 1 commit
-
-
Clemens Ladisch authored
Increase the default timer limit so that snd-hrtimer.ko can be automatically loaded when needed, e.g., when used as the default sequencer timer. This replaces the check for the obsolete CONFIG_SND_HPET. Signed-off-by:
Clemens Ladisch <clemens@ladisch.de> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 05 May, 2010 1 commit
-
-
Dan Carpenter authored
We should disable irqs when we take the tu->qlock because it is used in the irq handler. The only place that doesn't is snd_timer_user_ccallback(). Most of the time snd_timer_user_ccallback() is called with interrupts disabled but the the first ti->ccallback() call in snd_timer_notify1() has interrupts enabled. This was caught by lockdep which generates the following message: > ================================= > [ INFO: inconsistent lock state ] > 2.6.34-rc5 #5 > --------------------------------- > inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. > dolphin/4003 [HC1[1]:SC0[0]:HE0:SE1] takes: > (&(&tu->qlock)->rlock){?.+...}, at: [<f84ec472>] snd_timer_user_tinterrupt+0x28/0x132 [snd_timer] > {HARDIRQ-ON-W} state was registered at: > [<c1048de9>] __lock_acquire+0x654/0x1482 > [<c1049c73>] lock_acquire+0x5c/0x73 > [<c125ac3e>] _raw_spin_lock+0x25/0x34 > [<f84ec370>] snd_timer_user_ccallback+0x55/0x95 [snd_timer] > [<f84ecc4b>] snd_timer_notify1+0x53/0xca [snd_timer] Reported-by:
Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by:
Dan Carpenter <error27@gmail.com> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 13 Apr, 2010 1 commit
-
-
Takashi Iwai authored
Set no_llseek to llseek file ops of each sound component (but for hwdep). This avoids the implicit BKL invocation via generic_file_llseek() used as default when fops.llseek is NULL. Also call nonseekable_open() at each open ops to ensure the file flags have no seek bit. Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 03 Mar, 2010 1 commit
-
-
Jaroslav Kysela authored
Do not use hardcoded SNDRV_TIMER_EVENT_START value. Signed-off-by:
Jaroslav Kysela <perex@perex.cz> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 14 Apr, 2009 1 commit
-
-
Li Zefan authored
Remove open-coded memdup_user(). Signed-off-by:
Li Zefan <lizf@cn.fujitsu.com> Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 16 Mar, 2009 1 commit
-
-
Jonathan Corbet authored
Most fasync implementations do something like: return fasync_helper(...); But fasync_helper() will return a positive value at times - a feature used in at least one place. Thus, a number of other drivers do: err = fasync_helper(...); if (err < 0) return err; return 0; In the interests of consistency and more concise code, it makes sense to map positive return values onto zero where ->fasync() is called. Cc: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by:
Jonathan Corbet <corbet@lwn.net>
-
- 18 Dec, 2008 1 commit
-
-
Takashi Iwai authored
Replace all tasklet_hi_schedule() callers with the normal tasklet_schedule(). The former often causes troubles with RT-kernels, and has actually no merit. Signed-off-by:
Takashi Iwai <tiwai@suse.de>
-
- 01 Nov, 2008 1 commit
-
-
Al Viro authored
As it is, all instances of ->release() for files that have ->fasync() need to remember to evict file from fasync lists; forgetting that creates a hole and we actually have a bunch that *does* forget. So let's keep our lives simple - let __fput() check FASYNC in file->f_flags and call ->fasync() there if it's been set. And lose that crap in ->release() instances - leaving it there is still valid, but we don't have to bother anymore. Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 15 Aug, 2008 1 commit
-
-
Takashi Iwai authored
Signed-off-by:
Takashi Iwai <tiwai@suse.de> Signed-off-by:
Jaroslav Kysela <perex@perex.cz>
-
- 13 Aug, 2008 1 commit
-
-
Takashi Iwai authored
Kill snd_assert() in sound/core/*, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by:
Takashi Iwai <tiwai@suse.de> Signed-off-by:
Jaroslav Kysela <perex@perex.cz>
-
- 10 Jul, 2008 1 commit
-
-
Johannes Berg authored
A bunch of things in alsa depend on CONFIG_KMOD, use CONFIG_MODULES instead where the dependency is needed at all. Signed-off-by:
Johannes Berg <johannes@sipsolutions.net> Signed-off-by:
Takashi Iwai <tiwai@suse.de> Signed-off-by:
Jaroslav Kysela <perex@perex.cz>
-
- 15 Feb, 2008 1 commit
-
-
Jan Blunck authored
The sound drivers and the pnpbios core test for current->root != NULL. This test seems to be unnecessary since we always have rootfs mounted before initializing the drivers. Signed-off-by:
Jan Blunck <jblunck@suse.de> Acked-by:
Christoph Hellwig <hch@lst.de> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Jaroslav Kysela <perex@suse.cz> Acked-by:
Takashi Iwai <tiwai@suse.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 31 Jan, 2008 2 commits
-
-
Takashi Iwai authored
This header file exists only for some hacks to adapt alsa-driver tree. It's useless for building in the kernel. Let's move a few lines in it to sound/core.h and remove it. With this patch, sound/driver.h isn't removed but has just a single compile warning to include it. This should be really killed in future. Signed-off-by:
Takashi Iwai <tiwai@suse.de> Signed-off-by:
Jaroslav Kysela <perex@perex.cz>
-
Jaroslav Kysela authored
We need an accurate and continuous (monotonic) time sources to do accurate synchronization among more timing sources. This patch allows to enable monotonic timestamps for ALSA PCM devices and enables monotonic timestamps for ALSA timer devices. Signed-off-by:
Jaroslav Kysela <perex@perex.cz>
-
- 16 Oct, 2007 1 commit
-
-
Jaroslav Kysela authored
Signed-off-by:
Jaroslav Kysela <perex@perex.cz>
-
- 20 Jul, 2007 1 commit
-
-
Clemens Ladisch authored
Convert the snd_assert()s to simple if()s to prevent crashes when one of the timer instance ioctls is called before the file is bound to a timer device. Signed-off-by:
Clemens Ladisch <clemens@ladisch.de> Signed-off-by:
Jaroslav Kysela <perex@suse.cz>
-
- 08 May, 2007 1 commit
-
-
Randy Dunlap authored
Remove includes of <linux/smp_lock.h> where it is not used/needed. Suggested by Al Viro. Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc, sparc64, and arm (all 59 defconfigs). Signed-off-by:
Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 12 Feb, 2007 1 commit
-
-
Arjan van de Ven authored
Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by:
Arjan van de Ven <arjan@linux.intel.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 09 Feb, 2007 2 commits
-
-
Robert P. J. Day authored
Remove the final useless reference to the obsolete KERNELD feature. Signed-off-by:
Robert P. J. Day <rpjday@mindspring.com> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Takashi Iwai <tiwai@suse.de> Signed-off-by:
Jaroslav Kysela <perex@suse.cz>
-
Johannes Berg authored
This patch converts most uses of list_for_each to list_for_each_entry all across alsa. In some place apparently an item can be on a list with different pointers so of course that isn't compatible with list_for_each, I therefore didn't touch those places. Signed-off-by:
Johannes Berg <johannes@sipsolutions.net> Signed-off-by:
Takashi Iwai <tiwai@suse.de> Signed-off-by:
Jaroslav Kysela <perex@suse.cz>
-
- 23 Sep, 2006 2 commits
-
-
Clemens Ladisch authored
Remove the snd_timer_system_private structure's timer field that was never used. Signed-off-by:
Clemens Ladisch <clemens@ladisch.de> Signed-off-by:
Jaroslav Kysela <perex@suse.cz>
-
Clemens Ladisch authored
When checking whether a hardware timer needs to be rescheduled, we have to compare against the previously scheduled interval and not against the actual interval between the last two interrupts. Signed-off-by:
Clemens Ladisch <clemens@ladisch.de> Signed-off-by:
Jaroslav Kysela <perex@suse.cz>
-