Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9694886ybi; Wed, 10 Jul 2019 15:09:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFHlww3+RtYBLEsCDxsfylwqzO78dJc5XoWqEu+YiQEviprOvQCCAJ0pYr7yInjHefIij7 X-Received: by 2002:a63:1462:: with SMTP id 34mr520791pgu.417.1562796589710; Wed, 10 Jul 2019 15:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562796589; cv=none; d=google.com; s=arc-20160816; b=X97QrUCIcVIpgxVCMC+HVgDe9brKl2ZUbFGr4m8wHEiFcWCk9JofBdJzjk7LPIx+m4 CZ3F+jWdDe6NFGNWir71AYylzUSnnGYt94mF5O0whcSDJfwBcm2/2aEOlBO9vxQchJYH 6bPwezji2oVHPiUTkZjmXDFiTnCLjtnyey/T2PwBConftGl0oTE1e0PLww4XqKwZ55Yq eoE2BYCTDeRxGML9BLBGY8Oy2DBUKOBWpn+bWPcUwe/MfyQLPO8HFLhpKb/VR49w/N4a W3c8g8JScWKpm20S5ipCmAtyTh1KrxgLPjmauLa51uBY6nY0lzMbwPoOkm8OKn2lqz1S zoCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=oAVNbBDUymQ0A5I9WeHXrCTlyxeSxBMNhkJI/gIxhKw=; b=mj8u4zWOhUq9Msj3ydgDi9uuYp81ECxCpQUnxlUiuj6Q/GI6SwOaIcF85RDOnryvk4 T+OWz4wvsHa7XdiPfOknG3Djjf2NVs6jQOI73MfJH2s9MBAJeLPrp72AzFf1KVna/psc QNDecf4GcVQMKbsGAva0kpeJoHN+DWmieK8cqubKrNgzxUR4a+W7QRtG4WWuy5zVeSvD 2GUeQWgcsN6oIB/TPF9lLfmV7dLUy+pJeqHuTxOwDxoaI3fj9tqLUNSe68JcztobI3b5 k3Q34dWUhZ3YQqrkrfB2vugRHEbmilmkDnO/jDbqGM4s3WTfFLo1pdlSlrZPwypabSzg b10A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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 f1si3391663pjw.100.2019.07.10.15.09.34; Wed, 10 Jul 2019 15:09:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-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-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727585AbfGJWJc (ORCPT + 99 others); Wed, 10 Jul 2019 18:09:32 -0400 Received: from fieldses.org ([173.255.197.46]:53602 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727063AbfGJWJc (ORCPT ); Wed, 10 Jul 2019 18:09:32 -0400 Received: by fieldses.org (Postfix, from userid 2815) id B8EC78A6; Wed, 10 Jul 2019 18:09:31 -0400 (EDT) Date: Wed, 10 Jul 2019 18:09:31 -0400 From: "J. Bruce Fields" To: Kees Cook Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/16] nfsd: escape high characters in binary data Message-ID: <20190710220931.GB11923@fieldses.org> References: <1561042275-12723-9-git-send-email-bfields@redhat.com> <20190621174544.GC25590@fieldses.org> <201906211431.E6552108@keescook> <20190622190058.GD5343@fieldses.org> <201906221320.5BFC134713@keescook> <20190624210512.GA20331@fieldses.org> <20190626162149.GB4144@fieldses.org> <20190627202124.GC16388@fieldses.org> <201906272054.6954C08FA@keescook> <20190628163358.GA31800@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190628163358.GA31800@fieldses.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, Jun 28, 2019 at 12:33:58PM -0400, J. Bruce Fields wrote: > But I may just give up and go with my existing patch and put > off that project indefinitely, especially if there's no real need to fix > the existing callers. I went with the existing patch, but gave a little more thought to string_escape_mem. Stuff that bugs me: - ESCAPE_NP sounds like it means "escape nonprinting characters", but actually means "do not escape printing characters" - the use of the "only" string to limit the list of escaped characters rather than supplement them is confusing and kind of unhelpful. - most of the flags are actually totally unused So what I'd like to do is: - eliminate unused flags - use the "only" string to add to, rather than replace, the list of characters to escape - separate flags into those that select which characters to escape, and those that choose the format of the escaping ("\ " vs "\x20" vs "\040".) I've got some patches that do all that and I think it works. I need to clean them up a bit and fix up the tests. --b.