Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3125881pxu; Mon, 14 Dec 2020 22:14:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGoiS3h84u/qPtPvvL2MWBgsoBaMsUGtJ+KdHGeQpR41FS4bQIG0qy44jrVQ4RIzqq0+7i X-Received: by 2002:a05:6402:1692:: with SMTP id a18mr27569948edv.321.1608012842290; Mon, 14 Dec 2020 22:14:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608012842; cv=none; d=google.com; s=arc-20160816; b=EzJc4WRyz+rdCq9uZk9W7NTY14TcKsEhUW8ZuD4sTElqNyhc/KETupLydx1Kmd0kWu umfEOMecs0CxZWAqeBiTrqN9IR6aZvAydImh/aTcqVMx0uf6AK/rZhYjrEqurOi2wRe2 A/7NJjSv7E9dEuAFLAZmD/STZADciO6p+V5udCOKssRV2PX0nxDXxbx+5Yp4T1EcYX1e cDZbUe00dU6KCSHbfert3IdaxrRsP/I/LF0iC07MxREXEfiFCmf1kTgvfG/ka2omgnGV VjOf4qQfp1HFNMF5pnjCAusNZ36tzrdWXiNVrLCrPnnQadgjyux9pCvC1Gvm1CGlOp+Z 3Yiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=VusLkaQB1r8zWFGmJrtZNnB1kxxCXZqQHtJ5qadB4Rg=; b=ZhlVGJnU8kgIcl0biPolgcXWQrcsq5SC48OmXtJPzYuaU0MqNsDInNVy32NPNw5Qgh RE/+GOWHsb6tVsC1JgG1Usu8tpYJ8NzUIKTocOoUbVAFdQYia9BCnvqxfC9l4ooNMRMP a/ZMOA/uNgMqnSQeG+RsOQzZMh2QUI+OL7FiVPlRlm2vcyw4dSnygR/dHUxJmm6dck5P vFvMvOiOT4h2CVOHAl6vHBx3qvfT8exWyNaqiS/cwvQ2tDp8k+xdP8ck9FqnyEdc1h2u npYuAEw17kwSGb0/mXFadHrJlUEy+B6pINwMa91X31QUP6nrfteuP01u1UbHNjBSVC4a z6bA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds7si493370ejc.20.2020.12.14.22.13.37; Mon, 14 Dec 2020 22:14:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726147AbgLOGLH (ORCPT + 99 others); Tue, 15 Dec 2020 01:11:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbgLOGKu (ORCPT ); Tue, 15 Dec 2020 01:10:50 -0500 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4F45C06179C; Mon, 14 Dec 2020 22:10:09 -0800 (PST) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kp3XB-001NO1-IC; Tue, 15 Dec 2020 06:10:05 +0000 Date: Tue, 15 Dec 2020 06:10:05 +0000 From: Al Viro To: Siddhesh Poyarekar Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Florian Weimer Subject: Re: [PATCH] proc: Escape more characters in /proc/mounts output Message-ID: <20201215061005.GF3579531@ZenIV.linux.org.uk> References: <20201215042454.998361-1-siddhesh@gotplt.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201215042454.998361-1-siddhesh@gotplt.org> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 15, 2020 at 09:54:54AM +0530, Siddhesh Poyarekar wrote: > + get_user(byte, (const char __user *)data); > + > + return byte ? strndup_user(data, PATH_MAX) : NULL; > } No. Not to mention anything else, you * fetch the same data twice * fail to check the get_user() results