From nobody Tue Dec 2 01:04:47 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 0B57C2BE64C for ; Mon, 24 Nov 2025 05:05:04 +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=1763960706; cv=none; b=UZIajNfdhXByIIzm+NCIcAftE+F633bGzZKc0sCjuV6O1V2NkIEVnP49QdVQgju6Z7ag7BecEGkqGPjAKUzNfFOX1pKwPp6LjwZ9dhI0lMSxcnDuiBlAWcq6BrFM4wH5U+AcyBtyklBau4MT+LLg0GIwgBQOmLakhgh4hube6iQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763960706; c=relaxed/simple; bh=jgunH0PsWpK/zSQyPSuaVv0R9gIIlbDMFDceS4blm88=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=AIbPjTPom4/qmf+eRZm5WGPb2iOlKh/LziXGl00of08DEihETN7BeINAVB1W4gSOVipSZVnAJxcvFOs83FPuee39zcDHeJdF3bFsZxm1LBUjnJp0dB+KWFnAj9EhOFqMKaFlEUBdLMo6CsHnvXwythbN7NGW/rcvQkwjGa1o4EA= 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=K9vxleK3; 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="K9vxleK3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763960703; 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=ZARig0mkAfhyVpxziKpIN9dzSGezkpNssMMdRVlHTnA=; b=K9vxleK3IObIUz1KysZbs5zZK5WGbUdzrcR0YR4+LUEFOVoELwLkCxZd7A2r++TXCp+WCb wbd8oOYCwsre+rcGCPjrkO1PMea6V4PwKHLRp6gsEt9jvJ5jgGheWaQBpWGKTLvMXBN6uN pIxfYKDEDjvDjmWrcBQlR66CAr9uNnc= Received: from mx-prod-mc-05.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-212-yT4DBRBiPsS6WRYmBD1DXg-1; Mon, 24 Nov 2025 00:04:55 -0500 X-MC-Unique: yT4DBRBiPsS6WRYmBD1DXg-1 X-Mimecast-MFC-AGG-ID: yT4DBRBiPsS6WRYmBD1DXg_1763960694 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E0F55195609F; Mon, 24 Nov 2025 05:04:53 +0000 (UTC) Received: from gshan-thinkpadx1nanogen2.rmtau.csb (unknown [10.64.136.67]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EC4D619560A7; Mon, 24 Nov 2025 05:04:49 +0000 (UTC) From: Gavin Shan To: kvmarm@lists.linux.dev Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, shuah@kernel.org, seanjc@google.com, shan.gavin@gmail.com Subject: [PATCH] KVM: selftests: Fix core dump in rseq_test Date: Mon, 24 Nov 2025 15:04:27 +1000 Message-ID: <20251124050427.1924591-1-gshan@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Content-Type: text/plain; charset="utf-8" In commit 0297cdc12a87 ("KVM: selftests: Add option to rseq test to override /dev/cpu_dma_latency"), a 'break' is missed before the option 'l' in the argument parsing loop, which leads to an unexpected core dump in atoi_paranoid(). It tries to get the latency from non-existent argument. host$ ./rseq_test -u Random seed: 0x6b8b4567 Segmentation fault (core dumped) Add a 'break' before the option 'l' in the argument parsing loop to avoid the unexpected core dump. Fixes: 0297cdc12a87 ("KVM: selftests: Add option to rseq test to override /= dev/cpu_dma_latency") Cc: stable@vger.kernel.org # v6.15+ Signed-off-by: Gavin Shan --- tools/testing/selftests/kvm/rseq_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selfte= sts/kvm/rseq_test.c index 1375fca80bcdb..f80ad6b47d16b 100644 --- a/tools/testing/selftests/kvm/rseq_test.c +++ b/tools/testing/selftests/kvm/rseq_test.c @@ -215,6 +215,7 @@ int main(int argc, char *argv[]) switch (opt) { case 'u': skip_sanity_check =3D true; + break; case 'l': latency =3D atoi_paranoid(optarg); break; --=20 2.51.1