Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2201588ybd; Thu, 27 Jun 2019 08:24:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzU0WNom1lVUibxxLtEphAJogoUsRHfp45Syx1QPBxZAQ68awpOo1WdHYShwpq2Za99FiFx X-Received: by 2002:a63:8c0f:: with SMTP id m15mr4260427pgd.441.1561649051012; Thu, 27 Jun 2019 08:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561649051; cv=none; d=google.com; s=arc-20160816; b=rD9+5LBmFItRsufI6fxzzNmjNEog+sq2uhu01gmrDudnR45uRY8tIzDqX9kriOJiRX lgZDTfizoXKqAWaWEG9rw+AbNXFQbsanSEuZFTaCVxSy72O5GQ0UGCpQErLldNcGWkp0 3txYm7+UlXmbWG+ccfQMCcRFaIKGY3aBZ9/P6+M8DBmAVTU/m1cYqEFoX2BL/ehdWhfb dVNCszRxp0soAgQUMMMkaDdW/L7RnOAApJ5hK2G7Ik+CrPeHENJ5GLDeXeFIUaO3AL1s VX3hH9Il+jHLzpq4JxtAMV8NVoXfWxRVEar05e8PwTzSymvY9YdimmOZAXvSAvz/MRWb cNZw== 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=o3nE2enZtYV3QdHTKdySXNB0kemMcwi+GCn1yHO6qI0=; b=pfPchcXIvjEu5P3pL3hj9viyqJQO0hOpj6IX3PLY6oQHkYSBhHKW4CrBsN2ZlWETh3 OhSSV925DX794C5P0DBNObYa+/srViP+I4YEcKO7ZE9Gfs4+ou9X0LpNEyr9/pAMbCcC EjZJV1QkjHQdvh1/WPMvRj3I0ci25KerzbHrc4h1/o6LxZDa8AihcKnOqX35m51KrYZA IyTM9Db3genUHSQBtCPAXwVwrFSfiRjWjslePixfvW5+5BJo7C77ydfZCt5UI9U3GGMh chZy3mcpVxn3jMN9zoKM6DXCgBwhXPHw2MMSSN7y6HU6W2M77X+/bopQsfqVk0Rexsa1 aYLw== 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 g11si2218836pgs.201.2019.06.27.08.23.54; Thu, 27 Jun 2019 08:24:10 -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 S1726497AbfF0PXu (ORCPT + 99 others); Thu, 27 Jun 2019 11:23:50 -0400 Received: from fieldses.org ([173.255.197.46]:36210 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726187AbfF0PXu (ORCPT ); Thu, 27 Jun 2019 11:23:50 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 2F382C56; Thu, 27 Jun 2019 11:23:50 -0400 (EDT) Date: Thu, 27 Jun 2019 11:23:50 -0400 From: "J. Bruce Fields" To: Kees Cook Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Rasmus Villemoes Subject: Re: [PATCH 08/16] nfsd: escape high characters in binary data Message-ID: <20190627152350.GA16539@fieldses.org> References: <1561042275-12723-1-git-send-email-bfields@redhat.com> <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> <201906262100.00C1C22@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201906262100.00C1C22@keescook> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 26, 2019 at 09:16:44PM -0700, Kees Cook wrote: > Right -- any they're almost all logged surrounded by ' or " which means > those would need to be escaped as well. The prism2 is leaking newlines > too, as well as the thunderbolt sysfs printing. > > So... seems like we should fix this. :P ... > I think we need to make the default produce "loggable" output. > non-ascii, non-printables, \, ', and " need to be escaped. Maybe " " > too? OK, so I think the first step is to take a closer look at the users of the default %*pE. If there are any that look like they'd be broken by a change, we should make patches moving to something else, then we can change the default. Then we can also replace ESCAPE_ANY and ESCAPE_NP--that "don't escape printable" logic is confusing and makes it hard to add more types of escaping. And it appears to only be used by %*pE. --b