From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68727C001DC for ; Tue, 11 Jul 2023 16:15:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230474AbjGKQPF (ORCPT ); Tue, 11 Jul 2023 12:15:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231163AbjGKQPE (ORCPT ); Tue, 11 Jul 2023 12:15:04 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4889E12F for ; Tue, 11 Jul 2023 09:15:03 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-569e7aec37bso53141007b3.2 for ; Tue, 11 Jul 2023 09:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689092102; x=1691684102; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=srPbiHu7W6kwoYdYL0mD3A931iU7Il78HDCrkGjWI18=; b=6GfxYY+/kNebainzUExcm0kQOXE8VIdIJTrFYR88700u3EMMAkDsbxBLzYT9Bo0Dbn X4WP8RKAKpiRw38HH1IOD/Ll3c5Mr2BWvHVFgcWeOdni6SH5iNaJXixzQ6xeyWbmE6Ja ZRugymzdXfIlfEUuZWO5wYF6iiixvGnAHNCg4K0b6Q9PBi0zp/VrhYEbH06FtOjVzOX+ 6d5/+WoGA3vU8omo9fueeHecveYzIQkopQ0b8jSbNK9of4g9wYbl7HuAih2KCXstCAyc YoYsnumvUOSKzTJafNIfgDKaCUAha6iaZhM9ZGYH4meQGAw16z+PyYFzBgq8B7o68DGq J0PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689092102; x=1691684102; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=srPbiHu7W6kwoYdYL0mD3A931iU7Il78HDCrkGjWI18=; b=DQcV5D2pioGM7wuw7WU6b1a2Ar4W0zhKlxY2z7NrqoYCqLUxLCOfF4pTS9maLOvPAX K7gVNC6hMASzrgds6ikYbUvP1vrl3AWSJp2wOK+UjZDFcuOJHxYUbUqV27O5wrd5qqPm Zxh0OeWbbJIV1a8lF/ElGsWWbl1EIHuuWxM1Ndebc3ugtKQc9fsRnbmA8zvdx/cBtjP7 s0U7zibbG0ZoCTaX9YCZ1zaEBYPc/FA1k7Jwqy/pooXPrUCsBALE2QOTnFQEBsj/rlJ2 W/vKPk7UvEHtrY0/AGT96UDKW7aSEm2PeNwEBRvr0Mg8liut1LhmPpUxQo9c6JVgtKjN rUXA== X-Gm-Message-State: ABy/qLYcuoceTcdmOO9mHs6pGgP7lR2OpjyngTBLn7H1fomCujq19/1S Whn7ezA8fACTlHN6jZwaTpd6dAzp9Ak= X-Google-Smtp-Source: APBJJlFDVl9hAuTBxssdwIqHHMl2Olc1sB8n2KGDINQU8/fv4APjnsjPNp19mUGXHW8A1zY9dOMASSOsb5o= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:b663:0:b0:570:7d9b:9b16 with SMTP id h35-20020a81b663000000b005707d9b9b16mr114199ywk.2.1689092102486; Tue, 11 Jul 2023 09:15:02 -0700 (PDT) Date: Tue, 11 Jul 2023 09:15:00 -0700 In-Reply-To: <20230710133427.fb599ef486c7b764d9ca2cc3@linux-foundation.org> Mime-Version: 1.0 References: <20230710133427.fb599ef486c7b764d9ca2cc3@linux-foundation.org> Message-ID: Subject: Re: [BUG]: bad usercopy in kvm_stats_read in mm/usercopy.c From: Sean Christopherson To: Andrew Morton Cc: Zheng Zhang , keescook@chromium.org, linux-hardening@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Jul 10, 2023, Andrew Morton wrote: > On Sun, 9 Jul 2023 14:32:09 -0700 Zheng Zhang wrote: > > > Kees, Andrew, and to whom it may concern: > > > > Hello! We have found a bug in the Linux kernel version 6.2.0 by syzkaller > > with our own templates. It also produces a POC. > > Attached is the report, log, and reproducers generated by syzkaller > > Please let me know if there is any additional information that I can > > provide to help debug this issue. > > Thanks! > > Let's cc the kvm mailing list. > > Original email is at > https://lkml.kernel.org/r/CAC_GQSr3xzZaeZt85k_RCBd5kfiOve8qXo7a81Cq53LuVQ5r=Q@mail.gmail.com Yeaaaah. We failed kernel programming 101. KVM installs file descriptors to let userspace read VM and vCPU stats, but doesn't grab a reference to the VM to ensure the VM and its vCPUs are kept alive until the stats fds are closed. I'll send a patch.