From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 D7E41356A2C for ; Thu, 5 Feb 2026 08:54:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770281643; cv=none; b=ho2FbxM6thmpz0fe2jiFs/pWuEjaXcpxSv75Gph2mlby8QUrXmcY1iKuM1vW8QxNWicHnSE4v4eeRl8cbSOPKGDiFXa40ymsUiJDCU6YF9sxVgQEbddYLTLbPHleJ0ZlaOCV9Vr5jodYm1SpoRmWhYei2XTiCI196GYQflQ25NY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770281643; c=relaxed/simple; bh=8Ud5KZqbUXkKx9YEHMMR1n4ewjTIPhDWsP0iGDJn2h0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LHAtlVdu8WM5mqxQSWHlMBf8u37XLG4ESOwfV8PIBTf/bUEsgTmvN2U2zSs0vYJgwwZgLZBKKba6yks9ccKwDmPHcyjWcx+hKDBs3xWNZVxPyBJd1ZI1jsU3nw9B9oXE36DxUlANGMGP5O8xjxvfesxzMx/32B70h5DuCDZhTEo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=SLHPrE0v; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="SLHPrE0v" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-42fbc544b09so706404f8f.1 for ; Thu, 05 Feb 2026 00:54:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1770281641; x=1770886441; 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=WU7C8rJBZ4r5s92pw84UJSyynxDDIXXSUn6SFXmn01U=; b=SLHPrE0v9hoFddecXZuUfFwkCrSk+ryl046M7oEspcwVqlaAud984kz5SqEOHc0zyg fUc0oQAMa5PXWFQMGjFWsygJtx0L8+5nIqFIs2YXdc0bcql6STl6Cw6AYVUZnDFgjHWy efyEph50Z9N0r45A6XAn2fCSsP61sebzAjFVnt73hYl/W6wHkeG4Ok3ZkoxkC+BNIjFr FIxy8oBf6Sd+jrNsGHHU0ufqiZ4KnjdB95a5kU+l19938vRhvSZOOa6sUY9MnCv6PxVR kuoPsBoHyivlk+96UB85qeeD8XSyqGvKQfcogMsEGs6+IIxAgvOsdqx3sIoa4gY7f45S 8Ckg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770281641; x=1770886441; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WU7C8rJBZ4r5s92pw84UJSyynxDDIXXSUn6SFXmn01U=; b=eLfiPMwXKvcar6TTJiKSmR9RJbtK5hWzYEx0PW56//IZzf4FbP/eExgpfAJOizxfkQ fi9u8Oo9ELkIIYf1CvIB3p3FjtfzyKZU6aKAbV6ePrrwhwBHgFiAgokXIyUlAcsGZxse 2lhMhzExid7jsmqBfjKjdAoPuRnYEjMJt74LatKti30Dn0qkVDAMOjV2xsVNMDPpP2pP GZ5EvL9HiCncZI+Bpr39rQ6FkSbviIhJLnbqu3DNkRpbl0gsEo+QQXl7wc+lzXOvBVZR HYzQkGZdv2o0DaEqIH/R5f9hwHNcj7zLRBj0hQI7tWaPw949PcAt56rPXBS0yKYCYj5g 8mBg== X-Forwarded-Encrypted: i=1; AJvYcCUpBVaG/B7KHGCmQ9hcaeRTUWWgwOyOjP/DLsCed0zihJogzYzyRkuW+YZdRf9ncGJ+KYrojohmKDHAwVg=@vger.kernel.org X-Gm-Message-State: AOJu0YyL0m7GiHg/9fY8+ZEH4xEivYQ/amibEOSNOGa7rtkjiBEjNTnE Kbu3DoHlsiekCARFQml4sqNjG7dcoGP6gT7kmJxQXLxJd+gPou3BDuw90MBKl2rALE8XZNfAyfV mWU3H X-Gm-Gg: AZuq6aKK/zAIgWPhq47WuxK28zeqkC4kJO7tXp9q1aB3SPBgYTIXhPpJO2pv/5AsqT0 VXAO2k0qEISfr4KTpwyqJoLF7k1DNjxtSNzNWemBGlG2frTgILATKcf3/smMgPJ9bKonl2oCLVm wV2sT7lU9qqOXPy+R25KT2Ipa/XADpN8gv1hIZ4SzjjEqjc/YJDvWsxuKmKVQEFZpkHvVW2tuoh ET8NJk5hY7c46r+w34/QmAO0TSgwua5WhkJ3qfa1UheiQtUp+ouEbbtCvNInpw7dsO51DAYgiig I+GI6foC7wuexSrbpW2ReXmg7neNKP9d1rWuKDMEmBGe5MluLJQWFQKx9Yk9ucD5MA48G9geTa0 s3cY62sdRRmrRu9rLyY3ovbZb4nnkjboOP7cINm582vCNM3KJsbTLgqH3ZjRTvZXAiefB/ghzLs GvVCAUadRdg1+FpKBnmlYmlwmh X-Received: by 2002:a05:6000:2011:b0:435:9950:ee1 with SMTP id ffacd0b85a97d-43617e37d52mr8503856f8f.3.1770281641118; Thu, 05 Feb 2026 00:54:01 -0800 (PST) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4361805f25dsm13272553f8f.29.2026.02.05.00.53.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 00:54:00 -0800 (PST) Date: Thu, 5 Feb 2026 09:53:57 +0100 From: Petr Mladek To: Arnd Bergmann Cc: Kees Cook , Andy Shevchenko , Arnd Bergmann , kernel test robot , Alexei Starovoitov , Andy Shevchenko , Alexei Starovoitov , Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH] vsnprintf: drop __printf() attributes on binary printing functions Message-ID: References: <20260204132643.1302967-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-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: <20260204132643.1302967-1-arnd@kernel.org> On Wed 2026-02-04 14:26:23, Arnd Bergmann wrote: > From: Arnd Bergmann > > The printf() format attributes are applied inconsistently for the binary > printf helpers, which causes warnings for the bpf_trace code using > them from functions that pass down format strings: > > kernel/trace/bpf_trace.c: In function '____bpf_trace_printk': > kernel/trace/bpf_trace.c:377:9: error: function '____bpf_trace_printk' might be a candidate for 'gnu_printf' format attribute [-Werror=suggest-attribute=format] > 377 | ret = bstr_printf(data.buf, MAX_BPRINTF_BUF, fmt, data.bin_args); > | ^~~ > > This can be addressed either by annotating all five callers in bpf code, > or by removing the annotations on the callees that were added by Andy > Shevchenko last year. > > As Alexei Starovoitov points out, there are no callers in C code that > would benefit from the __printf attributes, the only users are in BPF > code or in the do_trace_printk() helper that already checks the arguments. > > Drop all three of these annotations, reverting the earlierl commits that > added these, in order to get a clean build with -Wsuggest-attribute=format. > > Fixes: 6b2c1e30ad68 ("seq_file: Mark binary printing functions with __printf() attribute") > Fixes: 7bf819aa992f ("vsnprintf: Mark binary printing functions with __printf() attribute") >From the commit message, it is not obvious why reverting these commits won't bring back the warnings in the modified functions. My understanding is that the warnings won't get back thanks to the commit bd67c1c3c353b6560 ("vsnprintf: Silence false positive GCC warning for va_format()") as explained by the original cover letter, see https://lore.kernel.org/all/20250321144822.324050-1-andriy.shevchenko@linux.intel.com/#t It would be worth to mentionin this in the commit message. > Link: https://lore.kernel.org/all/CAADnVQK3eZp3yp35OUx8j1UBsQFhgsn5-4VReqAJ=68PaaKYmg@mail.gmail.com/ > Closes: https://lore.kernel.org/oe-kbuild-all/202512061640.9hKTnB8p-lkp@intel.com/ > Reported-by: kernel test robot > Suggested-by: Alexei Starovoitov > Acked-by: Alexei Starovoitov > Signed-off-by: Arnd Bergmann > --- > For reference, three additional patches are required before we can drop > the Makefile.warn line that currently hides these warnings: > > https://lore.kernel.org/lkml/20260203162546.2254900-1-arnd@kernel.org/ > https://lore.kernel.org/lkml/20260203163440.2674340-1-arnd@kernel.org/ > https://lore.kernel.org/lkml/20260203164545.3174910-1-arnd@kernel.org/ > > Tested using randconfig builds on arm/arm64/x86 > --- > include/linux/seq_file.h | 1 - > include/linux/string.h | 4 ++-- > 2 files changed, 2 insertions(+), 3 deletions(-) Otherwise, the change looks good to me. Feel free to use, ideally with the updated commit message: Acked-by: Petr Mladek I wonder who should take this patch. Should it go via printk/bpf/tracing or another tree? Does anyone has any preference, please? Best Regards, Petr