Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2329459imm; Mon, 16 Jul 2018 06:18:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeVkCMDStMAp5tj9IE2caw4VYiEiMAuVZujjsjspxC6Y8SbH6mb1nTnpX7fGn5i+A5t3Gk/ X-Received: by 2002:a62:42d7:: with SMTP id h84-v6mr17982807pfd.146.1531747123981; Mon, 16 Jul 2018 06:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531747123; cv=none; d=google.com; s=arc-20160816; b=tFyFzJu8BykYDz+2EpMAqU3A4fppXZdMtbjuzyUt7QPBlAp2Kr92RWeTNgSBzcItPG nT6rgbLh+EK6LJQubeG1jNi9NfSkIpEucs6LoZtsHrn2y7VHnzXuorsKGUyT9yXp9mj/ zCBoQw9UG5jvMc/8Q3tv1r7SjkOaPd6ZDYulWXjO6FCbzPqUoYmFNs2gjl68Se06XZv1 +tIdYKXqLJzMUGTBHtIHBjqL866nd29AUVxu7QMOqbIOW9od/VpwTj02Q7JScbm/Gj3Q 95+KXF5JCztRxt1pfk2IGEyyeOcG7xP8c/kMprHmKsgrtkoXCCp7PoMF/lVYKJSRhaBO AfMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=yHbBT0wYm4PqFvB+4BgTKfPTnmzqBmslD/pmE1bAyHw=; b=TtvM5gdjGFoEOKZk12wnvOn1Xs8hVNEDVVCVQKh90ywNaKAZC5SWkLDs/6jh90UixZ mZMZj1swwx9w/ZZu0PWUni7p7kW4wJjZAQSSAZu/pZ8VRrHHWLgwUMg8m5HZoNHX8YDT 8crhq2QXmCNUuQc3yHy7QisIkhcDRRPq8oZCPICZrjcWILv052LcxArufNHY4doa5APr /7ff0SlEvUzRcW1Nwy7LQNo6EU6gI7dDnVRcLWe05huzNCDSBSGdQgN0rPbMlnmYqpHK kZcVdfw7XGTrb4MtsP0NyXhrg9gi8gkP5Oxq4ANbuXiVmQuvxxMN8WXfFG8MnmyF00pQ Pr7w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o21-v6si29683305pgl.165.2018.07.16.06.18.28; Mon, 16 Jul 2018 06:18:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729841AbeGPNpG (ORCPT + 99 others); Mon, 16 Jul 2018 09:45:06 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:39474 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728758AbeGPNpG (ORCPT ); Mon, 16 Jul 2018 09:45:06 -0400 Received: from alans-desktop (82-70-14-226.dsl.in-addr.zen.co.uk [82.70.14.226]) by fuzix.org (8.15.2/8.15.2) with ESMTP id w6GDHYdv005275; Mon, 16 Jul 2018 14:17:34 +0100 Date: Mon, 16 Jul 2018 14:17:34 +0100 From: Alan Cox To: Anatoly Trosinenko Cc: viro@zeniv.linux.org.uk, OGAWA Hirofumi , akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: FAT: Operating on broken FAT FS causes the write syscall to return negative number not equal to -1 Message-ID: <20180716141734.01ddee8c@alans-desktop> In-Reply-To: References: <878t6c7f8p.fsf@mail.parknet.co.jp> <20180715143043.GM30522@ZenIV.linux.org.uk> Organization: Intel Corporation X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Oops, I was just doing some testing and thought that correct behavior > for crafted FS is to return arbitrary valid error code (like -EIO) or > some arbitrary data, say, not larger than FS (not disclosing the > kernel memory, of course). Please excuse me if I was wrong. If fixing > this would slow down some hot code path, then I am not insisting on > returning valid errno. :) > > Meanwhile, how should be considered such discrepancies with man pages > for invalid FS images: should it be considered low priority bug, > not-a-bug or feature request (diagnostics)? If you can crash the machine or exploit it with a carefully crafted disk then its serious. If you get weird behaviour only it's not too serious. It's nice (but often not possible) if a filesystem at least forces itself R/O when it detects a corruption to avoid doing more damage. Alan