Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp314089pxk; Wed, 2 Sep 2020 01:56:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvSdRrjlUaT+Scf2Hk/XV9WeIxe9CmNLd6XAsBlx02oti9vFMNjUGxJgxhCZ1PAT0QZYAW X-Received: by 2002:a17:906:1691:: with SMTP id s17mr5603414ejd.458.1599036981464; Wed, 02 Sep 2020 01:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599036981; cv=none; d=google.com; s=arc-20160816; b=vdAF0bXGJauT460UvlIt3tpAOpyd4LKxjrWT4Lrh2VyGhrenakFyxqaWnDHTt2LT0Z QRYt6I/hB175KayMG7it8mKNlhWDSiuN6urfI4jBl8wtE90sjqBkw8lSDM9xSJ3H/2vj 1iImXCBobSHksTZJkXeJkbqtHwmM7F/YU/MXIGCEIqg2CvQjC4PlIR43nOeCqzVuV47R N/Lh0k6XVV5rI8e/dGnVQmXuEh2yCYRBR4vhNNdCBj4jHVSOuFT9amfPdePnhybYrvIn lsuaO9Pze6t6R1f95rDRpIv/yC4TVY0KIZY3UhCtUtcBzWQh9BcUbOd5ZYgXbsL4nxaQ /Jug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tvzm5I6fquNPQDZgHFNB1NJBraAsQbXMXts3y6Q0n0s=; b=XUNPbBA7wZS+Dy95qTcETbrZ+YhF2Z481CZ5JNfLa8qLLaY8loHPu8INFo1stXiQ3A t6hSDJ4luGUXe5aXGy+e4estB987SDQTx9ILZq7GV2vzGtYEgYRQ8VNpXsa8vpx4wf7f to0QKbLAl9/H/13rfuC7k7psSabw9GOKkewtOiWFGvpyqw4Dq2wDCxmAtC344KtVoR9X JHmSZ3dVlxwThIrCFiWx3oZKzaTTbyQEV/9xzdLlF2v7/oC/CPd6zRDvYaPFxtyhX8Zh ZxU4jl/SWNnLG9x4370ZzyGeMmdMJilTbpPnv8bw1BoosFFIjuUULRpd74ZKndrLbAZS WTyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="D/qaUEbx"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by2si1592482edb.324.2020.09.02.01.55.58; Wed, 02 Sep 2020 01:56:21 -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=@kernel.org header.s=default header.b="D/qaUEbx"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726226AbgIBIzU (ORCPT + 99 others); Wed, 2 Sep 2020 04:55:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:34724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726124AbgIBIzT (ORCPT ); Wed, 2 Sep 2020 04:55:19 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B990C2078B; Wed, 2 Sep 2020 08:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599036919; bh=5z1uEqG+wAJQOlCy6iqhMsGNezM4SD/VS2ml/uiU0Wc=; h=From:To:Cc:Subject:Date:From; b=D/qaUEbxQYa3Ppmk1WKX9leVTZXUqog3yaeX24dlLIejCvt94c1SPPzlhG8UYsxLx mpu+1bjNMaet0+xS+C6NMTCkz24fL1MQBlwj6w/BOSdHOkURerTP7HJZZ0CDTLhUut +2MH1qPxqQ84SHw0uKssUBkHKzdiAejGPrYOwj3s= From: Leon Romanovsky To: Linus Torvalds , Peter Oberparleiter Cc: Leon Romanovsky , linux-kernel@vger.kernel.org, Colin Ian King , Andrew Morton Subject: [PATCH -rc 0/4] Protect from GCC garbage input in GCOV Date: Wed, 2 Sep 2020 11:55:09 +0300 Message-Id: <20200902085513.748149-1-leon@kernel.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leon Romanovsky Hi Linus, Both Colin in Ubuntu [1] and I in FC 32 are having same kernel crashes while GCOV is enabled. The reason to it that n_fuction variable that should be provided by GCC is not initialized (or wrongly set). This patch is based on the RFC [2] which I sent to gather feedback, but didn't get any response, so sending it to you in proper -rc format. Bottom line, GCOV is broken on GCC 10.2. Thanks [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1891288 [2] https://lore.kernel.org/lkml/20200827133932.3338519-1-leon@kernel.org Leon Romanovsky (4): gcov: Open-code kmemdup() to work correctly with kernel and user space pointers gcov: Use proper duplication routine for const pointer gcov: Protect from uninitialized number of functions provided by GCC 10.2 gcov: Don't print out-of-memory print for all failed files kernel/gcov/fs.c | 5 +++-- kernel/gcov/gcc_4_7.c | 17 +++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) -- 2.26.2