From nobody Fri Sep 13 15:06:53 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X4yMK3LNBz5V1kh for ; Fri, 13 Sep 2024 15:06:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X4yMK0lfXz4hQL for ; Fri, 13 Sep 2024 15:06:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726240013; a=rsa-sha256; cv=none; b=WWoWD+Zma9aiv67CLb2tpGjPuyJWOgnBzmsE8hH3l1m8O+XDY19AhJw1wLxEEX/IvbMryG wckojjkAZ88XD/Ju0uV8bGAgQP5II6iigwTqYHiMXBOKCXlVG4UF2yb32mV6wmSDBIeCUq 92WKE28jaC5mtY/LPv8pwjPLeN3Xwhx5yqmtdquLoKs1blDMcWk3h5gaRmuFWzrQiqpFbs Plvt1w3zHRrgk0QAeVTWA9NOW5cZxFqWw7iEGkMf23yXbSZmJGbuaFBp/MDeeOVsj2YoKa RJQTAKKx8GRsKGDUNjVtDH9y7EoxWaK94JTHdjEN9eYlEABpRUp8yiJ6syFFPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726240013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ggAggoKWzRfmv82yMXhWKTG+LjzjrvRjFzNDBJGtNmA=; b=ZJAEd4vsoEvLXkhHDfD9hvnYV6o8QhXybolazyAhD3Bwthc2Dm0U6XOiqMwRhov9zaRFpG pXNOdmVUaqFpGxqGfjOYH1tKH7nvuE+RX/2agE3JKSiwrx8VyKfSK9ajGP+/cChnjn3TUt AaBtZk50PGRXSy8KKxT/3KEIcXVdeI2fuxeHN4A5yzN1Tt/SXqV/kvb9X/VG8iDFArIg2c YYP5TUyU/9it7RgFjNPvL+wHJhjbQVlRg95miOg+4YpIZjHj5enaX1gqDk4wxgRBNQ01fR oV6L/FJ3lA8txKxd5MFBa4cf8va6Y4OX+318+HogUidJg/c/miOSWF9Ztv7q9g== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X4yMK0FHBznQ5 for ; Fri, 13 Sep 2024 15:06:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 48DF6q4i034087 for ; Fri, 13 Sep 2024 15:06:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 48DF6qrS034086 for bugs@FreeBSD.org; Fri, 13 Sep 2024 15:06:52 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 281483] [librt] timer_delete segfaults with incorrect timer id Date: Fri, 13 Sep 2024 15:06:53 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 14.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: luc.techer64@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281483 Bug ID: 281483 Summary: [librt] timer_delete segfaults with incorrect timer id Product: Base System Version: 14.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: luc.techer64@gmail.com Calling timer_delete from librt with an uninitialised timer id causes a segmentation fault. As I understand it, "timer_t" is a typedef for "struct __timer *", so calli= ng=20 "timer_delete(0);" should be equivalent to calling timer_delete(NULL). In t= he timer_delete implementation, there is no NULL check prior to dereferencing = the provided timer id causing a segmentation fault. This also causes timer_dele= te to segfault when called twice with the same timer id. It would be more in line with the documentation to return -1 and set errno = to EINVAL in these cases. Invalid values for timer id other than NULL cannot be checked with the current implementation, maybe an API rework would be neces= sary to fix this ? --=20 You are receiving this mail because: You are the assignee for the bug.=