1. 28 3月, 2021 1 次提交
  2. 23 3月, 2021 2 次提交
  3. 09 2月, 2021 1 次提交
  4. 28 1月, 2021 1 次提交
  5. 07 1月, 2021 6 次提交
  6. 09 12月, 2020 1 次提交
  7. 12 11月, 2020 3 次提交
  8. 09 11月, 2020 1 次提交
    • D
      vt: Disable KD_FONT_OP_COPY · 3c4e0dff
      Daniel Vetter 提交于
      It's buggy:
      
      On Fri, Nov 06, 2020 at 10:30:08PM +0800, Minh Yuan wrote:
      > We recently discovered a slab-out-of-bounds read in fbcon in the latest
      > kernel ( v5.10-rc2 for now ).  The root cause of this vulnerability is that
      > "fbcon_do_set_font" did not handle "vc->vc_font.data" and
      > "vc->vc_font.height" correctly, and the patch
      > <https://lkml.org/lkml/2020/9/27/223> for VT_RESIZEX can't handle this
      > issue.
      >
      > Specifically, we use KD_FONT_OP_SET to set a small font.data for tty6, and
      > use  KD_FONT_OP_SET again to set a large font.height for tty1. After that,
      > we use KD_FONT_OP_COPY to assign tty6's vc_font.data to tty1's vc_font.data
      > in "fbcon_do_set_font", while tty1 retains the original larger
      > height. Obviously, this will cause an out-of-bounds read, because we can
      > access a smaller vc_font.data with a larger vc_font.height.
      
      Further there was only one user ever.
      - Android's loadfont, busybox and console-tools only ever use OP_GET
        and OP_SET
      - fbset documentation only mentions the kernel cmdline font: option,
        not anything else.
      - systemd used OP_COPY before release 232 published in Nov 2016
      
      Now unfortunately the crucial report seems to have gone down with
      gmane, and the commit message doesn't say much. But the pull request
      hints at OP_COPY being broken
      
      https://github.com/systemd/systemd/pull/3651
      
      So in other words, this never worked, and the only project which
      foolishly every tried to use it, realized that rather quickly too.
      
      Instead of trying to fix security issues here on dead code by adding
      missing checks, fix the entire thing by removing the functionality.
      
      Note that systemd code using the OP_COPY function ignored the return
      value, so it doesn't matter what we're doing here really - just in
      case a lone server somewhere happens to be extremely unlucky and
      running an affected old version of systemd. The relevant code from
      font_copy_to_all_vcs() in systemd was:
      
      	/* copy font from active VT, where the font was uploaded to */
      	cfo.op = KD_FONT_OP_COPY;
      	cfo.height = vcs.v_active-1; /* tty1 == index 0 */
      	(void) ioctl(vcfd, KDFONTOP, &cfo);
      
      Note this just disables the ioctl, garbage collecting the now unused
      callbacks is left for -next.
      
      v2: Tetsuo found the old mail, which allowed me to find it on another
      archive. Add the link too.
      Acked-by: NPeilin Ye <yepeilin.cs@gmail.com>
      Reported-by: NMinh Yuan <yuanmingbuaa@gmail.com>
      References: https://lists.freedesktop.org/archives/systemd-devel/2016-June/036935.html
      References: https://github.com/systemd/systemd/pull/3651
      Cc: Greg KH <greg@kroah.com>
      Cc: Peilin Ye <yepeilin.cs@gmail.com>
      Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://lore.kernel.org/r/20201108153806.3140315-1-daniel.vetter@ffwll.chSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3c4e0dff
  9. 06 11月, 2020 1 次提交
  10. 04 11月, 2020 15 次提交
  11. 03 11月, 2020 1 次提交
  12. 28 10月, 2020 3 次提交
  13. 27 9月, 2020 1 次提交
  14. 25 8月, 2020 1 次提交
    • J
      Revert "vc_screen: extract vcs_read_buf_header" · 52c3c3a5
      Jiri Slaby 提交于
      This reverts commit b1c32fcf, because
      Syzkaller reports a use-after-free, a write in vcs_read:
      
      BUG: KASAN: use-after-free in vcs_read_buf drivers/tty/vt/vc_screen.c:357 [inline]
      BUG: KASAN: use-after-free in vcs_read+0xaa7/0xb40 drivers/tty/vt/vc_screen.c:449
      Write of size 2 at addr ffff8880a8014000 by task syz-executor.5/16936
      CPU: 1 PID: 16936 Comm: syz-executor.5 Not tainted 5.9.0-rc1-next-20200820-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
      ...
       kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
       vcs_read_buf drivers/tty/vt/vc_screen.c:357 [inline]
       vcs_read+0xaa7/0xb40 drivers/tty/vt/vc_screen.c:449
      
      There are two issues with the patch:
      1) vcs_read rounds the 'count' *up* to an even number. So if we read odd
         bytes from the header (3 bytes in the reproducer), the second byte of
         a (2-byte/ushort) write to temporary con_buf won't fit. It is because
         with the patch applied, we only subtract the real number read (3 bytes)
         and not the whole header (4 bytes).
      
      2) in this scenario, we perform unaligned accesses now: there are
         2-byte/ushort writes to odd addresses. Due to the same reason as
         above.
      
      Revert this for now, re-think and retry later.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Reported-by: syzbot+ad1f53726c3bd11180cb@syzkaller.appspotmail.com
      Fixes: b1c32fcf ("vc_screen: extract vcs_read_buf_header")
      Cc: akpm@linux-foundation.org
      Cc: nico@fluxnic.net
      Link: https://lore.kernel.org/r/20200824095425.4376-1-jslaby@suse.czSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      52c3c3a5
  15. 24 8月, 2020 1 次提交
  16. 18 8月, 2020 1 次提交