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 0613DC7EE2F for ; Mon, 12 Jun 2023 16:25:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235975AbjFLQZt (ORCPT ); Mon, 12 Jun 2023 12:25:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234091AbjFLQZs (ORCPT ); Mon, 12 Jun 2023 12:25:48 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5B94199; Mon, 12 Jun 2023 09:25:47 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 52BAF1FDAF; Mon, 12 Jun 2023 16:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1686587146; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=miuQAZFWTY3Ad4nQ4xkfSxIoICpsBzfNaEZViZD0I9Q=; b=WQUGxxURQCi1Q2KvpEyilDzAitnFPElLGSIl/YddF2ls2KHaFcL+FeBTHRlh+kJ0YLcsEI XYPmiTb+khRol6JTwLE7XuP4/yjh6+RkRlyZ/9eUiqraPu7wSjsrGsukV773eX5Ytunb40 N1lRLv59k1gPOrDaeXimL0V7YqQswxM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1686587146; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=miuQAZFWTY3Ad4nQ4xkfSxIoICpsBzfNaEZViZD0I9Q=; b=/fkakv8ZMsQGV55owMk6kn05+bwkvTqxL1rfSmzr06ZeWAX6Kn+i91QU9/JL97BTJtG3qz QrUHX3Zy81unJ6Dw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 450AB1357F; Mon, 12 Jun 2023 16:25:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Zn7tEApHh2TBVAAAMHmgww (envelope-from ); Mon, 12 Jun 2023 16:25:46 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id CB889A0717; Mon, 12 Jun 2023 18:25:45 +0200 (CEST) Date: Mon, 12 Jun 2023 18:25:45 +0200 From: Jan Kara To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Dmitry Vyukov , Ted Tso , yebin , linux-fsdevel@vger.kernel.org, Jan Kara Subject: Re: [PATCH] block: Add config option to not allow writing to mounted devices Message-ID: <20230612162545.frpr3oqlqydsksle@quack3> References: <20230612161614.10302-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230612161614.10302-1-jack@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon 12-06-23 18:16:14, Jan Kara wrote: > Writing to mounted devices is dangerous and can lead to filesystem > corruption as well as crashes. Furthermore syzbot comes with more and > more involved examples how to corrupt block device under a mounted > filesystem leading to kernel crashes and reports we can do nothing > about. Add config option to disallow writing to mounted (exclusively > open) block devices. Syzbot can use this option to avoid uninteresting > crashes. Also users whose userspace setup does not need writing to > mounted block devices can set this config option for hardening. > > Link: https://lore.kernel.org/all/60788e5d-5c7c-1142-e554-c21d709acfd9@linaro.org > Signed-off-by: Jan Kara Please disregard this patch. I had uncommited fixups in my tree. I'll send fixed version shortly. I'm sorry for the noise. Honza -- Jan Kara SUSE Labs, CR