From patchwork Tue May 4 18:08:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12238403 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=-14.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham 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 63324C433B4 for ; Tue, 4 May 2021 18:08:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41D2A61177 for ; Tue, 4 May 2021 18:08:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232320AbhEDSJJ (ORCPT ); Tue, 4 May 2021 14:09:09 -0400 Received: from mga03.intel.com ([134.134.136.65]:4503 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232273AbhEDSJG (ORCPT ); Tue, 4 May 2021 14:09:06 -0400 IronPort-SDR: zpOihsyrWo3MCdhbJr3xH8kkMUVJsh+gX0bXIfcwFd8G9zMrI4aOoalVuVQr0eXtAH+MTdj8eM hEFwiI32Nv/w== X-IronPort-AV: E=McAfee;i="6200,9189,9974"; a="198102786" X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="198102786" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 11:08:10 -0700 IronPort-SDR: tV6c1J8jOO09UiO212iYCFlXnUv8Zfdkt9vVVSuIJiOxO30kZVlYeZ8ziy3iZg3P3Ozx9pEOwY Klb8aY9BDT/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="539267692" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 04 May 2021 11:08:08 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 375F3AFA; Tue, 4 May 2021 21:08:24 +0300 (EEST) From: Andy Shevchenko To: "J. Bruce Fields" , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: "J. Bruce Fields" , Chuck Lever , Alexander Viro , Andy Shevchenko , Andrew Morton Subject: [PATCH v3 14/15] nfsd: Avoid non-flexible API in seq_quote_mem() Date: Tue, 4 May 2021 21:08:18 +0300 Message-Id: <20210504180819.73127-15-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210504180819.73127-1-andriy.shevchenko@linux.intel.com> References: <20210504180819.73127-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org The seq_escape_mem_ascii() is completely non-flexible and shouldn't be used. Replace it with properly called seq_escape_mem(). Signed-off-by: Andy Shevchenko --- fs/nfsd/nfs4state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index b517a8794400..cd5eac2ba054 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2351,7 +2351,7 @@ static struct nfs4_client *get_nfsdfs_clp(struct inode *inode) static void seq_quote_mem(struct seq_file *m, char *data, int len) { seq_printf(m, "\""); - seq_escape_mem_ascii(m, data, len); + seq_escape_mem(m, data, len, ESCAPE_HEX | ESCAPE_NAP | ESCAPE_APPEND, "\"\\"); seq_printf(m, "\""); }