Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp445577pxb; Wed, 18 Aug 2021 06:09:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLyOpaosfSqMKnsdviRcEfzVDL3k13xK59qzDE1tKofblpn33RWmqz3Vzu36eD2rYTFf+g X-Received: by 2002:a05:6e02:5c8:: with SMTP id l8mr6119173ils.282.1629292152710; Wed, 18 Aug 2021 06:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629292152; cv=none; d=google.com; s=arc-20160816; b=aQdSPykMBjCu4PlxTgylqnwrFq8NYOBQkUX6HkNfezq0976LGQ7gDj+j0niBdW6GRJ H0OfQEiyFj7pLWIgblor/s6IhljRMmtSo44TX0ni4CZ6Rsw1E8kQqjIZ7DPZl9t3VpzB kODOVlfBouWH37ZWDFvruxKxbMhg846Ou3wQB56kYwsdmHNYNXB4MVZlDr20NbT04Wu7 5EXjsW3eEEzTtIp28/6O4py8flZlGznP//MLZ2CLlKEdSGVLGcP7BytO6rRvtBWgPwrp Ad+iPoKqxZkQvjZZxB3T+CLR5SWKyZvUCebiJwZUjknlVeta59Rvkb43pf8yKbVUjxl2 fJtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+tNPb1/FPZA9eF7X+TOOmGLZvE3KZSt2M0L0KXp9Ah8=; b=SO4zqPb28D0EQwiigXxg9PjsH+FlTC4JKMYzhn89H6tCQQspF4kQaoLS+H9qUf8UmA uDNozIUcVT4+lp6tlkDZLNeISq6rDW3yuP1s2dgteJMTooR5GY+PzsjXGOIEiMhj8iow JL9UCoea3iLmhPjs/pk2KEeXB844QWvGtuV3/V/pkuG7G8PTDStmN/FUmnqdi/SBRefT wzWEK+387WfRjS7nv7AMgjklRkAyi85FRZxX7oUnmtBCu6rDLzttA/Itq2uDbg3AB8ka Hn3DSm3vXisXsMBxhrXOjlvxSCSFxhurixa6E/cYy9356YDVukde29aGBAHLASvqJZUh iFeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SZR+b95l; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si5498756ily.49.2021.08.18.06.08.59; Wed, 18 Aug 2021 06:09:12 -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=@gmail.com header.s=20161025 header.b=SZR+b95l; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236298AbhHRNIf (ORCPT + 99 others); Wed, 18 Aug 2021 09:08:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234949AbhHRNIe (ORCPT ); Wed, 18 Aug 2021 09:08:34 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4535C061764; Wed, 18 Aug 2021 06:07:59 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id j18so2663248ioj.8; Wed, 18 Aug 2021 06:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+tNPb1/FPZA9eF7X+TOOmGLZvE3KZSt2M0L0KXp9Ah8=; b=SZR+b95l8v5SjC4+pZiDHCcUX+iSblqmeJVM/s+LIVGE0d9M2XKc2eZf83W/VLtwau YV/K9Pr2J8jSXAxTCvF5wwLMSc8jy1rwlr0TiM5c7lmyNSdybD34PCPJXGRbWfhZMG40 /C6GhCo91LCITlZissWVpybP/AUB/Vxecy/5aPbNqmmtACa6T3ivbL83rlLU3G5A+LHf rF5ztA12/gyeoarYk+PXsv3UmoYrmUnCp2ROMX5zee5xAr6Nuyif0vq/u6LOeT5ZwcFQ 9nDpp76bChkZFsI29y0uFkDoajLUMgEmcBWrOeUi7mBItCPNEDeNoZVodoxXcFWFPjjQ +5ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+tNPb1/FPZA9eF7X+TOOmGLZvE3KZSt2M0L0KXp9Ah8=; b=esHKS4zOKWUtbvnXepqXXupcI78LuYQzUmph82znxiddHHyjgbilmw88o7LjHteUY6 58D1RHrUOCxdmBfUs3Uk67y2ABSJb30LxabPFV97K9AZi6dIn2GSyYcyNc3t11cWwY2+ UPjFndSx2KqnwzaN8Gjzx6TjYtLMKwKgSsiny0VmjLmIIy3Bek3cdZjJsS9qtF4qikcX s0GZrJt32q5SrdikBbk2hM4RTzIRXJFKtdWXLasUij33wimK6YwAMny/+IVa6Xoy3UIw lBHAbH4g0cF6jSyX1RxSohmbDspW4y4xoD0eFOenVkM1bhRrkK+Gktyec7N+e0Il+4Fb ihGw== X-Gm-Message-State: AOAM532nJ9DGjAVKErKHMbbzG71W0VrtVnhAn9sykFP3DBGn2vBBWOlZ irC0fM+Xxwhr+qghcwYhFZQcZGd2yaP1DyjE9cE= X-Received: by 2002:a05:6602:2c05:: with SMTP id w5mr6948405iov.91.1629292079292; Wed, 18 Aug 2021 06:07:59 -0700 (PDT) MIME-Version: 1.0 References: <20210818050841.2226600-1-keescook@chromium.org> <20210818050841.2226600-2-keescook@chromium.org> In-Reply-To: <20210818050841.2226600-2-keescook@chromium.org> From: Miguel Ojeda Date: Wed, 18 Aug 2021 15:07:48 +0200 Message-ID: Subject: Re: [PATCH 1/5] Compiler Attributes: Add __alloc_size() for better bounds checking To: Kees Cook Cc: linux-kernel , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , clang-built-linux , Andrew Morton , Daniel Micay , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , Dennis Zhou , Tejun Heo , Masahiro Yamada , Michal Marek , Linux-MM , Linux Kbuild mailing list , linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 18, 2021 at 7:08 AM Kees Cook wrote: > > Clang can additionally use alloc_size to informt the results of Typo. > Additionally disables -Wno-alloc-size-larger-than since the allocators Disables -Walloc-size-larger-than? > already reject SIZE_MAX, and the compile-time warnings aren't helpful. Perhaps a bit more context here (and/or in the comment in the Makefile) would be nice: i.e. why are they not helpful (even if rejected by the allocators). Cheers, Miguel