Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp134052lqe; Wed, 27 Mar 2024 00:40:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU7gC4zPwztvUIAuwOfLBNJE8MrCDdNRSNVtiFh8FxoBqv4norbg+hVeOGpMQmUkKzIJ1uJIqPlrwm/2/z7uLYDG8NLJ4GbUr+3zH+rTA== X-Google-Smtp-Source: AGHT+IHK4Lr3JJ2M56+tNVI0qjmy1v59/4Kvfa4NjLfSNsiKSbvb49LGmmWxL+ScNpKavWPSxSns X-Received: by 2002:a50:9309:0:b0:566:aba4:7209 with SMTP id m9-20020a509309000000b00566aba47209mr270681eda.13.1711525239779; Wed, 27 Mar 2024 00:40:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711525239; cv=pass; d=google.com; s=arc-20160816; b=m/HB/PltEmZFWWE3sVoDJZCfsKN4zzuvSbBRxTCT4O0r5Qu87w+tx3FFrWb9lOixe+ MunXlyAgHgf4KStHHW7nCryM0s7ACdRqFnxNjO87uVdf1frZBmTXGs7Rs8ervzDDMtBm cekPV4WWyanfGXklGcRVEQw2E1O46Zx+0+Z1WAotcf/KrptHK+PG+Yx9vdlxJCJBhfHR gcEXfmdv96S1W1md9YHTf7XVndfDXbF2nEigxEKzH0edOFmRt5rFu0WScIwsm49+ydwV o0QVI4aeP3F7QaJ9GuRMwiwZaLMJaVsFzLpV4OW8bmH0hoAMtB0zTq79gpCkdafT8APW 49YA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=thcqS+vw6Usq7MYZ7czl11khcu2wqBEm+Lcfikv4tgs=; fh=RajlQwtyFVx33lxQqXUcEMmd6rJXWGCC4xZuHhuSjAU=; b=CrTvr3FgjPa52540K3wGhg3lUdh6Sw9NXRhG+4eATiG6gF+19Lzql+6E085qv5AZjy ixGuqQiif1gFCb5OBKWxL8sb6JSKNsAuK/rMiagmI/l3f96pq3aQssO1pKnDYjf6uYJ7 OiTK/P6uahYRyZ7kn8q+0L9mSWu0Iytaq0aKPB6WUGr/ZVimr15NCG8LZ6UzaBSVK7AH YeOEFku8R5AQ6w68v7s2h7EJDbfrw2oG5vevF7mw/hx7v+Cm7MvcVi1o/SvbkmKZ5i/Q XEZfjj/NGmU6DhmQMqFHP3s85ol8tF2ZWXG/9c5Y0X0ZDf+oug+ZKI0cQ/rnDQEnpkY5 aHQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=d6Ekj9b6; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=d6Ekj9b6; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=g6A4UAyx; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-120440-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120440-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z19-20020a05640235d300b00568b3e35989si4435870edc.251.2024.03.27.00.40.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 00:40:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120440-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=d6Ekj9b6; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=d6Ekj9b6; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=g6A4UAyx; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-120440-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120440-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5C7C01F292B4 for ; Wed, 27 Mar 2024 07:40:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC65A2C69F; Wed, 27 Mar 2024 07:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="d6Ekj9b6"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="g6A4UAyx"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="d6Ekj9b6"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="g6A4UAyx" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 5F36F2C1AA; Wed, 27 Mar 2024 07:40:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711525230; cv=none; b=hrnBvGWjLN7YghrjMeXqhGWvFHS3X6s6nRVof3psox6osK/H/PR5XPX7GcUbLU20kv8d+QDaUdbkw7dsTn+9LItfr5yqllgLmIqCOqjhw6tTI7NULnIZuLG/4My0N57H+F9fcvJU7+Ng9ZuInA7PBxDscAtS+IwAILNfToEc114= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711525230; c=relaxed/simple; bh=nn2BDOr2BCIekUSUO9oL3jzqNlqdrqYPxziN82NCkrs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=b1zyfsIaEv80jorXs5I9ACIjvGEfNP+YxKEo62ADMeglnBUdCTokDyia2Z2EaPB1xrACWQTpT7gHuPRc8F5Z4Uev0Ojm+9GPzySaZOjEsuJLNGa3HiIl+BRuNelnFNP0pldi/TFir2sUDH7lgeX9S9TkXHP8s8QwNkCPU0OvLPs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=d6Ekj9b6; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=g6A4UAyx; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=d6Ekj9b6; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=g6A4UAyx; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B8A8D60010; Wed, 27 Mar 2024 07:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711525226; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=thcqS+vw6Usq7MYZ7czl11khcu2wqBEm+Lcfikv4tgs=; b=d6Ekj9b6oB4yrYj3hmvCy7RpYniA8W6bBY7viSSwSp33vzrqUqFLbNrNqEUZoQGRmj0D/Y qqh88zp/T2M+7NAIZiuiVSfI0jp5OVb7RR6h/o+o8yR+2iN9nc36P586HPDDaySFeFoh3c mQSH+iosB44feCz9zRfOFMSz4fUiSZs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711525226; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=thcqS+vw6Usq7MYZ7czl11khcu2wqBEm+Lcfikv4tgs=; b=g6A4UAyxG5rVoaC7eyoPyfcwedap2u1OoO4C1B1XWk9zUzJ+xwvwlit02AOLHnfZptL851 6O+Cmw3MCK0KBtDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711525226; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=thcqS+vw6Usq7MYZ7czl11khcu2wqBEm+Lcfikv4tgs=; b=d6Ekj9b6oB4yrYj3hmvCy7RpYniA8W6bBY7viSSwSp33vzrqUqFLbNrNqEUZoQGRmj0D/Y qqh88zp/T2M+7NAIZiuiVSfI0jp5OVb7RR6h/o+o8yR+2iN9nc36P586HPDDaySFeFoh3c mQSH+iosB44feCz9zRfOFMSz4fUiSZs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711525226; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=thcqS+vw6Usq7MYZ7czl11khcu2wqBEm+Lcfikv4tgs=; b=g6A4UAyxG5rVoaC7eyoPyfcwedap2u1OoO4C1B1XWk9zUzJ+xwvwlit02AOLHnfZptL851 6O+Cmw3MCK0KBtDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 245101369F; Wed, 27 Mar 2024 07:40:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 6TiVNmjNA2aZfQAAD6G6ig (envelope-from ); Wed, 27 Mar 2024 07:40:24 +0000 Message-ID: <65576638-2d23-4916-8e2a-84f949d360c1@suse.de> Date: Wed, 27 Mar 2024 08:40:23 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 7/9] scsi: mylex: fix sysfs buffer lengths Content-Language: en-US To: Arnd Bergmann , llvm@lists.linux.dev, Hannes Reinecke , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240326223825.4084412-1-arnd@kernel.org> <20240326223825.4084412-8-arnd@kernel.org> From: Hannes Reinecke In-Reply-To: <20240326223825.4084412-8-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Level: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=d6Ekj9b6; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=g6A4UAyx X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-5.50 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_LOW(-1.00)[suse.de:dkim]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_TWELVE(0.00)[12]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: -5.50 X-Rspamd-Queue-Id: B8A8D60010 X-Spam-Flag: NO On 3/26/24 23:38, Arnd Bergmann wrote: > From: Arnd Bergmann > > The myrb and myrs drivers use an odd way of implementing their sysfs files, > calling snprintf() with a fixed length of 32 bytes to print into a page > sized buffer. One of the strings is actually longer than 32 bytes, which > clang can warn about: > > drivers/scsi/myrb.c:1906:10: error: 'snprintf' will always be truncated; specified size is 32, but format string expands to at least 34 [-Werror,-Wformat-truncation] > drivers/scsi/myrs.c:1089:10: error: 'snprintf' will always be truncated; specified size is 32, but format string expands to at least 34 [-Werror,-Wformat-truncation] > > These could all be plain sprintf() without a length as the buffer is > always long enough. On the other hand, sysfs files should not be overly > long either, so just double the length to make sure the longest strings > don't get truncated here. > > Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller (SCSI interface)") > Fixes: 081ff398c56c ("scsi: myrb: Add Mylex RAID controller (block interface)") > Signed-off-by: Arnd Bergmann > --- > drivers/scsi/myrb.c | 20 ++++++++++---------- > drivers/scsi/myrs.c | 24 ++++++++++++------------ > 2 files changed, 22 insertions(+), 22 deletions(-) > Yeah, counting is hard ... Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich