Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1875457ybt; Mon, 15 Jun 2020 11:40:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKZBOe3cmWmZ6HMSeEr8u8VB/wYYLgBx+8K+49evUCBEjFIxm4QycuDYCv3L3Ygt4CJxc7 X-Received: by 2002:a17:906:c102:: with SMTP id do2mr26131455ejc.126.1592246414102; Mon, 15 Jun 2020 11:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592246414; cv=none; d=google.com; s=arc-20160816; b=pdx0L2AgliCtZFJDU3UVHtvxAj9N83GP72CVZyxalW1QlWZhArgrEi/vpU7WDMxZH5 ow+ai6UTpl9eKF5m+rBfIBSib08auHidrZ4TL81FFvvsfHugsi8VEzDrK/RFR/FwCP6/ NJfastMe7VLyyIB04TrUP1pNfJWPe3xPIRaNv8DTB3/7w4PEn9ml3HRXSADjSgOWcvUW eStVCACkY/T1fg8CsoUAhHmYl2OCIeiQKyXb6yHFUFqtryWapBrdL10PvuSlJ+5ZmiST u9MDVtcQeEfOoZk2y7teNjg/8L6EuVILpnFuwUDw1EE8JQ0IUazJ1y+H4GbCKuh88ZRd pg7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=BXOExHlseDR5lyHBcXzOZz/wvry3WqelFft9LO6SFUk=; b=h4oxc6gd8cQp9tD67Os0cxf0iAVOwG4v4ufXjD0Vb0edrTTDWepML3sGlPw1yZodLh G9+GE38WN7BYMiH3HVJDbS8tRk83fxVw+1ggc1mIhMeGnxObxIjAy2lKRbbTp9rG4cUH Unve7YkAUPZm/grV5LZHLmgfeAYNUxn3JtPmr0qdn9pj9R79ETmAS8R6zzTnhgcYg0SD 14BLwNvNU3uGCO9lELfF1iaCBx0h2zrEbDNmy2rsYbK2nhFGHMO9fp+21fk7If000OkJ 5vTE1ZiMaQiPV1XqVp9u+JGCEUNwZjRYt64PCtEhuHtO74VP463yRAO3XOePKsWaNfK7 QKyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dpaWrqr3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si9289860edq.265.2020.06.15.11.39.51; Mon, 15 Jun 2020 11:40:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dpaWrqr3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731354AbgFOShy (ORCPT + 99 others); Mon, 15 Jun 2020 14:37:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729124AbgFOShw (ORCPT ); Mon, 15 Jun 2020 14:37:52 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1353C061A0E for ; Mon, 15 Jun 2020 11:37:50 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id n2so7130109pld.13 for ; Mon, 15 Jun 2020 11:37:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BXOExHlseDR5lyHBcXzOZz/wvry3WqelFft9LO6SFUk=; b=dpaWrqr3z78F+xpH0gnmbE6vvjL2dNQiiHQAgD5yKHAMh27qX8+aCvXaXKOUToLdIQ sh6A1RfFFvXRlslq5iAHx0a6Zv8quHnCskDIV9U6gjU/arpkc0c7br21WbGk78B6ho1g 7YcMndA5241LA3xc2qlIfpxX1dol0YzIPnDHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BXOExHlseDR5lyHBcXzOZz/wvry3WqelFft9LO6SFUk=; b=YAbn5zDozGZz0LeQhEtcErz5IPUWr9PBDLDn0PaMBZ/CsDbBtHxWFbSkmFpULzkRdg iQFhpzj15oKGZfRLSZtGne/x5CTDgOZ8cNYrBLbt1RUcDWExL2pOT1EAvPmljrLdZPbQ Nte5fSX0iUqTJEa+mmduQmxBYXosJu0i2SNnCKRmJotCIpdvc4ICqyrM28DuyU5ZmX03 1x0tEfqCbUHUNhVWG4kYtLbynk1AE2GAt/cHMfx/uA/6hw/yj0kwc1kNTOoshSc+xPt8 PFp84Ksxz5TMe7h9tRpVmVnh9Dv52NvAujdrhkszo7VNkjfDuYIfoOb7WeAaAYOkc4wM QZqw== X-Gm-Message-State: AOAM531UTrp4lyoAJ957WUM84cM/yIIPMzS+uNhZTJqOblZ/qzPAr0mL xaPTOhr8Ul0i4wRnYDDfrd2qBA== X-Received: by 2002:a17:902:710e:: with SMTP id a14mr23411950pll.199.1592246270133; Mon, 15 Jun 2020 11:37:50 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i22sm14427227pfo.92.2020.06.15.11.37.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 11:37:49 -0700 (PDT) Date: Mon, 15 Jun 2020 11:37:48 -0700 From: Kees Cook To: Vitor Massaru Iha Cc: kunit-dev@googlegroups.com, skhan@linuxfoundation.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, brendanhiggins@google.com, linux-kernel-mentees@lists.linuxfoundation.org, linux@rasmusvillemoes.dk Subject: Re: [PATCH] lib: kunit_test_overflow: add KUnit test of check_*_overflow functions Message-ID: <202006151134.36BAA57@keescook> References: <20200611215501.213058-1-vitor@massaru.org> <202006121403.CF8D57C@keescook> <0c9d09065dca0b71466600e68b64142402a98d24.camel@massaru.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0c9d09065dca0b71466600e68b64142402a98d24.camel@massaru.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 01:30:42PM -0300, Vitor Massaru Iha wrote: > On Fri, 2020-06-12 at 15:36 -0700, Kees Cook wrote: > > Why drop the __initconst? > > I removed __initconst because of these warnings below, as it is used > for the kernel during the module initialization, and I do not use the > module initialization in this tests. Does this have any side effects in > these tests? > > WARNING: modpost: vmlinux.o(.text.unlikely+0x131b7): Section mismatch > in reference from the function test_s8_overflow() to the variable > .init.rodata:s8_tests > The function test_s8_overflow() references > the variable __initconst s8_tests. > This is often because test_s8_overflow lacks a __initconst > annotation or the annotation of s8_tests is wrong. Ah, right. I assume there are build modes where the tests don't only live in the __init section any more due to how Kunit does its runtime? (Before all the tests ran from __init via module_init(), IIRC.) > > So, yes! I like it. :) Most of my comments here have nothing to do with > > specifically this patch (sorry)! But I'd love to see a v2. > > > > Thanks for doing this! I'm glad to see more TAP output. :) > > Thanks Kees, I'm learning a lot from you, and as I said privately with > Brendan, I've never seen so much macro in a code. I learned a lot from > it. Heh, yes, for that I must beg forgiveness. ;) The macros are rather wild, but it seemed the best way to avoid a ton of cut/paste code duplication. -- Kees Cook