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, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 D3C36C433EF for ; Thu, 9 Sep 2021 15:46:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6ED6D6023D for ; Thu, 9 Sep 2021 15:46:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6ED6D6023D 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 E54E96B006C; Thu, 9 Sep 2021 11:45:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E0481900002; Thu, 9 Sep 2021 11:45:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF25F6B0073; Thu, 9 Sep 2021 11:45:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id BC0356B006C for ; Thu, 9 Sep 2021 11:45:59 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 68F708249980 for ; Thu, 9 Sep 2021 15:45:59 +0000 (UTC) X-FDA: 78568460838.17.4D52077 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by imf15.hostedemail.com (Postfix) with ESMTP id 1CA7AD00009F for ; Thu, 9 Sep 2021 15:45:58 +0000 (UTC) Received: by mail-pj1-f47.google.com with SMTP id t20so1663417pju.5 for ; Thu, 09 Sep 2021 08:45:58 -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=xRXdPq9ssCqFrWteufmxFzkkOm1/cC8WhgdmqvyuR8c=; b=LnY0Kxl0nvwdHPR8wxZB1pfWH5Ws5Visi0juYcC3x/gYltaplKSCAARiJwL665V8n7 315vpUxZylR4t2Ve9oW9xUpahId6XqAQ1mhmebTK1HHET+sgMBoXM2XCRiMjVwRHQffU OL0r2bgEzqdpl7Z024d7DekIiNXVLTaFG/2F4= 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=xRXdPq9ssCqFrWteufmxFzkkOm1/cC8WhgdmqvyuR8c=; b=0pUxGH0iQey8kL1K1MKgg7vP6finNLGleUcyP3hoTyJfKMsQUYwsYz2tH2Dk5ucmH7 To9jrOfvnin3/5Q8ntAZ3vQGGHATP3djrVt+G+5uWcQDNcTqmoJ+yf3uvgpEIiLezuxz f7nfNDSN0z0o7JE4npyTtfVTwqC2gRMxCeQGOJeBZy8TA4BrL3rC9KSbebN0s9RYNa5o rzCdf6FY+i3VNbBd9sFfO5NzhpqreNTFxuYA5pA1T5x692GbgBnEpAHURwAWi7Vuwwn6 Ai4OfucS6O4sS+1JzVR1GFBkhT8Nvd8PNB/Hs+uD8fGE96/Kl1SlRLxd3vvwyz1EDcN+ pvBg== X-Gm-Message-State: AOAM531I9Rdk9++L/nhz97ua1QxZFnT0L8T6cDcKuCii7FLY3uVAucE6 CBc5l0BYejGSMxoJcxbIvXwHvE+ckejj4A== X-Google-Smtp-Source: ABdhPJxK7rHKcRXK+yquYRbJByZawcBvL1cedfJQd54NfZI3VZSlShTBv2rMirYMfat9sCNM098Pmg== X-Received: by 2002:a17:902:8a90:b0:139:f0fd:5349 with SMTP id p16-20020a1709028a9000b00139f0fd5349mr3290663plo.53.1631202358145; Thu, 09 Sep 2021 08:45:58 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id r23sm2674354pjo.3.2021.09.09.08.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 08:45:57 -0700 (PDT) Date: Thu, 9 Sep 2021 08:45:56 -0700 From: Kees Cook To: kernel test robot Cc: kbuild-all@lists.01.org, Linux Memory Management List , Daniel Micay , Andrew Morton Subject: Re: [linux-next:master 12105/12116] include/linux/thread_info.h:213:4: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small Message-ID: <202109090843.9E28C97@keescook> References: <202109091134.FHnRmRxu-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202109091134.FHnRmRxu-lkp@intel.com> X-Stat-Signature: ujau38quxuasmm5q7wraon3ko6zeq1ae Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=LnY0Kxl0; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf15.hostedemail.com: domain of keescook@chromium.org designates 209.85.216.47 as permitted sender) smtp.mailfrom=keescook@chromium.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 1CA7AD00009F X-HE-Tag: 1631202358-164456 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 11:49:55AM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: 999569d59a0aa2509ae4a67ecc266c1134e37e7b > commit: f5b1a5d922d3199e0637349239b43aed6c7656b9 [12105/12116] mm/vmalloc: add __alloc_size attributes for better bounds checking > config: i386-randconfig-a002-20200329 (attached as .config) > compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 > reproduce (this is a W=1 build): > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=f5b1a5d922d3199e0637349239b43aed6c7656b9 > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > git fetch --no-tags linux-next master > git checkout f5b1a5d922d3199e0637349239b43aed6c7656b9 > # save the attached .config to linux build tree > mkdir build_dir > make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/rapidio/devices/ > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All errors (new ones prefixed by >>): > > In file included from arch/x86/include/asm/preempt.h:7, > from include/linux/preempt.h:78, > from include/linux/spinlock.h:55, > from include/linux/mm_types.h:9, > from include/linux/buildid.h:5, > from include/linux/module.h:14, > from drivers/rapidio/devices/rio_mport_cdev.c:13: > In function 'check_copy_size', > inlined from 'copy_from_user' at include/linux/uaccess.h:191:6, > inlined from 'rio_mport_transfer_ioctl' at drivers/rapidio/devices/rio_mport_cdev.c:983:6: > >> include/linux/thread_info.h:213:4: error: call to '__bad_copy_to' declared with attribute error: copy destination size is too small > 213 | __bad_copy_to(); > | ^~~~~~~~~~~~~~~ transfer = vmalloc(array_size(sizeof(*transfer), transaction.count)); if (!transfer) return -ENOMEM; if (unlikely(copy_from_user(transfer, (void __user *)(uintptr_t)transaction.block, array_size(sizeof(*transfer), transaction.count)))) { Uhhhmm... allocation size and copy size are identical... array_size(sizeof(*transfer), transaction.count) array_size(sizeof(*transfer), transaction.count) -- Kees Cook