From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 441963D6664 for ; Thu, 21 May 2026 13:45:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779371108; cv=none; b=ohiMIWUz+eCWS8Y2zd0xxYxrHLdf+Y5oNKVVunsSXsKCMDUweB8MGP9tvJy/zs5/9N+zm5VIskHBi9ihOqNpo5RweRBbChet7CKA+5URLbr/9hQD32+QEBEzRgz0sSa1SPEKbf/RyETOvk1GUxElYgSoGKICYJdnRuXSvyGaIWg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779371108; c=relaxed/simple; bh=JmKBkku/kD8/n/a4gtEJvwwFH5TVoQOZ+eRQ7DUmO1k=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=kjkxgyVJUAjdrE0A1GNfqZm3qJak4kUH5/m2EN/mlmKEvBO49Xrf/DBWLOd5krT/uY1XMZ1x12OrL6rkFE9kZcH4hPneSk9/U8ytxqSp3+gE8wNXVRmCQTwW4YFTLrSl1U+O6TZIUSPcTEVazGKd+O8efhBKg145UZ1y0QIBql0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=AEUoLOvu; arc=none smtp.client-ip=209.85.215.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="AEUoLOvu" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-c829586e894so3199288a12.2 for ; Thu, 21 May 2026 06:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779371105; x=1779975905; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Dnh9Qdh/Ek2SFmUD3YQQhAJ1lm8lFb5yTi3rkZyIV7s=; b=AEUoLOvuZHnHe0OxZmiwzxlpFnAI7KkWMOddcqrD/BWajECgTNQuXjPTs2sGaexgTy 0KVMZ3z7cF4W6oVME9mp+c+waMUFLrma9KaJOsnO+O/G3dbUyplh4U8RJ3wIqG+3wRC6 9qUKxDO8l7gTy7AFpOskFd9zkHOFcudDgezGtoW1TY2JPImbq7b/3I5mJ3odZBhypLTE 3j07KITE1eDAQuL6ze98f7zJvKL0Qu6loMvbq4v9DHKSMh8upwa+RfKM7VnjxfvAp8LR YtLiWjDFYn3Y3ZWCZm1wocV03nQS0ai6wxZ/rPIIOp+Ub7AVmcJmY8GkQNhvemTubt9Q W/8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779371105; x=1779975905; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Dnh9Qdh/Ek2SFmUD3YQQhAJ1lm8lFb5yTi3rkZyIV7s=; b=JqDupYzk0IdqGsH/kz6pdMUeGxlUtwa0UiHDKFhJL0uVx5wFju1csEHmyRlZKyVWP1 7I9rRjh+Ru8GWvk2sRPllj/I2AW4gjU+YGZrYOWWwOPmxJXlhhfsXJxSIEbFFJ/SNK+b x7OtjErXmXyUp9adPMUQiiJnPmirnYYdD5J6fymYll21jvCwhphwfW5p04EB1n7xRQLL sZPHm8FyUCrnzU68Y6uaZiIEm9/XZ8x6HjY8+2o99iNRs93wjucUWcUTq2dOKxGiBr+n GhVl+ZsViGbj9TwHE63ZpXE5QlrDWRis/5newK/9kGZidZQZTMyYoW0lCxxFvwgVc/pB fMng== X-Forwarded-Encrypted: i=1; AFNElJ/Kh2+i9MtwLjv/yF3Swk8GuLV6mVyF7muVy+8ZgIuMpk/UnTB1Wn/2QdRcnp11lJikPYer5a8nSIBeb6K9D9WWMpBd2jw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1EsyGqFWaroZACB20Q0QzNzHLmfoRtCcyyzgqUBmG4DCS2gML C8F4VGyynH42nbFskFOKwUJ/hfvHyOljdgNLFoiBvP/GJV0OxQFFTvUgvsuFtjgm321ycAz6Ay+ 7U1I6qA== X-Received: from pgvm13.prod.google.com ([2002:a65:62cd:0:b0:c85:1159:ffbd]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:7491:b0:3a0:bc61:62e5 with SMTP id adf61e73a8af0-3b30883a17bmr3700528637.44.1779371104725; Thu, 21 May 2026 06:45:04 -0700 (PDT) Date: Thu, 21 May 2026 06:45:04 -0700 In-Reply-To: <20260521133326.2465264-9-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260521133315.work.845-kees@kernel.org> <20260521133326.2465264-9-kees@kernel.org> Message-ID: Subject: Re: [PATCH 09/11] treewide: Convert custom kernel_param_ops .get callbacks to seq_buf via cocci From: Sean Christopherson To: Kees Cook Cc: Luis Chamberlain , Pengpeng Hou , Petr Pavlu , Richard Weinberger , Anton Ivanov , Johannes Berg , "Rafael J. Wysocki" , Len Brown , Corey Minyard , Gabriel Somlo , "Michael S. Tsirkin" , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , Bart Van Assche , Jason Gunthorpe , Leon Romanovsky , Laurent Pinchart , Hans de Goede , Mauro Carvalho Chehab , Bjorn Helgaas , Hannes Reinecke , "James E.J. Bottomley" , "Martin K. Petersen" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Greg Kroah-Hartman , Jiri Slaby , Alan Stern , Jason Wang , Xuan Zhuo , "Eugenio =?utf-8?B?UMOpcmV6?=" , Jason Baron , Jim Cromie , Tiwei Bie , Benjamin Berg , "Ilpo =?utf-8?B?SsOkcnZpbmVu?=" , "David E. Box" , "Maciej W. Rozycki" , Srinivas Pandruvada , Peter Zijlstra , Heiko Carstens , Vasily Gorbik , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Vinod Koul , Frank Li , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" , Andy Shevchenko , Georgia Garcia , kvm@vger.kernel.org, dmaengine@vger.kernel.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, linux-um@lists.infradead.org, linux-acpi@vger.kernel.org, openipmi-developer@lists.sourceforge.net, qemu-devel@nongnu.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Thu, May 21, 2026, Kees Cook wrote: > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > index 07f4c7209ac0..00317774a90b 100644 > --- a/arch/x86/kvm/vmx/vmx.c > +++ b/arch/x86/kvm/vmx/vmx.c > @@ -368,12 +368,16 @@ static int vmentry_l1d_flush_set(const char *s, const struct kernel_param *kp) > return ret; > } > > -static int vmentry_l1d_flush_get(char *s, const struct kernel_param *kp) > +static int vmentry_l1d_flush_get(struct seq_buf *s, > + const struct kernel_param *kp) > { > - if (WARN_ON_ONCE(l1tf_vmx_mitigation >= ARRAY_SIZE(vmentry_l1d_param))) > - return sysfs_emit(s, "???\n"); > + if (WARN_ON_ONCE(l1tf_vmx_mitigation >= ARRAY_SIZE(vmentry_l1d_param))) { > + seq_buf_printf(s, "???\n"); > + return 0; > + } > > - return sysfs_emit(s, "%s\n", vmentry_l1d_param[l1tf_vmx_mitigation].option); > + seq_buf_printf(s, "%s\n", vmentry_l1d_param[l1tf_vmx_mitigation].option); > + return 0; For this one, can you manually change it to this? if (WARN_ON_ONCE(l1tf_vmx_mitigation >= ARRAY_SIZE(vmentry_l1d_param))) seq_buf_printf(s, "???\n"); else seq_buf_printf(s, "%s\n", vmentry_l1d_param[l1tf_vmx_mitigation].option); return 0; > } > > /* > @@ -459,9 +463,11 @@ static int vmentry_l1d_flush_set(const char *s, const struct kernel_param *kp) > pr_warn_once("Kernel compiled without mitigations, ignoring vmentry_l1d_flush\n"); > return 0; > } > -static int vmentry_l1d_flush_get(char *s, const struct kernel_param *kp) > +static int vmentry_l1d_flush_get(struct seq_buf *s, > + const struct kernel_param *kp) > { > - return sysfs_emit(s, "never\n"); > + seq_buf_printf(s, "never\n"); > + return 0; > } > #endif