• Olaf Dabrunz's avatar
    [PATCH] TIOCCONS security · d05dd6d0
    Olaf Dabrunz authored
    The ioctl TIOCCONS allows any user to redirect console output to another
    tty.  This allows anyone to suppress messages to the console at will.
    
    AFAIK nowadays not many programs write to /dev/console, except for start
    scripts and the kernel (printk() above console log level).
    
    Still, I believe that administrators and operators would not like any user
    to be able to hijack messages that were written to the console.
    
    The only user of TIOCCONS that I am aware of is bootlogd/blogd, which runs
    as root.  Please comment if there are other users.
    
    Is there any reason why normal users should be able to use TIOCCONS?
    
    Otherwise I would suggest to restrict access to root (CAP_SYS_ADMIN), e.g. 
    with this patch.
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    d05dd6d0
tty_io.c 73 KB