From owner-freebsd-current@freebsd.org Mon Mar 15 12:37:04 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CECD557AD6E for ; Mon, 15 Mar 2021 12:37:04 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4DzbXJ5R51z4mQs for ; Mon, 15 Mar 2021 12:37:04 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id B8A5E57B199; Mon, 15 Mar 2021 12:37:04 +0000 (UTC) Delivered-To: current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B86ED57ADF5 for ; Mon, 15 Mar 2021 12:37:04 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DzbXJ4vwJz4mSm for ; Mon, 15 Mar 2021 12:37:04 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 95E2529AF8 for ; Mon, 15 Mar 2021 12:37:04 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f51.google.com with SMTP id q9so2165168qvm.6 for ; Mon, 15 Mar 2021 05:37:04 -0700 (PDT) X-Gm-Message-State: AOAM532ItJK9d+5YHIRZPBOTCQahIdvxRDgX3weRW9eOrQMQwYJ+w1ZF VzeVcyJxNJi4uecSxW97FU69yviXuGEoUFXO3ts= X-Google-Smtp-Source: ABdhPJz6Cbd81hgtM9nxGvj6QTbh+l7XTDuYQEMP2pDlE0EGmI5RGk3bqjhyazV4ot3W+0RkpZp7Hqptt9w3vgjxL7k= X-Received: by 2002:a05:6214:1424:: with SMTP id o4mr10647947qvx.34.1615811824134; Mon, 15 Mar 2021 05:37:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kyle Evans Date: Mon, 15 Mar 2021 07:36:51 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Recent if_wg work: Should DIAGNOSTIC imply KASSERT is available? To: current Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Mar 2021 12:37:04 -0000 On Mon, Mar 15, 2021 at 6:20 AM David Wolfskill wrote: > > For my laptop, the kernel config includes GENERIC, does not have > > options INVARIANTS > > but does have > > options DIAGNOSTIC > > which has not been a problem until today. > > In src/sys/dev/if_wg/wg_noise.c, as of main-n245465-16b2290447de, I see: > > ... > 778 static void > 779 noise_kdf(uint8_t *a, uint8_t *b, uint8_t *c, const uint8_t *x, > 780 size_t a_len, size_t b_len, size_t c_len, size_t x_len, > 781 const uint8_t ck[NOISE_HASH_LEN]) > 782 { > 783 uint8_t out[BLAKE2S_HASH_SIZE + 1]; > 784 uint8_t sec[BLAKE2S_HASH_SIZE]; > 785 > 786 #ifdef DIAGNOSTIC > 787 KASSERT(a_len <= BLAKE2S_HASH_SIZE && b_len <= BLAKE2S_HASH_SIZE 787 && > 788 c_len <= BLAKE2S_HASH_SIZE); > 789 KASSERT(!(b || b_len || c || c_len) || (a && a_len)); > 790 KASSERT(!(c || c_len) || (b && b_len)); > 791 #endif > 792 > .... > > which the compiler helpfully pointed out to me attempts to use KASSERT > without having it defined. > > So: Is DIAGNOSTIC intended to necessarily imply that KASSERT is > available for use? > This is fixed in ff92a03616c5, thanks for the report! Kyle Evans