From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38D983033D; Mon, 27 Nov 2023 13:54:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lpc9evsT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BA89C433CB; Mon, 27 Nov 2023 13:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1701093271; bh=x8+axdfJnWcUTrYe+z6TxMAlJf7WBymVwQzRmWFuviE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lpc9evsTNarsDVwG4URGVbx2z9JD2xuyvsua8/jM3OgZTRRjECZeoefY/rz77RNH8 tVkw8sFInsRrwrs6uIx4TohZExMunko97zDk3OXyb/DvUxGLQRu93OutVCak6vFsoa afSruwfshNiGdQSdoAY5WOCtrpInZob9S5FGS6Tc= Date: Mon, 27 Nov 2023 13:43:57 +0000 From: Greg Kroah-Hartman To: Kees Cook Cc: Tejun Heo , Azeem Shaikh , Zefan Li , Johannes Weiner , Waiman Long , Steven Rostedt , Masami Hiramatsu , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH 0/3] kernfs: Convert from strlcpy() to strscpy() Message-ID: <2023112751-cozy-dangle-3f5a@gregkh> References: <20231116191718.work.246-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231116191718.work.246-kees@kernel.org> On Thu, Nov 16, 2023 at 11:21:22AM -0800, Kees Cook wrote: > Hi, > > One of the last users of strlcpy() is kernfs, which has some complex > calling hierarchies that needed to be carefully examined. This series > refactors the strlcpy() calls into strscpy() calls, and bubbles up all > changes in return value checking for callers. Why not work instead to convert kernfs (and by proxy cgroups) to use the "safe" string functions based on seq_file? This should be a simpler patch series to review, and implement on a per-function basis, and then we would not have any string functions in kernfs anymore. thanks, greg k-h