lkml.org 
[lkml]   [2019]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 241/243] vcs: prevent write access to vcsu devices
    Date
    From: Nicolas Pitre <nico@fluxnic.net>

    commit 0c9acb1af77a3cb8707e43f45b72c95266903cee upstream.

    Commit d21b0be246bf ("vt: introduce unicode mode for /dev/vcs") guarded
    against using devices containing attributes as this is not yet
    implemented. It however failed to guard against writes to any devices
    as this is also unimplemented.

    Reported-by: Or Cohen <orcohen@paloaltonetworks.com>
    Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
    Cc: <stable@vger.kernel.org> # v4.19+
    Cc: Jiri Slaby <jslaby@suse.com>
    Fixes: d21b0be246bf ("vt: introduce unicode mode for /dev/vcs")
    Link: https://lore.kernel.org/r/nycvar.YSQ.7.76.1911051030580.30289@knanqh.ubzr
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/tty/vt/vc_screen.c | 3 +++
    1 file changed, 3 insertions(+)

    --- a/drivers/tty/vt/vc_screen.c
    +++ b/drivers/tty/vt/vc_screen.c
    @@ -437,6 +437,9 @@ vcs_write(struct file *file, const char
    size_t ret;
    char *con_buf;

    + if (use_unicode(inode))
    + return -EOPNOTSUPP;
    +
    con_buf = (char *) __get_free_page(GFP_KERNEL);
    if (!con_buf)
    return -ENOMEM;

    \
     
     \ /
      Last update: 2019-12-11 16:48    [W:4.042 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site