include/linux/sched.h:2157:56: warning: 'noio_flag' may be used uninitialized in this function

From: kbuild test robot
Date: Sat Jan 23 2016 - 23:32:46 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 048ccca8c1c8f583deec3367d7df521bb1f542ae
commit: c6d308534aef6c99904bf5862066360ae067abc4 UBSAN: run-time undefined behavior sanity checker
date: 3 days ago
config: i386-randconfig-s0-01241136 (attached as .config)
reproduce:
git checkout c6d308534aef6c99904bf5862066360ae067abc4
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

In file included from arch/x86/include/asm/xor_32.h:544:0,
from arch/x86/include/asm/xor.h:491,
from crypto/xor.c:25:
include/asm-generic/xor.h: In function 'xor_32regs_p_5':
>> include/asm-generic/xor.h:678:1: warning: the frame size of 1604 bytes is larger than 1024 bytes [-Wframe-larger-than=]
}
^
include/asm-generic/xor.h: In function 'xor_32regs_p_4':
include/asm-generic/xor.h:599:1: warning: the frame size of 1340 bytes is larger than 1024 bytes [-Wframe-larger-than=]
}
^
include/asm-generic/xor.h: In function 'xor_32regs_p_3':
include/asm-generic/xor.h:531:1: warning: the frame size of 1068 bytes is larger than 1024 bytes [-Wframe-larger-than=]
}
^
include/asm-generic/xor.h: In function 'xor_8regs_p_5':
include/asm-generic/xor.h:429:1: warning: the frame size of 1604 bytes is larger than 1024 bytes [-Wframe-larger-than=]
}
^
include/asm-generic/xor.h: In function 'xor_8regs_p_4':
include/asm-generic/xor.h:392:1: warning: the frame size of 1340 bytes is larger than 1024 bytes [-Wframe-larger-than=]
}
^
include/asm-generic/xor.h: In function 'xor_8regs_p_3':
include/asm-generic/xor.h:358:1: warning: the frame size of 1068 bytes is larger than 1024 bytes [-Wframe-larger-than=]
}
^
--
In file included from include/linux/blkdev.h:4:0,
from drivers/md/dm-bufio.h:12,
from drivers/md/dm-bufio.c:9:
drivers/md/dm-bufio.c: In function 'alloc_buffer':
>> include/linux/sched.h:2157:56: warning: 'noio_flag' may be used uninitialized in this function [-Wmaybe-uninitialized]
current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags;
^
drivers/md/dm-bufio.c:389:11: note: 'noio_flag' was declared here
unsigned noio_flag;
^

vim +/noio_flag +2157 include/linux/sched.h

21caf2fc Ming Lei 2013-02-22 2141 static inline gfp_t memalloc_noio_flags(gfp_t flags)
21caf2fc Ming Lei 2013-02-22 2142 {
21caf2fc Ming Lei 2013-02-22 2143 if (unlikely(current->flags & PF_MEMALLOC_NOIO))
934f3072 Junxiao Bi 2014-10-09 2144 flags &= ~(__GFP_IO | __GFP_FS);
21caf2fc Ming Lei 2013-02-22 2145 return flags;
21caf2fc Ming Lei 2013-02-22 2146 }
21caf2fc Ming Lei 2013-02-22 2147
21caf2fc Ming Lei 2013-02-22 2148 static inline unsigned int memalloc_noio_save(void)
21caf2fc Ming Lei 2013-02-22 2149 {
21caf2fc Ming Lei 2013-02-22 2150 unsigned int flags = current->flags & PF_MEMALLOC_NOIO;
21caf2fc Ming Lei 2013-02-22 2151 current->flags |= PF_MEMALLOC_NOIO;
21caf2fc Ming Lei 2013-02-22 2152 return flags;
21caf2fc Ming Lei 2013-02-22 2153 }
21caf2fc Ming Lei 2013-02-22 2154
21caf2fc Ming Lei 2013-02-22 2155 static inline void memalloc_noio_restore(unsigned int flags)
21caf2fc Ming Lei 2013-02-22 2156 {
21caf2fc Ming Lei 2013-02-22 @2157 current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags;
21caf2fc Ming Lei 2013-02-22 2158 }
21caf2fc Ming Lei 2013-02-22 2159
1d4457f9 Kees Cook 2014-05-21 2160 /* Per-process atomic flags. */
a2b86f77 Zefan Li 2014-09-25 2161 #define PFA_NO_NEW_PRIVS 0 /* May not gain new privileges. */
2ad654bc Zefan Li 2014-09-25 2162 #define PFA_SPREAD_PAGE 1 /* Spread page cache over cpuset */
2ad654bc Zefan Li 2014-09-25 2163 #define PFA_SPREAD_SLAB 2 /* Spread some slab caches over cpuset */
2ad654bc Zefan Li 2014-09-25 2164
1d4457f9 Kees Cook 2014-05-21 2165

:::::: The code at line 2157 was first introduced by commit
:::::: 21caf2fc1931b485483ddd254b634fa8f0099963 mm: teach mm by current context info to not do I/O during memory allocation

:::::: TO: Ming Lei <ming.lei@xxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: Binary data