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 E56553E1CFB 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=1779371109; cv=none; b=CMjaHGAYPou/iqReoV0LdVF64/un8JWtcKdYHwuzw0aqwugYalURJq3+93+2RhqY/5U42NJTt3AL6U9Zfs/g0RONXG6fGhx3ldK6ZX/aIHaNVDcvXir1bGFxFi5ZPmpobBa74mhj8YHzaJYUnP06rwJODMYjtOQrLfs+rSYzsfU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779371109; 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=MK6Gh3ehHV5fRvYY6cf3drIhpr3UNY5HDybUnuPWELI2JnkzIykasgyAQwqewNoXprNul2M+exPOZ74PM0e9YVl6QKdqeYQRH45q4X6cARR68P86t8B3wXDvRW0O1wHG6uF4RupJ4YOTBlV34G07VSU7/uDqO+nVx8MXCBFzhmg= 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=apmH1Wyg; 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="apmH1Wyg" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-c829586e894so3199304a12.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=1779371106; x=1779975906; 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=apmH1WyggEos+GYDtmCU6UwvksL1feePBYzSOJ5L95TUjl2IgzIkjsOrlBLhWHn0iK 0z2UmkKdCTPjIUcJve/SIkIWmc7pd+VdH0jdGlEuQDhSfgRzBXMZl5NMdSsh1g9HmTxu nFvuyqPWF9Ya78KJOvIt2VrnPlMzsG2nOuDKsE21diyTstnyCAiW+s5tm7w9z/oIw5DU VCZclbGcsvk/fXeq5y9QTq6c+JWo5LZk3+btZNdmusOZU9KeC1tu04gbqiYdj54MBYG+ ONoLJtIbthd7xCi1A05VbpcJvT4SAp3a2C4Vrib6lmo3pyVIldCWzX9paUqSZahU68s+ Mnbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779371106; x=1779975906; 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=tF33suSLa+oCaOjtzJeO6Zhhbv53JVTbYvBFTZnM9i19CZ94Qi/L06FPuDBDk1MljM IHagrQsywNGaKOW+C7vnB5a6EsmJf0bAIgAFvp3dS10RSLJzn1ZwnLVN3zExH5GcBqn6 BMrF3tVaIwmavs950jTiOxv8VicYTeNP4Y1Y+rpRDObRmHdPY7Yb2+IcPbX9wLnDQ4ke rFgcxWUOWQlKECLZtRlljZzPagtCy0ofuCZh65T+dUdqfvdUn2yXWAi88hLL/m6UN7pa Uyihysp7yo1ORNppigqVQ9wwFO+m+KeezTRYI55X7unu0utLFPGtc43+rmwI9mw8KLu0 GYlA== X-Forwarded-Encrypted: i=1; AFNElJ+NzXBwrIFe5/EBFdMSqw2jhav9SqQ1dTYpoA9aqtsnojLcygWH2GeeG0MY+vDevaTKtjuxFMk/C+C2hpQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwBHSQY3p6aJrmVb57Rmr93JFw4mZx/D6jN0H7JV9a0vxbLpviB JJPzFEpE9fYeSKj8CCB59iSq6YPNIag0a/5cRIJfJrOb306u1Ychwsf0HePHeo7S3HZOyRPRxfk LsYL5gw== 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-serial@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