Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5190679ybl; Wed, 22 Jan 2020 12:02:12 -0800 (PST) X-Google-Smtp-Source: APXvYqxMC8g5er5s19UlhBeF68vzztWb11wSnQEXKttae148pFj7BUcon7SYYuLDj+KhS9vtpf59 X-Received: by 2002:a9d:6c01:: with SMTP id f1mr8161830otq.133.1579723331820; Wed, 22 Jan 2020 12:02:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579723331; cv=none; d=google.com; s=arc-20160816; b=nWZlkJHjsJF6/lp6S+9rgclQ35q6eTM1x2oEv/04fZoicNL0sF0EWt3TVIGx0Snml0 pAmJO/yEEqldFL4QgE422dBSLhvfz+K1/hQJzqwiSHqDtL7Hn5sPKMaKsg/FwpOKuCO3 5HXA22Qlpfa0kv4DIbd1RiH8KwZsV+FaHSd2jYvZ2gHdSEc6IIEjvkY1MDGOfQof3hB+ iFKDBZ/EMCx3oqh8xto+R4WMXir4I1jj0UD+z7V5aynEzbHR1WEaaqSU3kx1oVa5DKxx 3prbQntoG/7vEbp04c6SQOutCm4OffCwhJVBqelal15VI5qfuS4RhXOBrUl6oWX5UIln ttwQ== 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 :in-reply-to:references:mime-version:dkim-signature; bh=nmXkOE0gQWDRjimVTEB4sD8JqwKTc5uBEhDESWZ8NPw=; b=NCed4T4d7M0Mn7OZFaRYn31MvqdRYoJcupg5L3nHx246b4XbL3o2MwD93uekXtT06w PMFXus9tZZu6d5roKBm4934Y98xRUwQvQEryHTkhf0uHPl0Yy0egaFgOM6aMclfnVDsI yi8cT/4rmAAMo1kXkm0TXO3WP8RosHgU4qy+HlM6XGAHqiXLB6VdHUn5sVBm4KvcmFA2 lcs3vWGPQz5ERzx1oC8QCEXGFFbZcgPzLz/68GZ/8+j204uf0Z4ZY4hyKK3tQ3ZasmPi FLMdkfAqObeV8VNuYIiNQxUXxQ1+GQkNJjfJnWrgbrvzCx+alLLwRXLnZbmo4/xB50MU gMfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=GLauzyiF; 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 y18si22204720oix.27.2020.01.22.12.01.57; Wed, 22 Jan 2020 12:02:11 -0800 (PST) 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=@linux-foundation.org header.s=google header.b=GLauzyiF; 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 S1725827AbgAVUAx (ORCPT + 99 others); Wed, 22 Jan 2020 15:00:53 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44543 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbgAVUAx (ORCPT ); Wed, 22 Jan 2020 15:00:53 -0500 Received: by mail-lj1-f193.google.com with SMTP id q8so390934ljj.11 for ; Wed, 22 Jan 2020 12:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nmXkOE0gQWDRjimVTEB4sD8JqwKTc5uBEhDESWZ8NPw=; b=GLauzyiFBTuk3X13M78MEbu9Kzz9Bqua6Tn5bTwgYr4+Wb5TA+GQxv7LcDqpOKIgfq rjbwLdlgVjIUdmW8DEA8AlbSPtfjLTTV8WMIR7BerZNkuz7ck9T5zENf1SPnrQ/iOlPX AVKANJGTXHiHyGPRuuoxw9y6BoOJI7S96PraU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nmXkOE0gQWDRjimVTEB4sD8JqwKTc5uBEhDESWZ8NPw=; b=Fwb78j0pK/KieyY94tmw0YJdULAV+T+r44S5MGRNvanNjr/S4EM25Q/kQx7HIlKh1o yFY1qdX6dZpstzISk8h4Ssjrz9rab4m6D/QozDOW4lhg/e3x9c/ul8VqxBeri8c6IlmW LHglGVCkhCAorVY+kQCgNO0IJh+y4WEq9IV+MAVV9GrxNxiAV0KqgpRZtG2+iTLPrdZO cPy8wq349fgeoFm8+Ex4YLaa0ZS2LvaHQwPwJeBLTlu6ZymBJUiFgPXHq/jp+tMT6xTd Im1OP/DCR2k6ctblBkBNEx1qyno8lsQbzjqKoWaHGJXGV59cn6X4VXyAa8Q+jILNvcPZ GDDA== X-Gm-Message-State: APjAAAUC3XtVm7vupFP+0VRejlyueSt0dP/3wZEFbClOFCGH5jOLVBf9 uPLqCUPmExP9FsaSTfXicKaBOYhTgA8= X-Received: by 2002:a2e:81d0:: with SMTP id s16mr20867097ljg.166.1579723249925; Wed, 22 Jan 2020 12:00:49 -0800 (PST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id r2sm21123930lfn.13.2020.01.22.12.00.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jan 2020 12:00:48 -0800 (PST) Received: by mail-lj1-f170.google.com with SMTP id j26so387276ljc.12 for ; Wed, 22 Jan 2020 12:00:47 -0800 (PST) X-Received: by 2002:a2e:7a13:: with SMTP id v19mr20492671ljc.43.1579723247447; Wed, 22 Jan 2020 12:00:47 -0800 (PST) MIME-Version: 1.0 References: <12a4be679e43de1eca6e5e2173163f27e2f25236.1579715466.git.christophe.leroy@c-s.fr> In-Reply-To: From: Linus Torvalds Date: Wed, 22 Jan 2020 12:00:31 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/6] fs/readdir: Fix filldir() and filldir64() use of user_access_begin() To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Alexander Viro , Andrew Morton , Linux Kernel Mailing List , linuxppc-dev , linux-fsdevel , Linux-MM Content-Type: multipart/mixed; boundary="000000000000021e77059cbffb27" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000021e77059cbffb27 Content-Type: text/plain; charset="UTF-8" On Wed, Jan 22, 2020 at 10:24 AM Linus Torvalds wrote: > > Patch looks better, but those names are horrid. Hmm. A bit more re-organization also allows us to do the unsafe_put_user() unconditionally. In particular, if we remove 'previous' as a pointer from the filldir data structure, and replace it with 'prev_reclen', then we can do prev_reclen = buf->prev_reclen; dirent = buf->current_dir; prev = (void __user *) dirent - prev_reclen; if (!user_access_begin(prev, reclen + prev_reclen)) goto efault; and instead of checking that 'previous' pointer for NULL, we just check prev_reclen for not being zero. Yes, it replaces a few other lastdirent = buf.previous; with the slightly more complicated lastdirent = (void __user *)buf.current_dir - buf.prev_reclen; but on the whole it makes the _important_ code more streamlined, and avoids having to have those if-else cases. Something like the attached. COMPLETELY UNTESTED! It compiles for me. The generated assembly looks ok from a quick look. Christophe, does this work for you on your ppc test-case? Side note: I think verify_dirent_name() should check that 'len' is in the appropriate range too, because right now a corrupted filesystem is only noticed for a zero length. But a negative one, or one where the reclen calculations would overflow, is not noticed. Most filesystems have the source of 'len' being something like an 'unsigned char' so that it's pretty bounded anyway, which is likely why nobody cared when we added that check, but.. Linus --000000000000021e77059cbffb27 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_k5pqexac0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