Message ID | 20240211150442.3416-1-d.dulov@aladdin.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-60830-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1974113dyd; Sun, 11 Feb 2024 07:21:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWHH8OpwZS5qEitY14e3TnfLdOmJLXAkgdHGStOXRUYob7xSVroNUtQ/H0wweEyk9JC5dwSGYY8mF4nocRloDdP7q99HA== X-Google-Smtp-Source: AGHT+IHwgHflWOflhQ6Vuu8+7mf61YBmO3krBE8QkL5LLn2OHiOCTkFmwzFFgLEQY1AXlRY55Zkh X-Received: by 2002:a05:6a00:124d:b0:6d9:b4a7:695a with SMTP id u13-20020a056a00124d00b006d9b4a7695amr6037071pfi.16.1707664905028; Sun, 11 Feb 2024 07:21:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707664905; cv=pass; d=google.com; s=arc-20160816; b=tYQYvgYFjisPpqsysz/S0uLZOqKlPdfPH8cYf6Vj0gLjQqo1jOaixE0rSXtDeYIpvB nmubQd/6gvbv0/I1x3s6ncIHBI/7asWZr66poOM614Mvh1Gjz4A81Ja4eawhV7nSBsIE LAcv/b5j2ByxO6xN8taZPcoj9q28BuzcdhXXC9ZwJm3PcRj4TGqS2UcBcf6c9z8X/Xjj pKrLKAxIx81fN8u5S90f6zibmPsm6eQx/eSBL4grJtkrqF7ZiD4yzw10g6CT1N9nl8qE pQQiCty35Ajth2KEh0MwxF9DHGG54QxUAY8cHn9OYozRjNKh+SwthmrhboM+VqIOspWz AdmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=AR7yBZlt6/+55WWVtS/SQrdnWZk7rUL7B3Q7yqxKZSw=; fh=4br743nG7t/Awme7aCuPx1jJ9k6NVJw2LIt2sJw3IkQ=; b=RZAu1sM90xYSRtyhai9W/+LAQJeSHzq/8RscojKxNoEnza8vyFqq8Z6vAdzJMn2Rnn zsDbDLgaB0HZ3FSzXIKHNCIXEUAHCzCwplXql1T6RuSaq9F6wNg1/bMiPwkWkt7Y2G81 kDgUU1bt0W7Ak67jaV6Z06f29Ov3zxkyOEPeXsxVYV/sjrj7FkOo3jGx5asrT3QAQDg5 qQFoJViRGlu0JDQZ3oN5CruIoZdefHqsopy57pXpDX3/wJcPBjWUvg0u2cZjJVncZJ3h FnFimiErO1NWaR0m5ZyrSKIaAEr/EdbTStApB2d3uPpJtqsKBVLIJ5jeQqMkqMNWe3Lo V5Uw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-60830-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60830-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru X-Forwarded-Encrypted: i=2; AJvYcCVRMcO7cXdT5t92E9GNc0Wxj23P1VJGFyP3vwcgJyhMzftOqkhUoVdFXp5cZlBYSJBGoWjqGq0sriGHAmEju3Hfi0ezdA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u17-20020a056a00099100b006e07230e6ebsi3718587pfg.286.2024.02.11.07.21.44 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 07:21:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60830-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-60830-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60830-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 96F22282B43 for <ouuuleilei@gmail.com>; Sun, 11 Feb 2024 15:20:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B42A65B697; Sun, 11 Feb 2024 15:20:17 +0000 (UTC) Received: from mail-out.aladdin-rd.ru (mail-out.aladdin-rd.ru [91.199.251.16]) (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 755DD5B664 for <linux-kernel@vger.kernel.org>; Sun, 11 Feb 2024 15:20:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.199.251.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707664816; cv=none; b=T7QINqEmjpXmmUfal0bcT09A9TZIm4LyydTETVSER4Wgknd6EoPvgln+wU/ORmAUobsVDXnAtW4ckift50JuqvWN+CS7KFv3D88sV6ysSc95ZzeEl7aIQVSFXLXVJ807yM2HeQjSscUS1q2ibCau1BKT5gsTpAF1Yw7H3XpCP9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707664816; c=relaxed/simple; bh=pqT/Yn/f95Jc51h+SeB+Tfid/Y0ml0JoyOXa8k+c3jI=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=nNjlqnoTimzVja3y753tbiEcQxNx2ZXn6lek8ST+0ybihNjITB9BptoZxEDheTaTyxoWYOE2ncCFR4Yj2NwaSnV314KAfO5KH3MKqdAIfi/B/TYC2SlgyyabTQSvMxaw+XTtVvVvIVJ+F+X50DO8eBAp1hvBtz+Poyi2AgL/WmQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru; spf=pass smtp.mailfrom=aladdin.ru; arc=none smtp.client-ip=91.199.251.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aladdin.ru From: Daniil Dulov <d.dulov@aladdin.ru> To: <linux-afs@lists.infradead.org> CC: Daniil Dulov <d.dulov@aladdin.ru>, Marc Dionne <marc.dionne@auristor.com>, David Howells <dhowells@redhat.com>, <linux-kernel@vger.kernel.org>, <lvc-project@linuxtesting.org> Subject: [PATCH] afs: Increase buffer size in afs_update_volume_status() Date: Sun, 11 Feb 2024 07:04:42 -0800 Message-ID: <20240211150442.3416-1-d.dulov@aladdin.ru> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EXCH-2016-03.aladdin.ru (192.168.1.103) To EXCH-2016-01.aladdin.ru (192.168.1.101) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790616435595540906 X-GMAIL-MSGID: 1790616435595540906 |
Series |
afs: Increase buffer size in afs_update_volume_status()
|
|
Commit Message
Daniil Dulov
Feb. 11, 2024, 3:04 p.m. UTC
The max length of volume->vid value is 20 characters.
So increase idbuf[] size up to 20 to avoid overflow.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
---
fs/afs/volume.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 2/11/2024 10:04 AM, Daniil Dulov wrote: > The max length of volume->vid value is 20 characters. > So increase idbuf[] size up to 20 to avoid overflow. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation") > Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru> > --- > fs/afs/volume.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/afs/volume.c b/fs/afs/volume.c > index f84194b791d3..9d0da38bbcf6 100644 > --- a/fs/afs/volume.c > +++ b/fs/afs/volume.c > @@ -302,7 +302,7 @@ static int afs_update_volume_status(struct afs_volume *volume, struct key *key) > { > struct afs_server_list *new, *old, *discard; > struct afs_vldb_entry *vldb; > - char idbuf[16]; > + char idbuf[19]; > int ret, idsz; > > _enter(""); Thanks for the patch. The commit message says idbuf[] is being increased to 20 chars but the patch only increases it to 19. Should idbuf[] be 20 or should the commit message be altered? Jeffrey Altman
Hello! Thank you for the review. Yes, idbuf[] shoulf be 20 instead of 19. I'll send the correct patch in a minute. Daniil Dulov -----Original Message----- From: Jeffrey E Altman [mailto:jaltman@auristor.com] Sent: Sunday, February 11, 2024 8:24 PM To: Daniil Dulov <D.Dulov@aladdin.ru>; linux-afs@lists.infradead.org Cc: Marc Dionne <marc.dionne@auristor.com>; David Howells <dhowells@redhat.com>; linux-kernel@vger.kernel.org; lvc-project@linuxtesting.org Subject: Re: [PATCH] afs: Increase buffer size in afs_update_volume_status() On 2/11/2024 10:04 AM, Daniil Dulov wrote: > The max length of volume->vid value is 20 characters. > So increase idbuf[] size up to 20 to avoid overflow. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching > and fileserver rotation") > Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru> > --- > fs/afs/volume.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/afs/volume.c b/fs/afs/volume.c index > f84194b791d3..9d0da38bbcf6 100644 > --- a/fs/afs/volume.c > +++ b/fs/afs/volume.c > @@ -302,7 +302,7 @@ static int afs_update_volume_status(struct afs_volume *volume, struct key *key) > { > struct afs_server_list *new, *old, *discard; > struct afs_vldb_entry *vldb; > - char idbuf[16]; > + char idbuf[19]; > int ret, idsz; > > _enter(""); Thanks for the patch. The commit message says idbuf[] is being increased to 20 chars but the patch only increases it to 19. Should idbuf[] be 20 or should the commit message be altered? Jeffrey Altman
diff --git a/fs/afs/volume.c b/fs/afs/volume.c index f84194b791d3..9d0da38bbcf6 100644 --- a/fs/afs/volume.c +++ b/fs/afs/volume.c @@ -302,7 +302,7 @@ static int afs_update_volume_status(struct afs_volume *volume, struct key *key) { struct afs_server_list *new, *old, *discard; struct afs_vldb_entry *vldb; - char idbuf[16]; + char idbuf[19]; int ret, idsz; _enter("");