From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 74CDB3B2A3 for ; Thu, 26 Oct 2023 19:35:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Aywc3mCW" Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D1061A6 for ; Thu, 26 Oct 2023 12:35:45 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1cab2c24ecdso10323265ad.0 for ; Thu, 26 Oct 2023 12:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698348945; x=1698953745; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=IQC4A/sL4XoeDc7l3OjE8DP+73M4y+QZaaN7R7Z8PCQ=; b=Aywc3mCW9NW0AMC6WgUz95gu5oOfmutaPs4DHPoAfIJnUt8e5xK8aZiSjbq4BjtS6m Um4z9WCPAd2qYuDxuI0/pEzpzvshgTjURFCl8x36stzu2DhXmFDBWrhA5yaUN5Zr8sgm JBOEWHij/NraEObIV6BWKo1s9FbKUF5+nn/qA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698348945; x=1698953745; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=IQC4A/sL4XoeDc7l3OjE8DP+73M4y+QZaaN7R7Z8PCQ=; b=H4ummFGcuOCoMqCi1W0osXDC0qVh1sYMkmIU4Ljer3XmHKx/e9wJqK5iOVsK4CRnPN 4SdoLXwohfPLjKqdRCr7n4qR6qRYBpL/LKM31decSeGMHE9JGZLu1mjJFK93jJI1AHdD DkL4o4hynOugCLfThGrV4+PFbvNvtTMkKNd4VK91I4FCJiOFw+GSfOh14PhHUPWyW6mt Nu/sWaHW9dwmwVAQ5Jd9cNcMm8nTvcruXRJ81b4eEcOyq+aCXNur1CfJHeRAEBenZKGU 35OAFOVPGYkaST/UpJFJCBFPninMxKzghFnXrrc88NoVkCMt348Ll6P2F4ZGgEkmMVtD 9igg== X-Gm-Message-State: AOJu0YzntdIv/K7/8hxnBF6fnX3cKIkDq/Yt6qMzQcJZ6zn7VOuyONJk iQduwO3eW0Iy3AdYO6XFz1z8zA== X-Google-Smtp-Source: AGHT+IF5LDmYM98HgrrDpR0APpEt3rwu9iztxBirzFeXmCAP46nFRKhSnMjIOUGuff1tVeQB7T13qQ== X-Received: by 2002:a17:903:1105:b0:1c9:faef:5765 with SMTP id n5-20020a170903110500b001c9faef5765mr603014plh.5.1698348944845; Thu, 26 Oct 2023 12:35:44 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id 10-20020a170902c14a00b001b9d95945afsm46208plj.155.2023.10.26.12.35.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 12:35:44 -0700 (PDT) Date: Thu, 26 Oct 2023 12:35:43 -0700 From: Kees Cook To: Steven Rostedt Cc: "Matthew Wilcox (Oracle)" , Christoph Hellwig , Justin Stitt , Kent Overstreet , Petr Mladek , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , Masami Hiramatsu , Greg Kroah-Hartman , Arnd Bergmann , Jonathan Corbet , Yun Zhou , Jacob Keller , Zhen Lei , linux-trace-kernel@vger.kernel.org, Yosry Ahmed , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] seq_buf: Introduce DECLARE_SEQ_BUF and seq_buf_cstr() Message-ID: <202310261233.716843B8@keescook> References: <20231026170722.work.638-kees@kernel.org> <20231026133850.138d5415@gandalf.local.home> <202310261050.A621A7F121@keescook> <20231026140247.3a3c68e4@gandalf.local.home> Precedence: bulk X-Mailing-List: linux-hardening@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: <20231026140247.3a3c68e4@gandalf.local.home> On Thu, Oct 26, 2023 at 02:02:47PM -0400, Steven Rostedt wrote: > On Thu, 26 Oct 2023 10:54:26 -0700 > Kees Cook wrote: > > > > Do we really need to call it _cstr? Why not just have seq_buf_str() ? > > > > > > I mean, this is C, do we need to state that in the name too? > > > > I'm fine either way. I did that just to make the distinction between our > > length-managed string of characters interface (seq_buf), and the > > %NUL-terminated string of characters (traditionally called "C String" in > > other languages). And it was still shorter than "seq_buf_terminate(s); > > s->buffer" ;) > > Do you believe that people might get confused with it as seq_buf_str()? > > Can you envision that we would want a seq_buf_str() and seq_buf_cstr() that > do something different? No, I see your point. Like I said, I don't care either way. I was just explaining why I did it that way. "string" means a lot of things to different people. "C String" is unambiguous, and I try to be unambiguous whenever possible. :) I'll send a v2 as seq_buf_str()... -- Kees Cook