Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp36546rwo; Fri, 21 Jul 2023 08:11:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlGHiekNX5GJX4AbJFZFAuuAGi8HkrZyejApLj5nRkroZCXj2Xp6FuqLjtk/JfZJpjlaAEBx X-Received: by 2002:a17:902:ea0a:b0:1b0:3d03:4179 with SMTP id s10-20020a170902ea0a00b001b03d034179mr2859489plg.6.1689952308428; Fri, 21 Jul 2023 08:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689952308; cv=none; d=google.com; s=arc-20160816; b=jqTvEBC/ipNtDLM7vxoMlUiAO5OQYlEb91uAX8nv/W6TbPOhH5E/64krHvMLX4G2ke s1tKbE5ufj9kqOE5PDDEaKMUX8dm4nL+PswwUbXYBad+YgYZk2H2t2NqgBStO7L3uftH 0MBRwjDWv316UkuqQ0pUMfTx/5m7FDeZNbdlnB0mbdXegPTg6Sn1KIhAfJHoEWdcjpW/ f/jmwSmq4OLkAIneDzaEAnv3VTu2K6EsccVQZibnheGLH/vDVJnOFHTGHOUFfQxTa05o A8+aASW+LF1sJePsy7Y4fvmHJQ0kstDrxBElkHLuggRqNiwMRTTAbqk8STAVq08w1Gjl ngfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=GanbiwlQZL9eLcZKZOf6sKGYMN21PgFHDlnfuNDD65E=; fh=rzK6qltoZxSwTH9J1LPNZigjXNOW/MZtHWXbT8SnPxo=; b=VfKQRPkZeo8ZJvb2c6F6zyvnxIxmfQhpWRNEpOqMAvYsQoUQqXVnSWyDiwPJ/tqKGq oNjAGhyLS3EuMxSb51MDWuLDX1JA1QGhHC/G5gKRzZ9p6mtC80Owc62oNvP20G3ohdfp ydCg7tUoY6FitOVi+ELtcctWufx8WW4tqJ/yigsaPE2zrGIC+N57WwYXsXppC+3EmE/5 Ma28C9cZEi0tnHCu2A5L2Nb+GLnUQXfcSv5RmIRm1DVlj9OKMQjQBp4tc4zhAKG8S6sd YG4Bpz05y1rtFgEBuQ4evuAnC9L2xdGyJSsTR0+zsZh891qenodjqmIxDA7MyTYOt3Cb Rqpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kh7-20020a170903064700b001b9c205a860si3129307plb.377.2023.07.21.08.11.30; Fri, 21 Jul 2023 08:11:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231749AbjGUPJP (ORCPT + 99 others); Fri, 21 Jul 2023 11:09:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231826AbjGUPJG (ORCPT ); Fri, 21 Jul 2023 11:09:06 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 436DC30C8; Fri, 21 Jul 2023 08:09:05 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="433276670" X-IronPort-AV: E=Sophos;i="6.01,222,1684825200"; d="scan'208";a="433276670" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2023 08:09:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="814991639" X-IronPort-AV: E=Sophos;i="6.01,222,1684825200"; d="scan'208";a="814991639" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP; 21 Jul 2023 08:09:01 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qMrkZ-009iAE-0s; Fri, 21 Jul 2023 18:08:59 +0300 Date: Fri, 21 Jul 2023 18:08:59 +0300 From: Andy Shevchenko To: Dan Carpenter Cc: Michal Hocko , Andrew Morton , Stephen Rothwell , Mel Gorman , Vlastimil Babka , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] lib/string_helpers: Use passed in GFP_ flags Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 21, 2023 at 05:57:00PM +0300, Dan Carpenter wrote: > This patch doesn't affect runtime because all the callers pass GFP_KERNEL > as the allocation flags. However, it should use the passed in "gfp" as > the allocation flags. Please, Cc Kees Cook as he stepped in as a maintainer of this in particular. Reviewed-by: Andy Shevchenko > Fixes: 0ee931c4e31a ("mm: treewide: remove GFP_TEMPORARY allocation flag") > Signed-off-by: Dan Carpenter > --- > lib/string_helpers.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/string_helpers.c b/lib/string_helpers.c > index d3b1dd718daf..be517c25737d 100644 > --- a/lib/string_helpers.c > +++ b/lib/string_helpers.c > @@ -668,7 +668,7 @@ char *kstrdup_quotable_cmdline(struct task_struct *task, gfp_t gfp) > char *buffer, *quoted; > int i, res; > > - buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); > + buffer = kmalloc(PAGE_SIZE, gfp); > if (!buffer) > return NULL; > > @@ -704,7 +704,7 @@ char *kstrdup_quotable_file(struct file *file, gfp_t gfp) > return kstrdup("", gfp); > > /* We add 11 spaces for ' (deleted)' to be appended */ > - temp = kmalloc(PATH_MAX + 11, GFP_KERNEL); > + temp = kmalloc(PATH_MAX + 11, gfp); > if (!temp) > return kstrdup("", gfp); > > -- > 2.39.2 > -- With Best Regards, Andy Shevchenko