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 58C132D9484 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=mDXuNZmXwNeXX/V7rAAG3hDS/wUoCc6VENhn0B71/xTZKcHMQGXVJmhn1ux5wbOyLHmYmmohx0mvxOV51+COYuPUvmXIpfCPLyYDXTIhcu9pjjldJ7Gmz4JtG3QPMzBuA7fC38bVTtFte4FMQWsfxYsef485BPI9zPUp2FCiHPE= 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=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-c828b1b7fddso3492904a12.3 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=n17snL+5Zk4V4plZlOy+5S4a1CRaWemMSqKGXyNkDgaNcRr9w6vSERcfIOSO04WE+0 AQhHypRMjIebrfHQ/Tg9CooxpIaSxnpccp7sdrnqeyXwJP2CMsSKd7GIi+/M76CEg6es QHuVNjqm1MBmh1xTC6nH5A9mZ+aooYHN814TQHu92r0irhbcCfTlygUrGfv/xTsXVMAU 5RJaDxSYcUvgxtziV/AWgag+sH0t228smiFmYZf7khf+7m1mvBu5FKHimUKR7FnpIfOm oxkzz3Dv3Y75ct4gkoaG72r0Z/rdoaa80IYPGsA4G+jCn2c2qIm8qjheU82yiyFkaw9X iu7A== X-Forwarded-Encrypted: i=1; AFNElJ89vjP1Bwzgb2wPHqe6MPM3AlPuNf238U5dEc+4F49dW4a3fJBgR2ihnav+1zchIFlvSu/anCA=@vger.kernel.org X-Gm-Message-State: AOJu0YxFSiH9zMIe11HdmUgFZv17af9rHXBuAGnkBNfUTvsImI7Ra5BN BMmMWXNJor37/cRhG3j0JEGbjN0DMocMU3KT4LDo3I8K0aBTioX5OBDzSBAQ113nFOhY/+P1lFK 5bW9EZA== 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: netdev@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