Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp936658imw; Tue, 5 Jul 2022 00:25:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sW8K7gFJ8Jzu8Q3WiY/6V+dgp6amriyW1xZJ9BScuMV1qnOtwZhaG9UgvNUSmFfLpnoykH X-Received: by 2002:a17:906:9be0:b0:72a:bb96:581 with SMTP id de32-20020a1709069be000b0072abb960581mr10763918ejc.681.1657005914290; Tue, 05 Jul 2022 00:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657005914; cv=none; d=google.com; s=arc-20160816; b=sma1x9EzOW6QqlzZjVy0olhEqY578HmUEaCVAx6dLc/K7qE5583YTuFpxYznUJzusV ioVTJX/jCrMQLYRrFZGJxD1hnqppUaHGeYKI2FqfHofMAXBfJVobQ3ERWuTpcEY431i9 9NJrNLA5xQsYO1bp5PXzWXKNBrjCM9BwVqJiQ7HEF6L6otg+AkPpzq1wkcsShUf/Pt+M ltODSHyGc7zlc6/QQRCZudifhS/KSpNCP8T2wsBqy7fdc2BHPKGEbTXkmRDFWcQICMh0 GPjG/q2sndHi7k1+yvZAWNDbLD7OxGEraIZU5PvrHYMXzS0SAjPI4iTZ3XzVz5l/pNlo aicw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Z4mVbSKrcj1JIa6wIReN7FHnhaFXZQGaTOq3nTowIsQ=; b=FwyKotZapmEnt/OimDpKqIkFXWhwVkMH4m8wLhtDWrRszRptQO0H0xQFXS+KFJcalO /nCVypxjQsIKrnc06m95yPYsz6rkTVKA8JlAYBi3VsRh6btHYMCRD1NUJuRXE7xQIqHn 8alTntvXNV+VBtlv9ASEFilvI5GSJmKkbEUjBdAdx6COx8ZJRHWU2SpxUc3X5ImnddeH 18lcKbvfEFAAS5xJRYHZUG6I+h/Ady4HFx9GCCUKoS52grXjg+vl77yT5US0p66w5BPd ukUyf9UhBGcg/lc+L041+VCCWHnH8ssckKLU6/et7XzjBL27XHuwuDNVusjS7cUJtasA oF5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=LeZlLQ44; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr4-20020a1709073f8400b00715867834e2si4597802ejc.499.2022.07.05.00.24.49; Tue, 05 Jul 2022 00:25:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=LeZlLQ44; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229600AbiGEHUk (ORCPT + 99 others); Tue, 5 Jul 2022 03:20:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbiGEHUi (ORCPT ); Tue, 5 Jul 2022 03:20:38 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7BFEB487 for ; Tue, 5 Jul 2022 00:20:37 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id z25so1488992lfr.2 for ; Tue, 05 Jul 2022 00:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Z4mVbSKrcj1JIa6wIReN7FHnhaFXZQGaTOq3nTowIsQ=; b=LeZlLQ44zCsdo9tcCU9ql/QbMxiQhhyLRjM3FIs090x8oSd7Zm8KeWyBEo7aLY5eJi cxisyRG08Z+ZryXIbY9hplYZZGDEKdd7UHUasypPFkVcbQY86AyAOFZEROgkQmWmp++v TgE0qruQFTFuhV2Ka5/rIrCs1QnaZ0eWxdEgoJB0muw6nwFQYMfVlaLh49bnccUEWCaT nY39MadWPKzj9cry8pB13AHz9AbpGwA4Ju0aGRbVhGZ3bUbhqDnaRl8vwcYgZZ12qb3Y iIkzKNZ6MhhwlF7FXE6UJB+9dFOj4BmS0mbz5lHTMxCYyH+NGvJYvXmUvozSdU8Q1yYD Oblw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Z4mVbSKrcj1JIa6wIReN7FHnhaFXZQGaTOq3nTowIsQ=; b=INYbYMGgt9Aia8fMCcpwHMuZfFIJiySwNtrAaxbYRZkFenTFfFS3NF3xShHG/mJSb6 8cgB8QOrGb9a2dWdfwFwZAxd7kEMQ4/Oi7IHcPMBwBfw8MKxVsIyMmeUk1HswW269G+l y0Bs2APSLrrLvv9rNcVnDq3TJIiwB9/ovPcYVwmKPiWm3MwG6JAHF3z7VZ+3yGxWIFU/ QvccOVtihV6R6ecVnYwxvlJw5vWmodhB1qWxuWr4dwXzP1zOT4HdNwf0+eGVvM8Ho5LU FR0jORwtoZeBPP5b1ol22a/fdW0aCHjQ916+/Qh4JWhH6Rr7VcscH7Pwzht5LXHkSBuX zvGw== X-Gm-Message-State: AJIora+WiQ9rCGxu7TiTnlA4o16Hkd5DNXd3dzYbPqpMJ6euvjuW+JAR 7fKQNU0zphgS28ix+mbWes06d4jiHKYyNo6APbm23hX0Q0Yrnw== X-Received: by 2002:a05:6512:10c3:b0:47f:a97e:35c with SMTP id k3-20020a05651210c300b0047fa97e035cmr21240275lfg.417.1657005635698; Tue, 05 Jul 2022 00:20:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dmitry Vyukov Date: Tue, 5 Jul 2022 09:20:24 +0200 Message-ID: Subject: Re: [PATCH] char: misc: make misc_open() and misc_register() killable To: Tetsuo Handa , Greg Kroah-Hartman Cc: syzkaller , Aleksandr Nogikh , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Arnd Bergmann , LKML , linux-pm@vger.kernel.org, Wedson Almeida Filho Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Jul 2022 at 07:54, Tetsuo Handa wrote: > On Tue, Jul 05, 2022 at 02:21:17PM +0900, Tetsuo Handa wrote: > > On 2022/07/04 23:31, Greg KH wrote: > > > I don't understand what you are trying to "fix" here. What is userspace > > > doing (as a normal user) that is causing a problem, and what problem is > > > it causing and for what device/hardware/driver is this a problem? > > > > Currently the root cause is unknown. > > This might be another example of deadlock hidden by device_initialize(). > > > > We can see from https://syzkaller.appspot.com/text?tag=CrashReport&x=11feb7e0080000 that > > when khungtaskd reports that a process is blocked waiting for misc_mtx at misc_open(), > > there is a process which is holding system_transition_mutex from snapshot_open(). > > /dev/snapshot is not read/writable by anyone but root for obvious > reasons. > > And perhaps it's something that syzbot shouldn't be fuzzing unless it > wants to take the system down easily :) We could turn CONFIG_HIBERNATION_SNAPSHOT_DEV off for syzbot, but it will also mean this part of the kernel won't be tested at all. I see it has 14 ioclt's (below) and not all of them look problematic (like POWER_OFF). Perhaps the kernel could restrict access only to reboot/restore functionality? This way we could at least test everything related to snapshot creation. #define SNAPSHOT_FREEZE _IO(SNAPSHOT_IOC_MAGIC, 1) #define SNAPSHOT_UNFREEZE _IO(SNAPSHOT_IOC_MAGIC, 2) #define SNAPSHOT_ATOMIC_RESTORE _IO(SNAPSHOT_IOC_MAGIC, 4) #define SNAPSHOT_FREE _IO(SNAPSHOT_IOC_MAGIC, 5) #define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9) #define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11) #define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, struct resume_swap_area) #define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, __kernel_loff_t) #define SNAPSHOT_PLATFORM_SUPPORT _IO(SNAPSHOT_IOC_MAGIC, 15) #define SNAPSHOT_POWER_OFF _IO(SNAPSHOT_IOC_MAGIC, 16) #define SNAPSHOT_CREATE_IMAGE _IOW(SNAPSHOT_IOC_MAGIC, 17, int) #define SNAPSHOT_PREF_IMAGE_SIZE _IO(SNAPSHOT_IOC_MAGIC, 18) #define SNAPSHOT_AVAIL_SWAP_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 19, __kernel_loff_t) #define SNAPSHOT_ALLOC_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 20, __kernel_loff_t)