• Tetsuo Handa's avatar
    TOMOYO: Fix infinite loop bug when reading /sys/kernel/security/tomoyo/audit · c0fa797a
    Tetsuo Handa authored
    In tomoyo_flush(), head->r.w[0] holds pointer to string data to be printed.
    But head->r.w[0] was updated only when the string data was partially
    printed (because head->r.w[0] will be updated by head->r.w[1] later if
    completely printed). However, regarding /sys/kernel/security/tomoyo/query ,
    an additional '\0' is printed after the string data was completely printed.
    But if free space for read buffer became 0 before printing the additional '\0',
    tomoyo_flush() was returning without updating head->r.w[0]. As a result,
    tomoyo_flush() forever reprints already printed string data.
    Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Signed-off-by: default avatarJames Morris <jmorris@namei.org>
    c0fa797a
common.c 54.6 KB