NetBSD Problem Report #53505

From root@whooppee.com  Mon Aug  6 23:59:58 2018
Return-Path: <root@whooppee.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-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 4B1FA7A1F5
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  6 Aug 2018 23:59:58 +0000 (UTC)
Message-Id: <20180806235955.C4E0430F2C2@speedy.whooppee.com>
Date: Tue,  7 Aug 2018 07:59:55 +0800 (+08)
From: paul@whooppee.com
Reply-To: paul@whooppee.com
To: gnats-bugs@NetBSD.org
Subject: multiple-evaluation issues in bitstring(3)
X-Send-Pr-Version: 3.95

>Number:         53505
>Category:       lib
>Synopsis:       multiple-evaluation issues in bitstring(3)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 07 00:00:00 +0000 2018
>Originator:     Paul Goyette
>Release:        NetBSD 8.99.22
>Organization:
+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+
>Environment:


System: NetBSD speedy.whooppee.com 8.99.22 NetBSD 8.99.22 (SPEEDY 2018-07-25 07:42:52 UTC) #0: Wed Jul 25 13:38:00 UTC 2018 paul@speedy.whooppee.com:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/SPEEDY amd64
Architecture: x86_64
Machine: amd64
>Description:

The operations described in bitstring(3) and implemented as macros in
/usr/include/bitstring.h suffer from possible problems with multiple
evaluations of the macro arguments, particularly if the bit number
argument includes a ++ or -- !
>How-To-Repeat:
Inspect the code.

>Fix:
It was suggested on tech-userlevel@ to replace susceptible macros with
static inline functions, similarly to what is done in sys/event.h for
EV_SET


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.