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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable 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 23A9EC48BD7 for ; Thu, 27 Jun 2019 15:23:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05FAD2064A for ; Thu, 27 Jun 2019 15:23:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbfF0PXu (ORCPT ); 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