[kbuild] [kees:lsm/stacking 4/4] security/smack/smack_lsm.c:457 smack_sb_kern_mount() error: potentially dereferencing uninitialized 'isp'.

2014-09-03 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git 
lsm/stacking
head:   a1811bedacca7afc4f41741401eeaa003d22d6bb
commit: a1811bedacca7afc4f41741401eeaa003d22d6bb [4/4] LSM: Stop allocating 
inode-i_security

security/smack/smack_lsm.c:457 smack_sb_kern_mount() error: potentially 
dereferencing uninitialized 'isp'.

git remote add kees git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git remote update kees
git checkout a1811bedacca7afc4f41741401eeaa003d22d6bb
vim +/isp +457 security/smack/smack_lsm.c

24ea1b6e Casey Schaufler 2013-12-30  441 */
24ea1b6e Casey Schaufler 2013-12-30  442skp = smk_of_current();
24ea1b6e Casey Schaufler 2013-12-30  443sp-smk_root = 
skp-smk_known;
24ea1b6e Casey Schaufler 2013-12-30  444sp-smk_default = 
skp-smk_known;
24ea1b6e Casey Schaufler 2013-12-30  445}
e114e473 Casey Schaufler 2008-02-04  446/*
e114e473 Casey Schaufler 2008-02-04  447 * Initialize the root inode.
e114e473 Casey Schaufler 2008-02-04  448 */
a1811bed Casey Schaufler 2014-08-08  449if (!(inode-i_smack.smk_flags 
 SMK_INODE_ALLOCATED))
a1811bed Casey Schaufler 2014-08-08  450/*
a1811bed Casey Schaufler 2014-08-08  451 * Don't optimize this. 
The desired result is that flags be
a1811bed Casey Schaufler 2014-08-08  452 * cleared except for 
the ALLOCATED bit.
a1811bed Casey Schaufler 2014-08-08  453 */
a1811bed Casey Schaufler 2014-08-08  454
inode-i_smack.smk_flags = SMK_INODE_ALLOCATED;
e114e473 Casey Schaufler 2008-02-04  455  
e830b394 Casey Schaufler 2013-05-22  456if (transmute)
e830b394 Casey Schaufler 2013-05-22 @457isp-smk_flags |= 
SMK_INODE_TRANSMUTE;
e830b394 Casey Schaufler 2013-05-22  458  
e114e473 Casey Schaufler 2008-02-04  459return 0;
e114e473 Casey Schaufler 2008-02-04  460  }
e114e473 Casey Schaufler 2008-02-04  461  
e114e473 Casey Schaufler 2008-02-04  462  /**
e114e473 Casey Schaufler 2008-02-04  463   * smack_sb_statfs - Smack check on 
statfs
e114e473 Casey Schaufler 2008-02-04  464   * @dentry: identifies the file 
system in question
e114e473 Casey Schaufler 2008-02-04  465   *

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [sound-unstable:master 15036/15056] sound/core/pcm_native.c:806 snd_pcm_action_mutex() error: double unlock 'mutex:substream-self_group.mutex'

2014-09-03 Thread kbuild test robot
TO: Takashi Iwai ti...@suse.de

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable.git 
master
head:   33a8b5de23c78c47e2e0791118e836e75f3e175a
commit: 32f5bd4b2e7724019b2330358e0f0e05b2ed8e79 [15036/15056] ALSA: pcm: Allow 
nonatomic trigger operations
:: branch date: 2 hours ago
:: commit date: 2 days ago

New smatch warnings:
sound/core/pcm_native.c:806 snd_pcm_action_mutex() error: double unlock 
'mutex:substream-self_group.mutex'

Old smatch warnings:
sound/core/pcm_native.c:2506 snd_pcm_hwsync() warn: missing break? reassigning 
'err'
sound/core/pcm_native.c:2539 snd_pcm_delay() warn: missing break? reassigning 
'err'

git remote add sound-unstable 
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable.git
git remote update sound-unstable
git checkout 32f5bd4b2e7724019b2330358e0f0e05b2ed8e79
vim +806 sound/core/pcm_native.c

^1da177e Linus Torvalds 2005-04-16  790 if (res == 0)
^1da177e Linus Torvalds 2005-04-16  791 
ops-post_action(substream, state);
^1da177e Linus Torvalds 2005-04-16  792 else if (ops-undo_action)
^1da177e Linus Torvalds 2005-04-16  793 
ops-undo_action(substream, state);
^1da177e Linus Torvalds 2005-04-16  794 return res;
^1da177e Linus Torvalds 2005-04-16  795  }
^1da177e Linus Torvalds 2005-04-16  796  
32f5bd4b Takashi Iwai   2014-08-29  797  /* call in mutex-protected context */
32f5bd4b Takashi Iwai   2014-08-29  798  static int snd_pcm_action_mutex(struct 
action_ops *ops,
32f5bd4b Takashi Iwai   2014-08-29  799 struct 
snd_pcm_substream *substream,
32f5bd4b Takashi Iwai   2014-08-29  800 int 
state)
32f5bd4b Takashi Iwai   2014-08-29  801  {
32f5bd4b Takashi Iwai   2014-08-29  802 int res;
32f5bd4b Takashi Iwai   2014-08-29  803  
32f5bd4b Takashi Iwai   2014-08-29  804 if 
(snd_pcm_stream_linked(substream)) {
32f5bd4b Takashi Iwai   2014-08-29  805 if 
(!mutex_trylock(substream-self_group.mutex)) {
32f5bd4b Takashi Iwai   2014-08-29 @806 
mutex_unlock(substream-self_group.mutex);
32f5bd4b Takashi Iwai   2014-08-29  807 
mutex_lock(substream-group-mutex);
32f5bd4b Takashi Iwai   2014-08-29  808 
mutex_lock(substream-self_group.mutex);
32f5bd4b Takashi Iwai   2014-08-29  809 }
32f5bd4b Takashi Iwai   2014-08-29  810 res = 
snd_pcm_action_group(ops, substream, state, 1);
32f5bd4b Takashi Iwai   2014-08-29  811 
mutex_unlock(substream-group-mutex);
32f5bd4b Takashi Iwai   2014-08-29  812 } else {
32f5bd4b Takashi Iwai   2014-08-29  813 res = 
snd_pcm_action_single(ops, substream, state);
32f5bd4b Takashi Iwai   2014-08-29  814 }

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [sound-unstable:master 15036/15056] sound/core/pcm_native.c:806 snd_pcm_action_mutex() error: double unlock 'mutex:substream-self_group.mutex'

2014-09-03 Thread Dan Carpenter
[ It's not immediately clear to me that we intended to drop the lock if
  someone else is holding it.  If so maybe this should have a comment?
  -dan ]


tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable.git 
master
head:   33a8b5de23c78c47e2e0791118e836e75f3e175a
commit: 32f5bd4b2e7724019b2330358e0f0e05b2ed8e79 [15036/15056] ALSA: pcm: Allow 
nonatomic trigger operations

New smatch warnings:
sound/core/pcm_native.c:806 snd_pcm_action_mutex() error: double unlock 
'mutex:substream-self_group.mutex'

git remote add sound-unstable 
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable.git
git remote update sound-unstable
git checkout 32f5bd4b2e7724019b2330358e0f0e05b2ed8e79
vim +806 sound/core/pcm_native.c

^1da177e Linus Torvalds 2005-04-16  790 if (res == 0)
^1da177e Linus Torvalds 2005-04-16  791 
ops-post_action(substream, state);
^1da177e Linus Torvalds 2005-04-16  792 else if (ops-undo_action)
^1da177e Linus Torvalds 2005-04-16  793 
ops-undo_action(substream, state);
^1da177e Linus Torvalds 2005-04-16  794 return res;
^1da177e Linus Torvalds 2005-04-16  795  }
^1da177e Linus Torvalds 2005-04-16  796  
32f5bd4b Takashi Iwai   2014-08-29  797  /* call in mutex-protected context */
32f5bd4b Takashi Iwai   2014-08-29  798  static int snd_pcm_action_mutex(struct 
action_ops *ops,
32f5bd4b Takashi Iwai   2014-08-29  799 struct 
snd_pcm_substream *substream,
32f5bd4b Takashi Iwai   2014-08-29  800 int 
state)
32f5bd4b Takashi Iwai   2014-08-29  801  {
32f5bd4b Takashi Iwai   2014-08-29  802 int res;
32f5bd4b Takashi Iwai   2014-08-29  803  
32f5bd4b Takashi Iwai   2014-08-29  804 if 
(snd_pcm_stream_linked(substream)) {
32f5bd4b Takashi Iwai   2014-08-29  805 if 
(!mutex_trylock(substream-self_group.mutex)) {
32f5bd4b Takashi Iwai   2014-08-29 @806 
mutex_unlock(substream-self_group.mutex);
32f5bd4b Takashi Iwai   2014-08-29  807 
mutex_lock(substream-group-mutex);
32f5bd4b Takashi Iwai   2014-08-29  808 
mutex_lock(substream-self_group.mutex);
32f5bd4b Takashi Iwai   2014-08-29  809 }
32f5bd4b Takashi Iwai   2014-08-29  810 res = 
snd_pcm_action_group(ops, substream, state, 1);
32f5bd4b Takashi Iwai   2014-08-29  811 
mutex_unlock(substream-group-mutex);
32f5bd4b Takashi Iwai   2014-08-29  812 } else {
32f5bd4b Takashi Iwai   2014-08-29  813 res = 
snd_pcm_action_single(ops, substream, state);
32f5bd4b Takashi Iwai   2014-08-29  814 }

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild