NetBSD Problem Report #57951

From gson@gson.org  Tue Feb 20 07:46:29 2024
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A36C21A9239
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 20 Feb 2024 07:46:29 +0000 (UTC)
Message-Id: <20240220074623.C19B62546A9@guava.gson.org>
Date: Tue, 20 Feb 2024 09:46:23 +0200 (EET)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: lib/libutil/t_snprintb:snprintb test case fails on i386
X-Send-Pr-Version: 3.95

>Number:         57951
>Category:       lib
>Synopsis:       lib/libutil/t_snprintb:snprintb test case fails on i386
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 20 07:50:00 +0000 2024
>Closed-Date:    Tue Feb 20 20:00:50 +0000 2024
>Last-Modified:  Tue Feb 20 20:00:50 +0000 2024
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date >= 2024.02.16.19.53.40
>Organization:
>Environment:
System: NetBSD
Architecture: i386
Machine: i386
>Description:

The lib/libutil/t_snprintb:snprintb test case fails on i386 since
this commit:

  2024.02.16.19.53.40 rillig src/common/lib/libutil/snprintb.c 1.33
  2024.02.16.19.53.40 rillig src/tests/lib/libutil/t_snprintb.c 1.20

For logs, see

  http://releng.netbsd.org/b5reports/i386/commits-2024.02.html#2024.02.16.19.53.40

This failure did not get an automated report because the test was
broken, fixed, and broken again twice in quick succession, which
caused the test framework to mistake it for a randomly failing one.

>How-To-Repeat:

Run the tests on i386.

>Fix:

>Release-Note:

>Audit-Trail:
From: "Roland Illig" <rillig@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57951 CVS commit: src/tests/lib/libutil
Date: Tue, 20 Feb 2024 19:49:10 +0000

 Module Name:	src
 Committed By:	rillig
 Date:		Tue Feb 20 19:49:10 UTC 2024

 Modified Files:
 	src/tests/lib/libutil: t_snprintb.c

 Log Message:
 tests/snprintb: fix out-of-bounds memory read (since 2024-02-16)

 Before t_snprintb.c 1.20, the buffer size was required to be greater
 than zero. Allowing the buffer size to be zero led to buf[-1] being
 checked. On amd64, that byte happened to be 0, on i386 it didn't.

 Fixes PR lib/57951.


 To generate a diff of this commit:
 cvs rdiff -u -r1.22 -r1.23 src/tests/lib/libutil/t_snprintb.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: rillig@NetBSD.org
State-Changed-When: Tue, 20 Feb 2024 20:00:50 +0000
State-Changed-Why:
Fixed, thanks for the PR.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.