Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755093AbbKQVUw (ORCPT ); Tue, 17 Nov 2015 16:20:52 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:32897 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755068AbbKQVUr (ORCPT ); Tue, 17 Nov 2015 16:20:47 -0500 Date: Tue, 17 Nov 2015 16:20:40 -0500 (EST) Message-Id: <20151117.162040.1412296298973879057.davem@davemloft.net> To: tj@kernel.org Cc: pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu, lizefan@huawei.com, hannes@cmpxchg.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, daniel@iogearbox.net, daniel.wagner@bmw-carit.de, nhorman@tuxdriver.com, gregkh@linuxfoundation.org Subject: Re: [PATCH 2/5] kernfs: implement kernfs_walk_and_get() From: David Miller In-Reply-To: <1447789240-29394-3-git-send-email-tj@kernel.org> References: <1447789240-29394-1-git-send-email-tj@kernel.org> <1447789240-29394-3-git-send-email-tj@kernel.org> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 17 Nov 2015 13:20:46 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 655 Lines: 21 From: Tejun Heo Date: Tue, 17 Nov 2015 14:40:37 -0500 > + static char path_buf[PATH_MAX]; /* protected by kernfs_mutex */ > + int len = strlen(path); ... > + if (len >= PATH_MAX) > + return NULL; > + > + memcpy(path_buf, path, len + 1); static char path_buf[PATH_MAX]; /* protected by kernfs_mutex */ int len = strlcpy(path_buf, path, PATH_MAX); ... if (len >= PATH_MAX) return NULL; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/