Skip to content
Snippets Groups Projects
  • Breno Leitao's avatar
    68af44a7
    ima: kexec: silence RCU list traversal warning · 68af44a7
    Breno Leitao authored
    
    The ima_measurements list is append-only and doesn't require
    rcu_read_lock() protection. However, lockdep issues a warning when
    traversing RCU lists without the read lock:
    
      security/integrity/ima/ima_kexec.c:40 RCU-list traversed in non-reader section!!
    
    Fix this by using the variant of list_for_each_entry_rcu() with the last
    argument set to true. This tells the RCU subsystem that traversing this
    append-only list without the read lock is intentional and safe.
    
    This change silences the lockdep warning while maintaining the correct
    semantics for the append-only list traversal.
    
    Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
    Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
    68af44a7
    History
    ima: kexec: silence RCU list traversal warning
    Breno Leitao authored
    
    The ima_measurements list is append-only and doesn't require
    rcu_read_lock() protection. However, lockdep issues a warning when
    traversing RCU lists without the read lock:
    
      security/integrity/ima/ima_kexec.c:40 RCU-list traversed in non-reader section!!
    
    Fix this by using the variant of list_for_each_entry_rcu() with the last
    argument set to true. This tells the RCU subsystem that traversing this
    append-only list without the read lock is intentional and safe.
    
    This change silences the lockdep warning while maintaining the correct
    semantics for the append-only list traversal.
    
    Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
    Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>