• Paul E. McKenney's avatar
    rcutorture: Avoid fake-writer use of undefined primitives · eb033993
    Paul E. McKenney authored
    Currently the rcu_torture_fakewriter() function invokes cur_ops->sync()
    and cur_ops->exp_sync() without first checking to see if they are in
    fact non-NULL.  This results in kernel NULL pointer dereferences when
    testing RCU implementations that choose not to provide the full set of
    primitives.  Given that it is perfectly reasonable to have specialized
    RCU implementations that provide only a subset of the RCU API, this is
    a bug in rcutorture.
    
    This commit therefore makes rcu_torture_fakewriter() check function
    pointers before invoking them, thus allowing it to test subsetted
    RCU implementations.
    Reported-by: default avatarLihao Liang <lianglihao@huawei.com>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
    eb033993
rcutorture.c 54.2 KB