Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2529621imm; Thu, 7 Jun 2018 12:11:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIBtBe2yAH2cI0DbIu6MGaQjCp8zTWqd11KUuVEClyGR0CJ1rosUmTY3MpaR/tl9SdQwMBY X-Received: by 2002:a63:5f0b:: with SMTP id t11-v6mr2555921pgb.79.1528398690069; Thu, 07 Jun 2018 12:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528398690; cv=none; d=google.com; s=arc-20160816; b=k+whTun+3shvPIefQ45ByGX5lhM7q4SjVl94ULuUvOKUZrZJjudSiIgUEpTc6z8Y0r gqMRdX8aZfwtZHxdnzRk0H4qf9c+L4IJwJlhRyY0Q6meq3vH/ykXT9odAZj6W+tCPppJ Oy5Fpl/Q3LJEggEh6ERhD78q9lCucGkRDd1K7wxxJ27+ogR6m0A9ns+yu2SM6KKo/1lC 7c6sJRIpmPoGSrKSoh+83PLzT+cEU340QAUypDL/u6ETwSGlsVpVWCO4CjLl2bv8I+N+ vEom8TKlfsf62lSOBdGcPP0GL/DWLiYSW32bbqfBWeYm+S3w99oHcFK89Ihx5hVlAcvy Fb2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=YO5ivJAZ5l6YLHqkx2z8lMXXajYZWBoqnkfyWRSA0bA=; b=O8sKukVqBeMJAs6f01hh0puzwvXkD73/G4IxFqvNxDotMxMSY0HjY6e4mrRdluj9Ep jb4p1PdKCwJIvFuGuIkxVFHeVGcscLqMdwL9GTvKCfP8wC8TZF2xVmCXu+faSeclwgDH guka6vHzaV/GSIVgnUk8HFNvp6z7h0JtjvcqElzZi7MYG8S67NT1WgqWhLM3i7EQrBUP ryy2nlVPbmz+xF0vb1l27ZRwO1OMmQ5her/zeuDD2CZ9ee0BPVOaZBQcf3n2PgAK9agp glZm33p4cGRbIT6SUO3F8FK8m6+rh1cly4zmVl3kd7dVNxUNAIM7F5ZbRko+chcxxvYT wHoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=IUSpZ3cB; dkim=fail header.i=@chromium.org header.s=google header.b=Rauq4k3V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u19-v6si37759701pgv.79.2018.06.07.12.11.15; Thu, 07 Jun 2018 12:11:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=IUSpZ3cB; dkim=fail header.i=@chromium.org header.s=google header.b=Rauq4k3V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753971AbeFGSfe (ORCPT + 99 others); Thu, 7 Jun 2018 14:35:34 -0400 Received: from mail-vk0-f68.google.com ([209.85.213.68]:34673 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753716AbeFGSfc (ORCPT ); Thu, 7 Jun 2018 14:35:32 -0400 Received: by mail-vk0-f68.google.com with SMTP id q135-v6so6685023vkh.1 for ; Thu, 07 Jun 2018 11:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=YO5ivJAZ5l6YLHqkx2z8lMXXajYZWBoqnkfyWRSA0bA=; b=IUSpZ3cBtOETsVvcwo1MG+iaH8q54o01H52GX/2EuCRqezJEU9TGMpDaDGI07nMQQR FdKK7qjg0VMuJynTlcDNZR77KHPR1m1xOkiPeNEr7aNhh4o+oggQhWBMXmzat0wL/U+S ucOTPIE4KwOFDp+RaTF5flRdSbHZyK3gTEIJkvmLWEetx2KLPQJHbJtG0ynnhPCHzAxM FrdTPquCip0vsT/pvOcD4wozS4KCtO/bSkGvaETz4B0wMWXAkiNhF/thG5GyC34GO0V5 nSa9W4iA42YJHUYjPVG0tJf6fw5tu8NxPJOD0jdXxiDSxO/YkSSqfodwD/xPA9XL5DIn NH7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=YO5ivJAZ5l6YLHqkx2z8lMXXajYZWBoqnkfyWRSA0bA=; b=Rauq4k3VJfZSgn4qHNUb4VzYO6n2tb6jg+TYc2Pho8s8Ne7hdxy147g+E3Okqa6zKa r1QNAcrDVOtDRVRd8h3Udw3R39QT5j5/2oD85iyPZRNoAFuKF0nXwkI6wBeFUf17afQO 34xoacV8N9yyRN97JKo7Tr5mZ/mhoyERxq1tg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=YO5ivJAZ5l6YLHqkx2z8lMXXajYZWBoqnkfyWRSA0bA=; b=TN8hEQ+8tRG1uHad3MVtdt20yYla2g7Aq0JQhs52b0Yb4EsJleMTzN0MF2n/TlBmD6 ANC8dxYujnbP70zGgfq4GtZqjN3+QlYRCjm0dwgzW3u+UrwO4IfwHEdLH8EFdnzGn1Qd KlhToppcFgNzQdiKprbGGyMiEVaYSc99hGB1C/JYSc9UFk0DbNj2rU1lnwBDZ2O/e2T7 S6L8KJ6MteOoETwSyEge98YpcQAAcKnJR3U16gwcQ4Qg1gkU6VaTtd1LP8fLmcgod0O2 GSMWOYZNQbOkZ+d4tcR42cL6jynzOWlSG8rGAe42j+YuNxeAUkylvjlg1HIYag1FawGo MnQA== X-Gm-Message-State: APt69E0u+/68kXYRqH67LugYqJqKPGVvoBXO+2cC0/dwEIJS372SOwLo Evh9HuIjieDz6WS5UUwWfhRObKanY6btAuOfmA+luCIe X-Received: by 2002:a1f:c10f:: with SMTP id r15-v6mr1901853vkf.121.1528396531707; Thu, 07 Jun 2018 11:35:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1f:a085:0:0:0:0:0 with HTTP; Thu, 7 Jun 2018 11:35:31 -0700 (PDT) In-Reply-To: References: From: Kees Cook Date: Thu, 7 Jun 2018 11:35:31 -0700 X-Google-Sender-Auth: pUBvws_DRNRry9aVaL1-ytPqVVY Message-ID: Subject: Re: sparse warnings in overflow.h To: Miroslav Benes Cc: LKML , Rasmus Villemoes Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 7, 2018 at 4:01 AM, Miroslav Benes wrote: > > Hi Kees, > > sparse (make C=1) gives me this warnings today... > > ./include/linux/overflow.h:254:13: error: undefined identifier '__builtin_mul_overflow' > ./include/linux/overflow.h:254:13: error: incorrect type in conditional > ./include/linux/overflow.h:254:13: got void > ./include/linux/overflow.h:256:13: error: undefined identifier '__builtin_add_overflow' > ./include/linux/overflow.h:256:13: error: incorrect type in conditional > ./include/linux/overflow.h:256:13: got void > > This hunk obviously fixes it, but I'm really not sure if it is a proper > fix. > > diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h > index f1a7492a5cc8..15e55b89e952 100644 > --- a/include/linux/compiler-gcc.h > +++ b/include/linux/compiler-gcc.h > @@ -344,6 +344,6 @@ > */ > #define uninitialized_var(x) x = x > > -#if GCC_VERSION >= 50100 > +#if GCC_VERSION >= 50100 && !defined(__CHECKER__) > #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 > #endif > > Any idea? Hi! Yeah, that's probably the correct approach. If the checker doesn't have it, the builtins need to be disabled. :) Can you send this with a Signed-off-by line, etc, and I'll take it for sending to Linus? Thanks! -Kees -- Kees Cook Pixel Security