Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp753098imm; Sat, 8 Sep 2018 08:17:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYcopSlLOQIj8Cjx1Pa33H3BruPi+WFPvGEZm2aXenz/ZQaZ13QgWwPIJ4qYxwqXIb1z2uh X-Received: by 2002:a17:902:8481:: with SMTP id c1-v6mr13370412plo.177.1536419831416; Sat, 08 Sep 2018 08:17:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536419831; cv=none; d=google.com; s=arc-20160816; b=OK9Rz11UNeBsOv1aed1BU9/I3EjtaLG2RpQrBY9aF89XuUFXG2aG0bMQ53Q/gX2XrW BvNsxV4U/4mUKbsJa7f7DdqI6Hl9y0+2HTPelUn5jItAKuQJr6z2qCAzx1vsmoRQjckB VyaqHvAywwQUBzKOAOZsKw2N1rtQr0SkpOgVGR+4aYjcYZuyFYoDJWPDtSRLpAG0C8mj QI+h7Hz+kjqJGSEHPAWDpkUQNolJ4QOCgQF43O+SrmXzOvXA00qfVlvPyKojPeV4nTtc +sp0O1nfMoomS4MNlfHvGHXMIr5qZHic9j5HJn36l2mIhVLBfBSDnG/I34YshuwXbjvg Ugtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=xNnKeX8f4L8LXFMMf6fbKC8tV2kOss2XzDq+uAEAtrQ=; b=ZzfJ79F+IBmsoSeVtqVGo+ni9ElrLYDwQ3lO0rh7PMT5OjzIQVJ04n72c/W5zR50XP XQe10/Qp/ngewwomPgEh9z4P0KyEQc1s2D5twTuc1kvpYfEjbJBete1JzodGiAvvoVN5 DyEJAsxzefweO2MTpH72ZmYhhZeJi0++kmy80cYY7Czi62L0iyqW4qLzrVBCQWVc7eNd evP/NDNUlgffllXOgspHoHgMFUiHyAUmK1SngDNqvbhAgrvFNLfsd7ngG4aYuDY7+09U hwee2SkJ+xuBfYl976y0izi+NHnUb2hYEQ9PXcn1oO9iPuv8DgS9ieswIhxxJN1H/E/i qlwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=f0eRBcJG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5-v6si11182532plx.27.2018.09.08.08.16.54; Sat, 08 Sep 2018 08:17:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=f0eRBcJG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727399AbeIHUBd (ORCPT + 99 others); Sat, 8 Sep 2018 16:01:33 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:45072 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726765AbeIHUBd (ORCPT ); Sat, 8 Sep 2018 16:01:33 -0400 Received: by mail-pl1-f195.google.com with SMTP id j8-v6so7843019pll.12 for ; Sat, 08 Sep 2018 08:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xNnKeX8f4L8LXFMMf6fbKC8tV2kOss2XzDq+uAEAtrQ=; b=f0eRBcJGkYAaOik4lbxyFgA0liYjNpf46BGiDn+6LHIbQ3KTQC+3bGn6nA5AWtoA34 YNxQPIzQv1nbSOkQXWSv10RobecyzbawYKC4BXalrYj9cdMJQmSkSrzF6K5EHbvM7OD4 AGrCccr5EV0yW6iNJ+WzkzcJFwDwNnLts1yrFXEGpC747+QbuVHmkkyETlks0kK7/UNi cNDfeeCvc6ZeUI28dYbDP36kCEdoZcjZEO6RcFn51yQeUJ/kP9nRBUFLf+rxJqWJ9n9E s8cCTGPiJ7i50Ze5R4aF2jxTTkTHX7hjY/AXVW4x2q8MdMjY26/7jh8lci08O+DtaB7d pLDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xNnKeX8f4L8LXFMMf6fbKC8tV2kOss2XzDq+uAEAtrQ=; b=dRfp248AYSLgtr21OAM7S8fE5Bf6/m0WArLUrToZdYWEZb3KJQKId3S44hJpGAU/7o vZyzGvulo547ovWMHN+JH1LlwCyZywmsePQEMRt9dLxMqJ9LlZrGRdIht8HAzQBpr2bF CAJVEFvpuFWqEsnp0QAjj/knWKdmSvEIIOKEtPRulwiLrct3HScWx1l53A8SsKBUUAQf XqdHgKv0zGIOKQEjS+wMer/xVDRx1Sp34e1KLV0RRKKoHri4D7he8thcSKbfSgLfxwB6 dinUOcpRe0QM00+XVERlSOdhUGAcfgFN6xhJxNd9KMq6Yhl/I6SCRYHvIEYc7wQenE0/ QuGQ== X-Gm-Message-State: APzg51BwvM0eluDunlNXb0bW3P8yVxEVS00y1cejncoGfYJrZt/I9Etc qm80JWZIm5ge8VIYay4OJx2CL+0miuU2SAsrfJtrNA== X-Received: by 2002:a17:902:bf46:: with SMTP id u6-v6mr13247937pls.85.1536419724874; Sat, 08 Sep 2018 08:15:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:ac14:0:0:0:0 with HTTP; Sat, 8 Sep 2018 08:15:03 -0700 (PDT) In-Reply-To: References: <000000000000e16cba057549aab6@google.com> <14d5bccf-f12d-0fc1-eddc-9fb24dc0cf14@I-love.SAKURA.ne.jp> From: Dmitry Vyukov Date: Sat, 8 Sep 2018 17:15:03 +0200 Message-ID: Subject: Re: BUG: bad usercopy in __check_object_size (2) To: Kees Cook Cc: Tetsuo Handa , syzbot , Chris von Recklinghausen , "H. Peter Anvin" , LKML , Linux-MM , Andy Lutomirski , Ingo Molnar , syzkaller-bugs , Thomas Gleixner , X86 ML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 7, 2018 at 9:57 PM, Kees Cook wrote: > On Fri, Sep 7, 2018 at 9:17 AM, Tetsuo Handa > wrote: >> On 2018/09/08 0:29, syzbot wrote: >>> syzbot has found a reproducer for the following crash on: >>> >>> HEAD commit: 28619527b8a7 Merge git://git.kernel.org/pub/scm/linux/kern.. >>> git tree: bpf >>> console output: https://syzkaller.appspot.com/x/log.txt?x=124e64d1400000 >>> kernel config: https://syzkaller.appspot.com/x/.config?x=62e9b447c16085cf >>> dashboard link: https://syzkaller.appspot.com/bug?extid=a3c9d2673837ccc0f22b >>> compiler: gcc (GCC) 8.0.1 20180413 (experimental) >>> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=179f9cd1400000 >>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11b3e8be400000 >>> >>> IMPORTANT: if you fix the bug, please add the following tag to the commit: >>> Reported-by: syzbot+a3c9d2673837ccc0f22b@syzkaller.appspotmail.com >>> >>> entry_SYSCALL_64_after_hwframe+0x49/0xbe >>> RIP: 0033:0x440479 >>> usercopy: Kernel memory overwrite attempt detected to spans multiple pages (offset 0, size 64)! >> >> Kees, is this because check_page_span() is failing to allow on-stack variable >> >> u8 opcodes[OPCODE_BUFSIZE]; >> >> which by chance crossed PAGE_SIZE boundary? > > There are a lot of failure conditions for the PAGESPAN check. This > might be one (and one that I'm hoping to solve separately). Disabled CONFIG_HARDENED_USERCOPY_PAGESPAN on syzbot: https://github.com/google/syzkaller/commit/be20da425029ecd45b18e99fa5f09691ba0658ea #syz invalid