Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
K
kernel
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Commits
  • phytec
  • vm016-mx8m
  • kernel
  • Repository

Switch branch/tag
  • kernel
  • lib
  • bitmap.c
Find file
BlameHistoryPermalink
  • Yury Norov's avatar
    lib: fix stall in __bitmap_parselist() · a333a284
    Yury Norov authored Apr 05, 2018
    commit 8351760f upstream.
    
    syzbot is catching stalls at __bitmap_parselist()
    (https://syzkaller.appspot.com/bug?id=ad7e0351fbc90535558514a71cd3edc11681997a).
    The trigger is
    
      unsigned long v = 0;
      bitmap_parselist("7:,", &v, BITS_PER_LONG);
    
    which results in hitting infinite loop at
    
        while (a <= b) {
    	    off = min(b - a + 1, used_size);
    	    bitmap_set(maskp, a, off);
    	    a += group_size;
        }
    
    due to used_size == group_size == 0.
    
    Link: http://lkml.kernel.org/r/20180404162647.15763-1-ynorov@caviumnetworks.com
    Fixes: 0a5ce083 ("lib/bitmap.c: make bitmap_parselist() thread-safe and much faster")
    Signed-off-by: default avatarYury Norov <ynorov@caviumnetworks.com>
    Reported-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Reported-by: default avatarsyzbot <syzbot+6887cbb011c8054e8a3d@syzkaller.appspotmail.com>
    Cc: Noam Camus <noamca@mellanox.com>
    Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
    Cc: Matthew Wilcox <mawilcox@microsoft.com>
    Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    a333a284
bitmap.c 36.4 KB
EditWeb IDE

Replace bitmap.c

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.