From patchwork Mon Jun 14 17:58:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12319585 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=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 C9853C2B9F4 for ; Mon, 14 Jun 2021 18:01:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 879F461055 for ; Mon, 14 Jun 2021 18:01:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 879F461055 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GjbUNV0re6+5QdWdzIEarQn++zAgRBYRrtBEx/7Yeqc=; b=sXRRQzW6dQRE3J zhbQLCoWUcBxQODROsjJogmCtQyTE8xFNmMbrFngSx0XHFd13c8J7Fd35GawRm/KdIIuLRqzhB19J 21rH/eYnqKklI3K/qzk0URjiI8MDRkXD9x9Z7hzlvztiri3QeCOZqYoJE3v6nDdp97s662QPLjpyV iXNgFBJCxTBcwfGYPXC5kMyBiFI2d/4SiHyVKq23YDKI9ipMmM8yC/ROWSj5obT8TtjVyxbbfZT/x eIQ8sAi60Y39PsfavBgoOQjaZa3eDCL70D3Lg58B6e6DQzfxrht5TzM0tf3Mv2sKp3dl/mlkogTp7 OmZeT1qm+Kekl40kfilA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsqru-00FZFC-J0; Mon, 14 Jun 2021 17:59:26 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsqra-00FZ9z-Du for linux-arm-kernel@lists.infradead.org; Mon, 14 Jun 2021 17:59:08 +0000 Received: by mail-pf1-x42d.google.com with SMTP id z26so11118703pfj.5 for ; Mon, 14 Jun 2021 10:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tiW1MiNSxVy/hCeNInIQyfBMYNNxInq9UWdM3u/5QaI=; b=BTx5vB111fZfaNJviKToWKnd3s085SfxYJXTUooAQV0xHMl9TbfFaXG4VR8AfuSzgj BWPxer2RaEEJ+iwNC9XrU7RJw/5KSoPmi99RIhsA3GPt1dmnhUYtKi9BS4RTqFQghI9x 8usC2nzVZF2a0LT9Q8OAg6wlladjM9iuBfLMpQlF8S+BKQ3TENgrpra6LFPAt10CAppz k7iP4hviN/s3Mh8Q/OGLsuSixDbulo5J58BbAzkD9GhqsMtkwq72HlkD1rFLdGzlt+zS SsjJuF8RNlZCLsG/8lEieAQeF2dI02L5tu84YT//cPi+JKtFjPAvJDtAVgz3ecrHGYF+ Xudw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tiW1MiNSxVy/hCeNInIQyfBMYNNxInq9UWdM3u/5QaI=; b=owxIifsIn3bLRAuNdLwBnUy5GLzu6E9A0iuK2NWalS0Y97hD4BNwnIfSKiJV4klj5E f+WXCuG2twbQXQLw9IgbktbhCO8p6TrY+3GFPn4gdIE0EYSElPopR0uiPA2H84x82UXE Xr9yMlaX2UZkhQpf5pQe33viZnQbBMmZRbw0aH6pHNukeigQQwJLK0C+1VQvdXpX/JNT ZoHt2geSq/1on1Wp8Ze/kIt2PwZa4Q0b/0GSA0oNWO8bMd4sOR9HSyYH6RH4X0xwxV/K c92ciYCAPnZhKNSajNOF3m2Sdwcp6bfewZegUVFl+TMoSa5i9UmnGUYdgCD6djXnTD5G ExHg== X-Gm-Message-State: AOAM5321tFTeDCNq3yXLKIi0bGUTSaJ/t9fGrZM78Zjw9f6aPUL+y9U+ swa9kqP1tW/dwaYefcT/3BdpxPsbxuymLg== X-Google-Smtp-Source: ABdhPJxuMaCVSzChO1l5VDImulKblryLr0k3o+St1URwrnMhrEzuovCgBTMWXV99yMds5RoaHvKttg== X-Received: by 2002:a63:ed4d:: with SMTP id m13mr18329392pgk.433.1623693545242; Mon, 14 Jun 2021 10:59:05 -0700 (PDT) Received: from p14s.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id z17sm13553246pfq.218.2021.06.14.10.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 10:59:04 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] coresight: core: Switch to krealloc_array() Date: Mon, 14 Jun 2021 11:58:56 -0600 Message-Id: <20210614175901.532683-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210614175901.532683-1-mathieu.poirier@linaro.org> References: <20210614175901.532683-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210614_105906_545830_986F5438 X-CRM114-Status: GOOD ( 12.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Andy Shevchenko Let the krealloc_array() check for multiplication overflow. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210520135041.56163-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 6c68d34d956e..a7971c68b0be 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -1730,9 +1730,9 @@ char *coresight_alloc_device_name(struct coresight_dev_list *dict, if (idx < 0) { /* Make space for the new entry */ idx = dict->nr_idx; - list = krealloc(dict->fwnode_list, - (idx + 1) * sizeof(*dict->fwnode_list), - GFP_KERNEL); + list = krealloc_array(dict->fwnode_list, + idx + 1, sizeof(*dict->fwnode_list), + GFP_KERNEL); if (ZERO_OR_NULL_PTR(list)) { idx = -ENOMEM; goto done; From patchwork Mon Jun 14 17:58:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12319593 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=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 333C7C2B9F4 for ; Mon, 14 Jun 2021 18:03:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC2CF611BE for ; Mon, 14 Jun 2021 18:03:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC2CF611BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dQSrA8VmyNDO0uv+iBpUPfuASzPTmAKYHAbEBitpipM=; b=R4gDzIvu0D1myi lMRSie0hzJ6mmtM6zu+vEDP8pZgwrihlSW4Ov4jJtXkHa8N3qj9rFXQrWpXSX+1ujL0FHTgRbk0bx qASBxwvjTkTJJXN7WMZlkkomypuiiiuWbrf+nJGm6KZxB17MwleZeiGCeFChEJb5dyaaq1te0t8Rn CVmybOScnVuc+Zi0DpKQACBTTtusI44zgPpqA7E8aFIA+WtuOWywBgA1wGEdo3mzzkZ+X2oibgU4q 5ic50jg5uprtwlqK8FWyCGPxNx9F8B0O9JUMt+5Wddlg7eTKKY/PrhmIkIUS0e3k1K/lqsCfwVhKR QjMxv+K8OkpR3MIiOTxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsqtk-00FZrN-CI; Mon, 14 Jun 2021 18:01:20 +0000 Received: from mail-pg1-f180.google.com ([209.85.215.180]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsqsa-00FZSB-SO for linux-arm-kernel@lists.infradead.org; Mon, 14 Jun 2021 18:00:10 +0000 Received: by mail-pg1-f180.google.com with SMTP id t9so9267876pgn.4 for ; Mon, 14 Jun 2021 11:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J+erjNqDrPoL2uchSu9MBs+KDJ5et74963hksVtnp4U=; b=ktjbhTt3lFNJ6ACFxiZ5oXAKXa263kBrdQ7nUNo6fUizS688kNIztupsr8eMphLCNR 98dtW+RZDmdypbhhDT1XEN/3IxDoL09OHy/uTSEp1as92NkfkFvG3TSvqbn0rW4RMU5C 73zPD+M8oQjXyWaFk9K5vI2qO6VTnQibRWE7y+zNkBbwPoIWBRH+Fty9FJTLljJzZslc mijpsxYKBc/p87fe6eZb4Qxx45GiAIc4bet9+3h/nx8udX95OxHnEflfczUBbYExP2EO GGZFnw8Y2JgPw/2xKayNzhlPhNTLcjmm8UuZXGsmEHWP8ytaFh7SwQtH9UqaKgvwoG8g VxdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J+erjNqDrPoL2uchSu9MBs+KDJ5et74963hksVtnp4U=; b=qzJFCs4SJYOE6shASylHs6V88taK+5J00FVW98w84dsaKvPVJ/KLPHB0LnCsxMW3ce mJjrxwX2Mz/DcCUl6GxA3C5IYdjnxAKQW3VP5DxI/0GJJFf5oDVZrD6LEir+iDi8iGxg PaZpG098kwV3vFNnM/jfHapS69uNqZPpzkrA9K8RFmdDgHU71AKeWoffK6FvJgV/8mfg QcX6x05y48MIY/hCW5trJd2Fu+mB+28akdFZ9BH1q2Yac3MKO6wUkWQccx07qM29Eabi 4z9l1v6GBbOqCBowSBsTtSwphkkNxGmBmo3PyUHXlpg4YbOa/pJnir8x/PSJoORSnoZH 56TQ== X-Gm-Message-State: AOAM530ENd1CNtynnpcxlCVP2AMcOv4Udybjy6k3fku2q/U0qZfwIplm PyZxxpXjqijopltl4FaDiuDn/g== X-Google-Smtp-Source: ABdhPJwf6/qYjkPrsRLZtvnEVqB2JCec4VNquyuN+tC3lcaPzyQhoNr9AZXeHvgHdSMAFv9ib5LAuA== X-Received: by 2002:aa7:9ab3:0:b029:2f7:e053:f727 with SMTP id x19-20020aa79ab30000b02902f7e053f727mr118091pfi.74.1623693546772; Mon, 14 Jun 2021 10:59:06 -0700 (PDT) Received: from p14s.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id z17sm13553246pfq.218.2021.06.14.10.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 10:59:06 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] coresight: core: Fix use of uninitialized pointer Date: Mon, 14 Jun 2021 11:58:57 -0600 Message-Id: <20210614175901.532683-3-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210614175901.532683-1-mathieu.poirier@linaro.org> References: <20210614175901.532683-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210614_110008_983294_D8A74961 X-CRM114-Status: GOOD ( 12.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Junhao He Currently the pointer "sink" might be checked before initialized. Fix this by initializing this pointer. Link: https://lore.kernel.org/r/1620912469-52222-2-git-send-email-liuqi115@huawei.com Signed-off-by: Junhao He Signed-off-by: Qi Liu Signed-off-by: Suzuki K Poulose Fixes: 6d578258b955 ("coresight: Make sysfs functional on topologies with per core sink") Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index a7971c68b0be..20ea4aa619f0 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -608,7 +608,7 @@ static struct coresight_device * coresight_find_enabled_sink(struct coresight_device *csdev) { int i; - struct coresight_device *sink; + struct coresight_device *sink = NULL; if ((csdev->type == CORESIGHT_DEV_TYPE_SINK || csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) && From patchwork Mon Jun 14 17:58:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12319587 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=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 36C07C2B9F4 for ; Mon, 14 Jun 2021 18:01:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E603A610A3 for ; Mon, 14 Jun 2021 18:01:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E603A610A3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xUAjFoy5AldNKkMYbN6I4OThAQXU3mVBe/23srEP+Ug=; b=nXXyXK6bMlDxdF SRAbJOZ6TCLSPHxn2cQZkVkGFB0c3MgWbP91wWEpgHnFIBK1prST74b3irzNlngmjMDnBqO7tCKS+ mAxf/KsUxXCKYiF+S4bcJsNHsv81TFzGswKqS/Jg/b9s0pAatZHjTOXvuBC8e58darIzFb5lzwxZW MBKovFZI5Fuu5g7AfyEShzkBRWz9N0ApOy6lhht6q2AvjPGNRl3XR02VTB6vw7aqHwPi2S3ebudgJ n0IqqpDhLB+MJX7R1R1fOKNgwmV36C9+joeb4K6k3vtlsGUi6l07vN+TecI3l9IXLWHPgGEW6b6zk X51z+t/JM6YX4lzOKaNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsqs6-00FZHj-8w; Mon, 14 Jun 2021 17:59:38 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsqrd-00FZAk-H4 for linux-arm-kernel@lists.infradead.org; Mon, 14 Jun 2021 17:59:11 +0000 Received: by mail-pf1-x434.google.com with SMTP id a127so5296321pfa.10 for ; Mon, 14 Jun 2021 10:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h/QDeFjtMgi1HBYFO8EOevMSeBwA/eWvtJzREuD3r1E=; b=mqYEDk2UGTZrPw22kRYjzzFv5rQbTOVIMkM2bha4BgEHZxECOrBuBLVEGFqh9ti/ok /a89zN9cz9ZOd0A58TqBsJKd3oWHG/dDh01pnsiRjFvr4x9oFWIhY6aumI2jgzYXuAa9 mnzHchD++sIUzAbYWdWqcRrr4XpZ2AsaLkND9cvnjza7CAxt5ddVmaRqDkBHDJ9k80Wo VNG4duh+D6x9JkAA31pomcE5H8SDkYN0Fr0dWoFRBTPNKnNA8L6oyGYExE1s8BZC9taU 9Fywz1a+1SfPkg8P98x7HV/dywEAYVPtxaAuoAa6/48h9MLMPkVzF1lg2uxIp+UIvTIa kQRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h/QDeFjtMgi1HBYFO8EOevMSeBwA/eWvtJzREuD3r1E=; b=OgMwIKEsis8Xx8EXJQrUULcoDw7tGktYz0B6/at4Ro22ew3/Qj+Iv2F8E5pBfRBg+f wIEz+H+aFOPonZ7aWojmraZZqFIO3T8639HmqC0cq4S3OOnH6pgjx9cfBGoNglxvCibx i+UQbHIJSnU+ewVVfynGKr4/rOPRzynMEAZvemDhPZJ9TxsbmcLd2R1Cz4Y6Y/DNaSQZ hLyLfAie7j8DzzDz5wvp4W4S9HmU8G2OoSwEDiAifgjQlHGz77djz1WUTDf+GYQJoZa/ k9drYoaMSFIjnmGuysvicRbY17miBVYsWE0co1QKjMepUPlqgv0Lnq8ybDviqKmL0v2z 67Lg== X-Gm-Message-State: AOAM530z0IX1qwrTjo4CdfFjqj8KYbIal5jlULI280inIojWD/+J59qg GhgnkTdKAw5iKgOZRsActOJNNw== X-Google-Smtp-Source: ABdhPJyGO9L0NLxP7Tba9wBBPk0rRxMxgZFZMszfku14D7tcg/6c4VDuU+F23107hhX3RzcmuE9PTA== X-Received: by 2002:a62:8c55:0:b029:2ea:2165:503d with SMTP id m82-20020a628c550000b02902ea2165503dmr264679pfd.68.1623693548295; Mon, 14 Jun 2021 10:59:08 -0700 (PDT) Received: from p14s.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id z17sm13553246pfq.218.2021.06.14.10.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 10:59:07 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] coresight: core: Remove unnecessary assignment Date: Mon, 14 Jun 2021 11:58:58 -0600 Message-Id: <20210614175901.532683-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210614175901.532683-1-mathieu.poirier@linaro.org> References: <20210614175901.532683-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210614_105909_629870_27CCB291 X-CRM114-Status: GOOD ( 11.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Junhao He Remove unnecessary assignment of "path" in coresight_release_path(). Link: https://lore.kernel.org/r/1620912469-52222-3-git-send-email-liuqi115@huawei.com Signed-off-by: Junhao He Signed-off-by: Qi Liu Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 20ea4aa619f0..3cb8680c5828 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -886,7 +886,6 @@ void coresight_release_path(struct list_head *path) } kfree(path); - path = NULL; } /* return true if the device is a suitable type for a default sink */ From patchwork Mon Jun 14 17:58:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12319597 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=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 39B68C2B9F4 for ; Mon, 14 Jun 2021 18:05:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 05FD6611AB for ; Mon, 14 Jun 2021 18:05:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05FD6611AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9qcL4ulpBc319DT4EJwz7406u9SHqLCxLgAle8nJzXk=; b=nE0KUkkWf7JyaH fk3gV+c/PahRnBHfmEAelwQ2dr+VJxPRb8fkglWiWh0L/lO8rzTa9KZALx3ltW5vF7nO0/G5yUJr1 Tli5FwgCWwUbng0M/w8+M1MOPkUGg1af0zhdsLx286eTZenvbOFe/Ato3NPp5EkHceZwX6vgzjWma Lgc1pwjqxiZNdNarVO9bQIeU0udtO0vwpGDOWFcxmdfZ+lZ2GJmMQ4ccF+5cUCKwyEM6ngb/DaYqn vWkDHht368C/gaxCKA+iE7+75EdQB6alT0MeL3RkRGscz/FTdiguUEZ1mOgtPbcpJHLh2o31HxJ91 sBIOaq7EOhkPg7sPSjvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsqvO-00Fac4-4A; Mon, 14 Jun 2021 18:03:02 +0000 Received: from mail-pl1-f179.google.com ([209.85.214.179]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsqse-00FZUV-VA for linux-arm-kernel@lists.infradead.org; Mon, 14 Jun 2021 18:00:15 +0000 Received: by mail-pl1-f179.google.com with SMTP id e7so7000698plj.7 for ; Mon, 14 Jun 2021 11:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CEhJJ0I3n+465SJ2OQg4qV6RTAF3hyu2gH1k9jBoTOg=; b=ORyklIpGZd7xWxuqsxdXJPwiACup5toMdSnvCu5RVrIvVygDCbJV3Oa4UQ4Eekc48E 07DgbCWWq38os9FG8K0I4rvXPe0LV1N9Ub5bhq1q0SIKOm3SiKD14MLaMOtgUaAK5vTm Ca+nHGih5Sq2iJPw0S20YHYcX/Uqr5bI7xh6pLoBvVRNUumcwqb05iqfW2EiTRrtDZB2 vmLyotVaNg22/Knqw2YqifBcfuGQXwUV7PZf5CnUeSS2e87++UwkZucXA+2U+V99bBsE M7OrG+FHlLdpaXFtvxZtsqrDAgjr7UcXLhM6uOjUSFpAu10xaw28YF0F6sjvf1wOy5NM ILNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CEhJJ0I3n+465SJ2OQg4qV6RTAF3hyu2gH1k9jBoTOg=; b=pu9RG6JAPwh/xiDa98/VsrGWPekBZMIwPKwNWjU1mDeV03TxY2w74/4nsDgkn7EO81 GvjoMg62SqE/sccV6RJwXCrz7u2p/9PsYoWMaM5r5lFKJJXD92G+W/mcYjn5ayJyqmM9 ArEEekqb5PYhcqHg47cCmvGo4RHFtmc872FBQt5FQ149KQ6cgQbvxcQ1305Vg8+JMxXm m9+3y+gwe0/bCm/QLWWaQKoPNg3IRzy+sC6BvLNJdIt1fUW4siGV8hAkN9/dzdorkwrI weQ0VDgeSmaSaFcQpU/7uF0kOiscTYcRjOC+shAFlHncvgwHMeQ0bV6RvZEIN7xs4j+V GPCQ== X-Gm-Message-State: AOAM530j8uYPJHQnwxK/vSXey3LHChGdlHSXug/+NFpphKO4uffHDAGJ chnJ39rQwTB1Oog6gUccuhP6PQ== X-Google-Smtp-Source: ABdhPJzROmNgV42dhmtSHXpS9dDJtftzasUha1TC2gZkpg5Ah8QIZsUbUjqKMNMnW2S4ZsplIjq6kg== X-Received: by 2002:a17:90b:1808:: with SMTP id lw8mr19960036pjb.30.1623693549668; Mon, 14 Jun 2021 10:59:09 -0700 (PDT) Received: from p14s.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id z17sm13553246pfq.218.2021.06.14.10.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 10:59:09 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] coresight: etm4x: core: Remove redundant check of attr Date: Mon, 14 Jun 2021 11:58:59 -0600 Message-Id: <20210614175901.532683-5-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210614175901.532683-1-mathieu.poirier@linaro.org> References: <20210614175901.532683-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210614_110013_055712_09B9D72F X-CRM114-Status: GOOD ( 10.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Junhao He "attr" is checked by perf framework, so remove the redundant check in etm4_parse_event_config(). Link: https://lore.kernel.org/r/1620912469-52222-4-git-send-email-liuqi115@huawei.com Signed-off-by: Junhao He Signed-off-by: Qi Liu Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index db881993c211..da27cd4a3c38 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -568,11 +568,6 @@ static int etm4_parse_event_config(struct etmv4_drvdata *drvdata, struct etmv4_config *config = &drvdata->config; struct perf_event_attr *attr = &event->attr; - if (!attr) { - ret = -EINVAL; - goto out; - } - /* Clear configuration from previous run */ memset(config, 0, sizeof(struct etmv4_config)); From patchwork Mon Jun 14 17:59:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12319589 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=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 0CB2CC2B9F4 for ; Mon, 14 Jun 2021 18:02:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B5BDF610A3 for ; Mon, 14 Jun 2021 18:02:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5BDF610A3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rfSiqUX5s82kaBkDqgm9+vGDr5wEKOF+mSCCDqMLv+g=; b=bXAggHui8CjsKr 0mncf1nel5MLyVBfxoRyGjIS2Lzkt9c+sJDb7ArFpmlHAt0y/kk6SSP4SMKLRnXjbjS6YKJnjPigh y93QATd1tGan9EivMsDgCjZC9VlfAEypn0qjNcUFl0g4+g3huUc5E7pBCL2JHDSQkN/dQ7SN3gErN S1oHbsZrpzVi0J/H6yYiwMdA1opy4GJIxZra4n7UCh3jVU7/O5VL1LwOjGaHrejYNFB35+m3Us0jz nVrRvAH8e6rgZ+Mqrq1dmjnFu6Zgq6SDCfGCPV0Abvy/jKKFSVxxn+mmPwWzmtwEEafS0IHg0VdgK MPH622HoTI1p+QfJq7aQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsqsR-00FZOB-EE; Mon, 14 Jun 2021 18:00:00 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsqrg-00FZBm-IV for linux-arm-kernel@lists.infradead.org; Mon, 14 Jun 2021 17:59:14 +0000 Received: by mail-pl1-x636.google.com with SMTP id u18so6372043plc.0 for ; Mon, 14 Jun 2021 10:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ikgWymc1ypzBC+qNXVUU0vzqUyTd66gZ/nAfzMGF6Gs=; b=WY/R0WLaBaiYdlkocqkG/FJRbohR+AMqvPTJBgCgQ6WUpM6WGjKHryGL50t5NkWvsm vMcH1hbSdap6cslA79RfB+rP6Fc2nsooTv9Fbah/pcwb7KaiyIr0RTqlzXX2SPnreISO M6r2ObUm6QdboLUe/Xsmg1vyziPOxsnZSQ8FUxZS3TQkMFiYm2vJ7tlkj5xJb1iVoQ6q k/FYyV8gYGC1iOQSj0xq6w2U0mlqDjyCCZBI0riuo17i4vKea++vngs2XSPoKPjaXVMa UnmI5/8WQ0BpC+Mq9BVZPrmd5tYBXBXV9esqEQSVd+pvT895+vg5+SyfmCSnWUpHUr7W 2Z3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ikgWymc1ypzBC+qNXVUU0vzqUyTd66gZ/nAfzMGF6Gs=; b=ESuY7a3dKy9ZKvsO4IGioN+Gi+keX5BkHv85ONeTXT+KtmHXyD0C7KyXe8X9k8ERba w3bhRCLXYXMt0j4UzEeo0tCehIe0INOClpBglqKlAQHUtWOScPT3VULOLRzhdhjQg/M5 F+BYU84WNU7AiFiwpSJ2O1U2SNeAHNK5jLF/G6r+Jds5lFZBHinZQoqpjcDBU/4zpj32 xm5ryYMXHvyxN+zBC5dIHWNLWf4fT4oBHT5pULWuopv9+V2eGSEJl6wMD0nxiGBnTF4q UxBTTeigNFxJgRgbGDIU46QAD71ZfqTO2Fq0OBv1RomumLjmmUznnqr5zCLecJBUyLxO q6fg== X-Gm-Message-State: AOAM532TTIpdyEtls3D6jcTsdfMJ8FyHgIjy0DQPj0f248WeVeyrgTXM X3K441/BwRrHj8xwQJEklCUwArLauQSkDA== X-Google-Smtp-Source: ABdhPJzgBl1fU+pCey+nzBpjvGIYgZkPno3JTYM2mPOn574FE4xRd5Go9RIDWay2rJHRcRbQPliVpA== X-Received: by 2002:a17:90b:4c8c:: with SMTP id my12mr20698468pjb.13.1623693551409; Mon, 14 Jun 2021 10:59:11 -0700 (PDT) Received: from p14s.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id z17sm13553246pfq.218.2021.06.14.10.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 10:59:10 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] coresight: tmc-etf: Fix global-out-of-bounds in tmc_update_etf_buffer() Date: Mon, 14 Jun 2021 11:59:00 -0600 Message-Id: <20210614175901.532683-6-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210614175901.532683-1-mathieu.poirier@linaro.org> References: <20210614175901.532683-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210614_105912_649597_437A60D4 X-CRM114-Status: GOOD ( 14.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Sai Prakash Ranjan commit 6f755e85c332 ("coresight: Add helper for inserting synchronization packets") removed trailing '\0' from barrier_pkt array and updated the call sites like etb_update_buffer() to have proper checks for barrier_pkt size before read but missed updating tmc_update_etf_buffer() which still reads barrier_pkt past the array size resulting in KASAN out-of-bounds bug. Fix this by adding a check for barrier_pkt size before accessing like it is done in etb_update_buffer(). BUG: KASAN: global-out-of-bounds in tmc_update_etf_buffer+0x4b8/0x698 Read of size 4 at addr ffffffd05b7d1030 by task perf/2629 Call trace: dump_backtrace+0x0/0x27c show_stack+0x20/0x2c dump_stack+0x11c/0x188 print_address_description+0x3c/0x4a4 __kasan_report+0x140/0x164 kasan_report+0x10/0x18 __asan_report_load4_noabort+0x1c/0x24 tmc_update_etf_buffer+0x4b8/0x698 etm_event_stop+0x248/0x2d8 etm_event_del+0x20/0x2c event_sched_out+0x214/0x6f0 group_sched_out+0xd0/0x270 ctx_sched_out+0x2ec/0x518 __perf_event_task_sched_out+0x4fc/0xe6c __schedule+0x1094/0x16a0 preempt_schedule_irq+0x88/0x170 arm64_preempt_schedule_irq+0xf0/0x18c el1_irq+0xe8/0x180 perf_event_exec+0x4d8/0x56c setup_new_exec+0x204/0x400 load_elf_binary+0x72c/0x18c0 search_binary_handler+0x13c/0x420 load_script+0x500/0x6c4 search_binary_handler+0x13c/0x420 exec_binprm+0x118/0x654 __do_execve_file+0x77c/0xba4 __arm64_compat_sys_execve+0x98/0xac el0_svc_common+0x1f8/0x5e0 el0_svc_compat_handler+0x84/0xb0 el0_svc_compat+0x10/0x50 The buggy address belongs to the variable: barrier_pkt+0x10/0x40 Memory state around the buggy address: ffffffd05b7d0f00: fa fa fa fa 04 fa fa fa fa fa fa fa 00 00 00 00 ffffffd05b7d0f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffffd05b7d1000: 00 00 00 00 00 00 fa fa fa fa fa fa 00 00 00 03 ^ ffffffd05b7d1080: fa fa fa fa 00 02 fa fa fa fa fa fa 03 fa fa fa ffffffd05b7d1100: fa fa fa fa 00 00 00 00 05 fa fa fa fa fa fa fa ================================================================== Link: https://lore.kernel.org/r/20210505093430.18445-1-saiprakash.ranjan@codeaurora.org Fixes: 0c3fc4d5fa26 ("coresight: Add barrier packet for synchronisation") Cc: stable@vger.kernel.org Signed-off-by: Sai Prakash Ranjan Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index 45b85edfc690..cd0fb7bfba68 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -530,7 +530,7 @@ static unsigned long tmc_update_etf_buffer(struct coresight_device *csdev, buf_ptr = buf->data_pages[cur] + offset; *buf_ptr = readl_relaxed(drvdata->base + TMC_RRD); - if (lost && *barrier) { + if (lost && i < CORESIGHT_BARRIER_PKT_SIZE) { *buf_ptr = *barrier; barrier++; } From patchwork Mon Jun 14 17:59:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 12319595 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=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 87B5DC2B9F4 for ; Mon, 14 Jun 2021 18:03:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 445F3610A3 for ; Mon, 14 Jun 2021 18:03:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 445F3610A3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ncrsJIZHf8RjHx0bHSbqwLKYF68Gqsb51v+aWYzyqWs=; b=iaXM1DpzYgz8zV tOQODkUQYWKIJWpnAg12GxtrsVjptIrU0nZW9a3yhsXJe6hTiEv16jvvvuwoRukd+p0Qhan1ngjMJ evS/h2E0uShmI2TiAmXz7GFZkdl0z4VUY61LuKq9+b5G6CmsQp3030c+8oBq6AIfKtHsm7fOEfgMC aN/lzZoBHXW9x2zQhJvuYLwcu+So+Kfh4Tdc2YyIw23MWKjFuVqjGd17GvAnN8XO3cKI0hhVlptdi N8XspwBYFPToVK4SIDFP/YWR8mjDohAA1oSrFHrleKIMG44y4PRIwSJK3szBWlyCIyGKJNmpyDSH9 zXe4kGFLNV2LRDQcrdpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsquV-00FaEY-6Q; Mon, 14 Jun 2021 18:02:07 +0000 Received: from mail-pl1-f182.google.com ([209.85.214.182]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lsqsf-00FZUj-PK for linux-arm-kernel@lists.infradead.org; Mon, 14 Jun 2021 18:00:15 +0000 Received: by mail-pl1-f182.google.com with SMTP id u18so6372095plc.0 for ; Mon, 14 Jun 2021 11:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9eYVDaVHYr+Ta9Md8XT/8eZjugfQKObmCTnUfOcer/Y=; b=GCtIlChOWoBbjJ/2yOkYALvlVjU+KxqrqCs0BWuqHB8ai1/8JsSvwpvekPJuHrofDo XdeZ8A+kK1NsP24zuk03cyQK4TuuShldjDlHH4iHMBHWbLuOjXbl1j4+8ybVAFU8orDB zipbuVybVQN2vloxTfXsa/tgbq/QtuQF8lOBYNmAbkpowIqHDmc4RPVhzfiDih64SmhH kdvOXNJZlwimPMf0noHqxZ0S5JunZuGmXDSCsjCwQw8xBLN8QsS5KUzJD5MwugO7UyPr /fODf8JjLECGf3DT6QZQZCCQn8dEJYS3c9AA4sfLAMcAfjUIK3GwALWUDLmmjp26dSKT l9sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9eYVDaVHYr+Ta9Md8XT/8eZjugfQKObmCTnUfOcer/Y=; b=a6Uar9Z7pR7OpMpvKL/JWJPyXD8anPHDUQAd82y/bNUft/MOAv/ebFwnFFZAbWFQmJ 4n55iyNgYwTfU5TylYCoTrLk60r3PX1y6PQBP31C4xWg3wMUNEB9hOFLQ58FJWbTuc3d oB++aCiIGlzbSchlAF8Q0suG/Vs/91bcIoof8bJi+csRb2pC0pIR3YwFW7ThMZep+TIT 9+8CLahu8+pblJDxim4z7Gp84OPGkhSOpwLoAymK4f13IyCWk9vwLHdUiTvTEoPzI4CP RvK9k/NYR2W745Wq+Fy9JGr3jQSv4SqdVK8wh+BVtoRsJKBlnQvJC0iBo8r3lNePoPJ/ 2LZw== X-Gm-Message-State: AOAM530xmmFrj3iao2FuO+I98l+OdLsfs81oD5ZHZtBo3PuKz1Mk/1qi Frlc/xvnhxVtvCYG0zdypwu3VAsL35iwPw== X-Google-Smtp-Source: ABdhPJwZ2MGOf++hgMEBvIo+Qtqd7Lw+Thyr4vk30C4XHf/ksoTZ9RTXTEilGqS82Oyf5ufZ6YAsLQ== X-Received: by 2002:a17:90a:8a0c:: with SMTP id w12mr351959pjn.130.1623693552674; Mon, 14 Jun 2021 10:59:12 -0700 (PDT) Received: from p14s.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id z17sm13553246pfq.218.2021.06.14.10.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 10:59:11 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] coresight: Propagate symlink failure Date: Mon, 14 Jun 2021 11:59:01 -0600 Message-Id: <20210614175901.532683-7-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210614175901.532683-1-mathieu.poirier@linaro.org> References: <20210614175901.532683-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210614_110013_874258_FF7DFA27 X-CRM114-Status: GOOD ( 13.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jeremy Linton If the symlink is unable to be created, the driver goes ahead and continues device creation. Instead lets propagate the failure, and fail the probe. Signed-off-by: Jeremy Linton Link: https://lore.kernel.org/r/20210526204042.2681700-1-jeremy.linton@arm.com Fixes: 8a7365c2d418 ("coresight: Expose device connections via sysfs") Cc: stable@vger.kernel.org Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 3cb8680c5828..1002605db8ba 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -1391,7 +1391,7 @@ static int coresight_fixup_device_conns(struct coresight_device *csdev) } } - return 0; + return ret; } static int coresight_remove_match(struct device *dev, void *data)