Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755394AbcDGIGT (ORCPT ); Thu, 7 Apr 2016 04:06:19 -0400 Received: from smtprelay0116.hostedemail.com ([216.40.44.116]:51225 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755298AbcDGIF4 (ORCPT ); Thu, 7 Apr 2016 04:05:56 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1538:1567:1593:1594:1711:1714:1730:1747:1777:1792:2194:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3622:3868:4321:5007:6742:10004:10400:10848:11026:11232:11473:11658:11914:12043:12438:12517:12519:12679:12740:13069:13311:13357:13439:13894:14659:14721:21080:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: push11_3320517e29e61 X-Filterd-Recvd-Size: 1998 Message-ID: <1460016350.6715.73.camel@perches.com> Subject: Re: [PATCH v3 1/6] string_helpers: add kstrdup_quotable From: Joe Perches To: Kees Cook , James Morris Cc: Andrew Morton , Mimi Zohar , Andy Shevchenko , "Serge E. Hallyn" , Kalle Valo , Mauro Carvalho Chehab , Guenter Roeck , Jiri Slaby , Paul Moore , Stephen Smalley , Casey Schaufler , Andreas Gruenbacher , Rasmus Villemoes , Ulf Hansson , Vitaly Kuznetsov , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 07 Apr 2016 01:05:50 -0700 In-Reply-To: <1459988437-3429-2-git-send-email-keescook@chromium.org> References: <1459988437-3429-1-git-send-email-keescook@chromium.org> <1459988437-3429-2-git-send-email-keescook@chromium.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 488 Lines: 14 On Wed, 2016-04-06 at 17:20 -0700, Kees Cook wrote: > Handle allocating and escaping a string safe for logging. trivia: should add const > diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h [] > @@ -68,4 +68,6 @@ static inline int string_escape_str_any_np(const char *src, char *dst, > ? return string_escape_str(src, dst, sz, ESCAPE_ANY_NP, only); > ?} > ? > +char *kstrdup_quotable(char *src, gfp_t gfp); char *kstrdup_quotable(const char *src, gfp_t gfp);