From nobody Mon Oct 6 11:55:46 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E17B2DCF6A for ; Mon, 21 Jul 2025 14:29:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753108164; cv=none; b=tmbBXkzgVSmuhcTqPxEw9xXqSOmuet2ruaoV7RDhtVK1AuFaq6Pnxp7HcKcw6U3UZY49SQ7DTO0inRviAXeOx0VjwIwaM5ydNCYLNmDNV2r/7Ari+K5BS7jVGsUTbIv5zG62yHUAVF0zU76SQbC5POc2PkQ96T4DtNKDCKx5aSg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753108164; c=relaxed/simple; bh=iHe7cGXyYDxMNCHh98eCdGiCWKtr62no05iRPRviqGA=; h=From:To:cc:Subject:MIME-Version:Content-Type:Date:Message-ID; b=bPsTPw/6TBiNEwcdZ9aXPK4tnrwNQ28ygim1dg4Itl/3zMTFgT64XXYcFDBaDdU87hWptuVXMe4yk6p4M8hhUshCDzrjrcsKUjxQzQZeL5lDnIFA9wE5MunJZXXsC84NBOIYmdLOx6y9lxOLDp/joDJ7/JijgrZ40wtU+hRHi14= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=dbger0zR; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dbger0zR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1753108161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wn/awrDmxUHRt5lmLV5MDEAnIMFXTouB6K/+H1Q/U5U=; b=dbger0zRVEHdi3u608aNa37x0MLwHDy6yFiCxlUDdz0tOJKF3NcrK26UVClYcX0FBeHdOR /+j55ogA+tIGQ2KYoo6zkKHiUAX2fpAufOuZmrduvygvBsZUtLcaxGnLzjYcZdlxykm24V t5sLM+y3LIGrykJda23rilM3YdTcZFI= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-414-WLYSAqGwMsGQSRyon-Gy4A-1; Mon, 21 Jul 2025 10:29:17 -0400 X-MC-Unique: WLYSAqGwMsGQSRyon-Gy4A-1 X-Mimecast-MFC-AGG-ID: WLYSAqGwMsGQSRyon-Gy4A_1753108155 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A2986193E88A; Mon, 21 Jul 2025 14:29:15 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.8]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BAACA1800D82; Mon, 21 Jul 2025 14:29:13 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: Christian Brauner cc: dhowells@redhat.com, syzbot+7741f872f3c53385a2e2@syzkaller.appspotmail.com, Leo Stone , Marc Dionne , linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] afs: Fix check for NULL terminator Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-ID: <4119427.1753108152.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Mon, 21 Jul 2025 15:29:12 +0100 Message-ID: <4119428.1753108152@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" From: Leo Stone =20 Add a missing check for reaching the end of the string while attempting to split a command. Fixes: f94f70d39cc2 ("afs: Provide a way to configure address priorities") Reported-by: syzbot+7741f872f3c53385a2e2@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D7741f872f3c53385a2e2 Signed-off-by: Leo Stone Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org cc: linux-fsdevel@vger.kernel.org --- fs/afs/addr_prefs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/afs/addr_prefs.c b/fs/afs/addr_prefs.c index c0384201b8fe..133736412c3d 100644 --- a/fs/afs/addr_prefs.c +++ b/fs/afs/addr_prefs.c @@ -48,7 +48,7 @@ static int afs_split_string(char **pbuf, char *strv[], un= signed int maxstrv) strv[count++] =3D p; =20 /* Skip over word */ - while (!isspace(*p)) + while (!isspace(*p) && *p) p++; if (!*p) break;