From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64915C433EF for ; Fri, 10 Sep 2021 17:11:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EA569611C5 for ; Fri, 10 Sep 2021 17:11:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EA569611C5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 4E636940007; Fri, 10 Sep 2021 13:11:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 496506B0073; Fri, 10 Sep 2021 13:11:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 35CEB940007; Fri, 10 Sep 2021 13:11:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0066.hostedemail.com [216.40.44.66]) by kanga.kvack.org (Postfix) with ESMTP id 2290C6B0072 for ; Fri, 10 Sep 2021 13:11:57 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id CBD1639BB3 for ; Fri, 10 Sep 2021 17:11:56 +0000 (UTC) X-FDA: 78572306232.24.A4B4CBA Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by imf12.hostedemail.com (Postfix) with ESMTP id 8A59D10000A3 for ; Fri, 10 Sep 2021 17:11:56 +0000 (UTC) Received: by mail-pf1-f171.google.com with SMTP id v123so2412532pfb.11 for ; Fri, 10 Sep 2021 10:11:56 -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=BUpOKTpeqGBNXiZgSUJzUGs/3KYllh5vEBA+EMKJvM4=; b=S7ZkT1nca1Uk/UsTmjpNinLLpdDgZzaOJrjpC3WdL2jxh5+T4cNruI2wzflvYHvBNz Ol+ZEr2IK6tfPyuJtTOYvJ7y532OJP8+ZRdpdS4uIO0iPE+bndcMaFfPtDVQbC02FMEP 8QVyBgEvJiLdix9uwBA14mEfTS0nOYZJQ8gbY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BUpOKTpeqGBNXiZgSUJzUGs/3KYllh5vEBA+EMKJvM4=; b=E1tct+lII1tmGL9esoGZIKg2v89YsMq3HFBv7eMUA3I9KRaiCnDYpeSeKWWItpn054 FRO0QPW5OOMsRpwEodNhskcfLJnG9lD4MmYXSWdH4CvuAIVb8aKgAcP1YscBoiUizTic wxBWaJBZz/n3Z5TH5Hqxa/qmiUgQCLIH+xKhXkGqf/xavL6TvpQNDBuT5RXIVJblKQ1G ECr2JS5HxUqYBHwPiyIisGcYtJnahplO7sKnbmLNyCCHs2lVZjkHthaQQ2hOto0DlsWC NhQAI4y3lQzmmADIzCsCx81AOBY7FxmGyo5sx6PVd46bJwTVMpN/hNucSeqgbP12XtHY blSw== X-Gm-Message-State: AOAM531XgaTo1O4A5s02qcUp5w+xvhR6Ov+iaqB/PIfNhcDNtMP6coGL GJI4787QSPogrkLqDhvPZEGgYMNYaNtbLw== X-Google-Smtp-Source: ABdhPJyim91Duw3Gai6L8yOIdq80u03yzLvVtaZRigmmySbYFZ9pRl8adNetZCMdPRXTacUVd9Jw0g== X-Received: by 2002:a63:5902:: with SMTP id n2mr8195073pgb.305.1631293915032; Fri, 10 Sep 2021 10:11:55 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id h24sm5595297pfn.180.2021.09.10.10.11.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Sep 2021 10:11:54 -0700 (PDT) Date: Fri, 10 Sep 2021 10:11:53 -0700 From: Kees Cook To: Linus Torvalds , Andrew Morton Cc: linux-mm@kvack.org, mm-commits@vger.kernel.org Subject: Re: incoming Message-ID: <202109101009.13A90EBB6@keescook> References: <20210909200948.090d4e213ca34b5ad1325a7e@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210909200948.090d4e213ca34b5ad1325a7e@linux-foundation.org> X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 8A59D10000A3 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=S7ZkT1nc; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf12.hostedemail.com: domain of keescook@chromium.org designates 209.85.210.171 as permitted sender) smtp.mailfrom=keescook@chromium.org X-Stat-Signature: ixnc66knzpictmmf18so1a8q8kn84iwn X-HE-Tag: 1631293916-895000 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Sep 09, 2021 at 08:09:48PM -0700, Andrew Morton wrote: > > More post linux-next material. > > 9 patches, based on f154c806676ad7153c6e161f30c53a44855329d6. > > Subsystems affected by this patch series: > > mm/slab-generic > rapidio > mm/debug > > Subsystem: mm/slab-generic > > "Matthew Wilcox (Oracle)" : > mm: move kvmalloc-related functions to slab.h > > Subsystem: rapidio > > Kees Cook : > rapidio: avoid bogus __alloc_size warning > > Subsystem: mm/debug > > Kees Cook : > Patch series "Add __alloc_size() for better bounds checking", v2: > Compiler Attributes: add __alloc_size() for better bounds checking > checkpatch: add __alloc_size() to known $Attribute > slab: clean up function declarations > slab: add __alloc_size attributes for better bounds checking > mm/page_alloc: add __alloc_size attributes for better bounds checking > percpu: add __alloc_size attributes for better bounds checking > mm/vmalloc: add __alloc_size attributes for better bounds checking Hi, FYI, in overnight build testing I found yet another corner case in GCC's handling of the __alloc_size attribute. It's the gift that keeps on giving. The fix is here: https://lore.kernel.org/lkml/20210910165851.3296624-1-keescook@chromium.org/ > > Makefile | 15 +++ > drivers/of/kexec.c | 1 > drivers/rapidio/devices/rio_mport_cdev.c | 9 +- > include/linux/compiler_attributes.h | 6 + > include/linux/gfp.h | 2 > include/linux/mm.h | 34 -------- > include/linux/percpu.h | 3 > include/linux/slab.h | 122 ++++++++++++++++++++++--------- > include/linux/vmalloc.h | 11 ++ > scripts/checkpatch.pl | 3 > 10 files changed, 132 insertions(+), 74 deletions(-) > -- Kees Cook