Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp922588pxb; Thu, 9 Sep 2021 15:28:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX57XLush2en9vEs29iVqyPJAKFFXThOxyubTrZ9bbHWYuGkXBfIS1ZyXxCq3rZE20Muxl X-Received: by 2002:a5d:9ac1:: with SMTP id x1mr4469388ion.191.1631226515178; Thu, 09 Sep 2021 15:28:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1631226515; cv=pass; d=google.com; s=arc-20160816; b=PP/v7sHdVZ5ogOpZGkGRTY6pKaLNK+/J7WQhRY5bMAid1Ej1aLNa+boXGKeBkOBgQq WzWuSg5bo7iu3cDDLIRNkxD9UwGoQtD3Hv2Bj3ARcxq7qMxHLi6WUI9fMxAiXkN/dzpu OmvBPYxLV8KlWOLs/x0wSUyrYA8pRF1T+ZkNVPgnvwE6HfIgMsWl/4tPD/6TuZk2cIzi /M9GcIt2BH3jeCub17feuNRPZjXYIzKveJEppgnjUYB7VEPpZZAouKnbIWs0DXkCfehq 9QMvK9K5MLo2XUsWtYezV2vI0xKXDBz7AVxC4Owy8U06rfWIlR5aoltErSvs1DTtHv8S qa4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=fvfpqeXEFi0Zas0a6uwd6U8NDoY2LcgvIlxU+4C7j2A=; b=ogGg0DWQJwlDi1MOaJGjhNx3KN4VQ8qq0a6UpMd4XNs1B3Dec//Oun14cbXEJMB304 Wh3Ro0XypoEY2Pvsza4DNLq0fhWIQAD6rJJsRL0ry5SKr4bClt4SzUmIQcHL2+VpKiAi EgHJpaS2dmiqrTzKQE5YVG0l/tQzPazUhJtwo6kpjb9OmXdVp0VLkECfPki57bc34BCz I7j5qtGBm5scu5ndF/zQwhh9saVVKfRphRn+ewrApgUqTCk8UKKJqKap72gxDD2Uowmn RK7/phVhymkkv6xW7QCkRm4ro/IDf9B/LPglf8aTS4CcK06Gc7A49q1UyCkuG6QPsCJG mlrQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="oDX/3iHk"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=QUARANTINE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n13si3128102ilo.25.2021.09.09.15.28.22; Thu, 09 Sep 2021 15:28:35 -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=@Nvidia.com header.s=selector2 header.b="oDX/3iHk"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=QUARANTINE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348149AbhIIW2L (ORCPT + 99 others); Thu, 9 Sep 2021 18:28:11 -0400 Received: from mail-dm6nam10on2040.outbound.protection.outlook.com ([40.107.93.40]:43711 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1344005AbhIIW15 (ORCPT ); Thu, 9 Sep 2021 18:27:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QOqZO2MSy4TwRYL/6zg7TysiLB0yk8n5EeV65OZ/VQn2jt5SaWgBrIIHW4dw9olo9MSfa2zFXb2coD1/9K3TVoOdFgR1Dm0Fu9Y1JqC893wQ0ZhlD2HfV3eEaOvsla0Cg1GlP8478IWJKNNv20ccGx5Epjqhd7+ywm5ku94LT2NGcHoWxCMijUwTzIBblcoi/Z3DAFnoTX/4dVUKs1sNrag4wzQR4uwmSF0zCX+j2royZqvnN5vvQY7RCUoOTIDKhainzY/GAdvuuOdUY5UKzr7+rWmCdynET86rM6KWkPxXdvYX853tsdIkRxXeYwzs9er+a+tDsuid9C0WC+F8OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fvfpqeXEFi0Zas0a6uwd6U8NDoY2LcgvIlxU+4C7j2A=; b=BhaSUMfLD8zp+qS/IEb+ujRuG1/5Pzm6YU4wE74LeUMqLeI81CDBqiQD3M4Nxu6HazoEAKIgVqKUBOpD/NWqpzrA4sLb8Di8ZlhGdXaNOuq5kkhW+KIxprnTQmMg4ouvScZ6Yi24F+vvsjhzl0y3VQAqiXlNzgCOsKpgoZJfClxuS9f6KIU1bR2OC3mj23OaZUs7V2z1ISQicRN83+I42r+7LoO1dBVuq2UFwIMDXulLg53HlFuwwObfiSKYEWYkNtC9oBsHagVdLVwpPKcP4uG6JDOSzOD+mu7tTkWPc1TthzMcUsa5xQwKMdz9E2U/LlCdNffEriQDRf5bY3VOxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fvfpqeXEFi0Zas0a6uwd6U8NDoY2LcgvIlxU+4C7j2A=; b=oDX/3iHkPh/GsHeAG6gW7hKznIsrE3vukmlsbbwZ4lT8QKQ6rWaI4g1OkaDYzZPVWpQf712x5G619wuQT6TA8dpsp2oTKGTGS4LxUwxLL1M+JtDU8AjrWxZG6jgkXFado6o4fxnOzhRGmeZrTwS7Fj0omA36vebAIXhA1GDOrNViV0XlsPCuqpcvKciSnkJGdAe+7O/lzPWsMCMM0s5ENjhmxfzxuNvkFAzDzP4542Q0b8Fm9HsXxL4toeZxqwaAEqXV/jToSn+hwTu8Oqo0D+GtMyPlkfq7aKCzcioo06a//0/Af3OgAEjF2BBRssVE3KQv+LpiMhBbQFeMRy8HFA== Authentication-Results: linux-foundation.org; dkim=none (message not signed) header.d=none;linux-foundation.org; dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by BY5PR12MB4967.namprd12.prod.outlook.com (2603:10b6:a03:1de::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Thu, 9 Sep 2021 22:26:45 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::6811:59ee:b39f:97b9]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::6811:59ee:b39f:97b9%9]) with mapi id 15.20.4500.016; Thu, 9 Sep 2021 22:26:45 +0000 Message-ID: <5cdc5c42-e218-7be5-a2e9-2c412bb8a840@nvidia.com> Date: Thu, 9 Sep 2021 15:26:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH] rapidio: Avoid bogus __alloc_size warning Content-Language: en-US To: Andrew Morton , Kees Cook Cc: kernel test robot , Matt Porter , Alexandre Bounine , Jing Xiangfeng , Ira Weiny , Souptick Joarder , "Gustavo A . R . Silva" , Dan Carpenter , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org References: <20210909161409.2250920-1-keescook@chromium.org> <20210909132752.4bde36ccf50720e56160f00c@linux-foundation.org> From: John Hubbard In-Reply-To: <20210909132752.4bde36ccf50720e56160f00c@linux-foundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR05CA0065.namprd05.prod.outlook.com (2603:10b6:a03:74::42) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) MIME-Version: 1.0 Received: from [10.2.91.202] (216.228.112.21) by BYAPR05CA0065.namprd05.prod.outlook.com (2603:10b6:a03:74::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.9 via Frontend Transport; Thu, 9 Sep 2021 22:26:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 24d5d93a-5099-4ef2-865c-08d973e0e825 X-MS-TrafficTypeDiagnostic: BY5PR12MB4967: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mw3LLq6sw86FYnqYGP5bovcVi2tp46EnBVvcAK8+2FStWzP5BhpRc/EifYMdnlzBc8lT4s/X7WJGj6+Nwb61xOSiueNWMSnP5gY1DC/OwqMqBdOWtQN3K9vu9hCw8f23G8izo2urbeystFXf3BrM7gcahptsTr7lfBgUQ52Tfb6EvhV/+g3zCdZRt5FoVZNVzgXRqh/ijUFTfTiM0Mf7scYrVhKseLh5QeFMvbdhfPb49j2awYY6WOTEyABmgNO1r97rSUsUBRjTdP2sRcNX4LguI+Lyy9mqtiBXO4ZT8NT8gIEB9sdMV3fnoTo7XZWlNdn+lPb5tdqJPNLl779iG7gST6KKmUbje68qLdxeRzwBZZkcPXlDvE4Df26Q6t64jYenW7tyncpukL8yvq0qyv3Hyt8mKlRKWk4JOsa9pcxE5V4tauMA85VE4juyY6C8V0V9Ku1GuIHG3gAN4XabuSkVycdZxppBJwdlwZk1DJqqMn0PQUlDDUjCLcyhZAvU49dWVQnwvbsB+cg/aRMD15uAhC8Q1PIEckxYsadseuMCOm1nxLC/rFdmGmyHQR0EhIRDznJWQZ3yrdPgOaWEkCcDf9fMGX66qvPk/DCTFW+qz0Yo93mS6pE9lRzEvFFyaF8Px/KdjvPS+naUde3+XtNrujLYVnpQdxH38rKaLO/BQcKSvI42lvGDx8xup8FayjN0m3cJl6ISE8F9xykgybv088RH6neRc3yHK2sSMY4btBiskH2rN2kNkoJXHebL X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4130.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(346002)(136003)(39860400002)(396003)(366004)(38100700002)(31686004)(86362001)(31696002)(186003)(26005)(5660300002)(4326008)(36756003)(8676002)(8936002)(478600001)(956004)(2616005)(7416002)(53546011)(66946007)(2906002)(6486002)(83380400001)(54906003)(110136005)(316002)(16576012)(66556008)(66476007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MmF2b3RzYVVtY3JRUFpyWEFwdG5BVlRnMXc3Z3F3NHdpNjdDbmI2SkRwRUtN?= =?utf-8?B?emt1MEdnQ0RaSTg1LzIrRVFFNkJIVW9VQUhpMjhuYThkTjZVOU5NVmFhRlR0?= =?utf-8?B?VVhPUFZvc3YxSlZLekR3aWFRdk1LaFoxaFpIeTFpZWkzRDcyZndKWWVRVmhv?= =?utf-8?B?MDlQRUtFaVR5SS8wQVZremVtdHFjOVAvTllBVHhKOThwVjh2TldqeCtWMUQ4?= =?utf-8?B?Yk1YUjkzVS9tVEFYdjR6Y1NzaUN1RS9PVVJMaGhNbVJTSEFOWmlDQ051b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TVPaDh6cnVTM3l5d2hFVkVn?= =?utf-8?B?NVB4SzFjbVVLL2M2MGZTdENLN2xpZU5QMnRITkEzTUhKbjdUN1IvNStEaFdW?= =?utf-8?B?d2VRNEhldmlQVFBuYlBSQUV4UzN1QTQzaXVaYVFVUk1zV2EwMmx6UGxQeE0x?= =?utf-8?B?S2N0REE4b2Zub2NqWE9TQ0xNTmwwdFZaR1dpYVFpTTlqSFRQUmNKZkNoczNC?= =?utf-8?B?OUxHcmc3ak5kNTJ3azdHNWZ3RXBFK0x1VmRBcGRrSHBIbE05TWZlSWtZUFdz?= =?utf-8?B?a1ZENVdvRVkySC8xcVBnSE56YlNHRnZhNFE2SzZXd29BcTdUenExR1B6WUtG?= =?utf-8?B?YkUxVC9MdFZIdmUxVG9WdUlMSXdRRGFIaW1XaXU0R2Jjc3pnU1FROTVLVVhs?= =?utf-8?B?dXM4V3c1cG04MzBCTk9zWkdoUmkraDFVRDJUVTNiNFJhZnhZNE1DeU4rWUZ4?= =?utf-8?B?OHkxMnZBd3oveG54c1B5M1J2bVVJZEtXVjd6eG5GaHpJUllLMTkyWXYwUmRq?= =?utf-8?B?cHYxVGxUbDd6SWpTRndNdE42eVFBMDJVb1E5YzFVM1JCVCtRY0w4OG1LR3Jx?= =?utf-8?Q?V7kkfJwIEGB/GRHQbxGRdAlGn8s84tWc76KAgi9?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24d5d93a-5099-4ef2-865c-08d973e0e825 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2021 22:26:45.5343 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9L3KYQHA6XIfePbSWZSKF15PSWrCZNkaOrXtNApwvj2yH4B7W7Cz+5fvATRbFe1Ijx/8txcE+YMXQoWKGE74vg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4967 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/9/21 13:27, Andrew Morton wrote: ... >> 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(); >> | ^~~~~~~~~~~~~~~ >> >> But the allocation size and the copy size are identical: >> >> 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)))) { > > That's an "error", not a warning. Or is this thanks to the new -Werror? > > Either way, I'm inclined to cc:stable on this, because use of gcc-9 on > older kernels will be a common thing down the ages. > > If it's really an "error" on non-Werror kernels then definitely cc:stable. > It looks like a hard error, not a warning upgraded by -Werror: I did a local repro, then ran with V=1, removed all -Werror parts of the gcc invocation, ran again, and still reproduced the error. I also verified that the patch causes the error to go away. Also, I can't find anything wrong with the diffs, so: Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA