Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp996310rwb; Wed, 28 Sep 2022 11:45:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yvxMpZsxQUUYP7bKfXRBY+N7Blg3NbWosqrb7nu1ILyXraBQpZaCWeLdwHHnEwXYY0eeT X-Received: by 2002:a50:8d55:0:b0:457:2273:2627 with SMTP id t21-20020a508d55000000b0045722732627mr20608864edt.230.1664390720360; Wed, 28 Sep 2022 11:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664390720; cv=none; d=google.com; s=arc-20160816; b=Z7dz2drMlvYt4aBTe5pZvn7h0h2fKB/DRFmuRu5u9wJ5Bs1N3b5n1J50HBaydJYDz8 d8inVLuhH9lcTJg78u3Kq15ExR1HABy+7H1YTjtnTjwSbJr7CHXkwBX43Dz/noYHv3FR pptXE5pOUlsUMG/qpoNmcg4lsOAjVDs52PiScEZAXBUdVMCwNBdBEfh5GQ4ct0DsSk9/ mD60vCw1nYnPbydjZqhgBFD3nHLRTeRWryzBOSLODT7vqO+vwIksGx3njV+oinGvyYvi zyhq/tnM3Zv5gFQO/JQz3SHhTgmO2geNVCbJKHByvpNFsiIR4f12XYIzVdG0cayhaIf3 Uv4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lg8DJ4PVGf/UE/b9agj2E3jF0biYJ2TzSjDWoqo1nWk=; b=iQhODcVVzn0u7T/yW2jbrXRflIFr+4bxGACKMNTHG5Q41Y04nG+l8HfSDZJmnBRTR1 hYlQW9YJ54v09BJMCbT/xwet46iIM1Iivv8/gujDryVH/xz37dP/eZZ9eO1+qDom+87j glqGA1XG3Ws+M4gYyz5pssaYQWfm8g4/DptL18k72Fjn0q9VGLUvpv058JusTZ2nWxs8 xQPwI74s2WUdIC4P4lDSwy0a7s+kvuSWjrMJ9NTinQLeLn7YTWrWUeCoYtMD3SuAAcJ/ nFnUj3jXR5zrEvbAUhXirqGxa4YCVI8BpnrEEcadRaG5z86ke9RHB7Sv/DR9SUEYgOdB oX2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kX6MiQJJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf7-20020a1709077f0700b00783ac0b1620si7136732ejc.10.2022.09.28.11.44.54; Wed, 28 Sep 2022 11:45:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kX6MiQJJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234666AbiI1SGO (ORCPT + 99 others); Wed, 28 Sep 2022 14:06:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234632AbiI1SGL (ORCPT ); Wed, 28 Sep 2022 14:06:11 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3399E10197A for ; Wed, 28 Sep 2022 11:06:10 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id 9so13170220pfz.12 for ; Wed, 28 Sep 2022 11:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=lg8DJ4PVGf/UE/b9agj2E3jF0biYJ2TzSjDWoqo1nWk=; b=kX6MiQJJ++GzWgnGDgSHhlrCPXkUnTfSWuw5a1vTXKi13Y13VyCmf0QKz9GO79Hl9h lytSSUqbfN/S/Ah/mnF4XU0V59XNaRA/1kXJDF/OU4N76i45SgkcHk4RiaBdM3X11q3P ngv3+AbyQkBAOyZ4Efs1UnxU8fMOnw5TwIofU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=lg8DJ4PVGf/UE/b9agj2E3jF0biYJ2TzSjDWoqo1nWk=; b=uH7IuoMYBR+tbcSCOxYMx10rkrN61DyU2IM6Of7BE66Oa2g0kG/ZDB+fpIVJlHGOaR YzyTPjS6FZ9+kqeXiUCTmkrUIrfQ41QYxglRzaNNtG34gYc6TXZpSXoyGF+8A3ngniZE +NROx+ytJgr48gBYLM6MnIBFvGQJBoi24hs/rEnZh9Wx0MAQhGwjDvhR5z1iwVc6ICb+ x5Oq2MyobyqmClmKky6Bti2u7YPn9NYlhs9LYusKpSd6OMZzMirAmMtwyHbcA9BoSu8o MEyKTi99AkC95RIpO6e4P7XkXkfgFHhXUcrexIXA2EtpKYSfSiQu0QtNYpF664QcH3t7 e+Vw== X-Gm-Message-State: ACrzQf29nF9CQXRJyJh4oy6+jscbmgY4smiEJrkvkFfVJBnYP84reEfm J5apTHhkP/oIPxtbY98fQXjI7A== X-Received: by 2002:a65:4609:0:b0:434:8f0b:5d05 with SMTP id v9-20020a654609000000b004348f0b5d05mr29993911pgq.606.1664388369685; Wed, 28 Sep 2022 11:06:09 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id mt10-20020a17090b230a00b00203059fc75bsm1706643pjb.5.2022.09.28.11.06.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 11:06:09 -0700 (PDT) Date: Wed, 28 Sep 2022 11:06:07 -0700 From: Kees Cook To: Linus Torvalds Cc: Gwan-gyeong Mun , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, mchehab@kernel.org, chris@chris-wilson.co.uk, matthew.auld@intel.com, thomas.hellstrom@linux.intel.com, jani.nikula@intel.com, nirmoy.das@intel.com, airlied@redhat.com, daniel@ffwll.ch, andi.shyti@linux.intel.com, andrzej.hajda@intel.com, mauro.chehab@linux.intel.com, linux@rasmusvillemoes.dk, vitor@massaru.org, dlatypov@google.com, ndesaulniers@google.com, trix@redhat.com, llvm@lists.linux.dev, linux-hardening@vger.kernel.org, linux-sparse@vger.kernel.org, nathan@kernel.org, gustavoars@kernel.org, luc.vanoostenryck@gmail.com Subject: Re: [PATCH v13 5/9] drm/i915: Check for integer truncation on scatterlist creation Message-ID: <202209281102.A86D736@keescook> References: <20220928081300.101516-1-gwan-gyeong.mun@intel.com> <20220928081300.101516-6-gwan-gyeong.mun@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 28, 2022 at 10:09:04AM -0700, Linus Torvalds wrote: > Kees, you need to reign in the craziness in overflow.h. Understood. I've been trying to help the drm folks walk a line between having a bunch of custom macros hidden away in the drm includes and building up generalized versions that are actually helpful beyond drm. But I can see that it doesn't help to have a "do two things at the same time" macro for the assignment checking. -- Kees Cook