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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DE6BC4361B for ; Tue, 15 Dec 2020 06:11:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E742020798 for ; Tue, 15 Dec 2020 06:11:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726286AbgLOGLB (ORCPT ); Tue, 15 Dec 2020 01:11:01 -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-fsdevel@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