Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp476167rwb; Thu, 1 Dec 2022 04:46:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf4HVZsDjxuG6Ey3kUilUITQTWDqCFnkHKYFYvlLDbmGwwfepTGOzkBYKmYX0jU3qRMMbynt X-Received: by 2002:a17:902:6a86:b0:188:cfc6:31fb with SMTP id n6-20020a1709026a8600b00188cfc631fbmr59539932plk.150.1669898790288; Thu, 01 Dec 2022 04:46:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669898790; cv=none; d=google.com; s=arc-20160816; b=HM7kWhyXJ2SwYChJWbQsfeS2Ki5Tz8bUb13lTkg1HQZNkmnd4pJ2rZi/Oe4pJEEA+7 fgrdqe2qkZA3daHP9PaCCGJXpNxA4vhcwSG2gRY3Xj3YKUoyHY1F/jCg2XGkNEE87sSa uM3AGj4emF2/DRPkbpAyURalF5xfqrmPsAXILIV9Qy4VVKAiSs46bn3GX8VPPTgagtTb P6gzfWYPTEj+BRujmZfKnfozu3vPgfMn1HYi5CYNiro8QWtloBm/pVbVEj+VfVsls9Cy yrAwWSsI2kCDHX6oUIXiGj/Aa9r/imVRfpRX7mCRS+JzylPs/sErV4I0GEh5rbdvr8CM bgqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=o35YdJaFszQepz90vSPHt6PmoQ0SOBopmc9imxmtMi4=; b=OrrmkPhTfUexVZ7SUmcVwmCK0yvoUrLDC3unD4Oi5jymTz1AkjLTI4940n6Gf1ZEwi BWWpc5/a75Aty3JwKaSaZtwE/XgB0o9jxZQRHC/UoeHocajwanVubcFw5CdiNhOYXu8A oVbA6IQJSogOXI7RpHO4RCqIxtUhfyDfZb/z/2USN1eilAAOouKsXrXH8pqBuAQsjuY2 dKn2dJSvFpFEtZcNZQUjqXFWfjVo/bkbMjZ8nQn48Hox5FKR0WS6HgK7A2j9wFsflvIY 7RK7TiLeyw/5XpU1UmFMXwOhsDi3OHsNQmpuMFtUjP8HoHJUs/AuQl9cYbsp520CYTtx 3nkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QGD6d4tS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m1-20020a056a00080100b0057621a30261si1724536pfk.99.2022.12.01.04.46.18; Thu, 01 Dec 2022 04:46:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=QGD6d4tS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230258AbiLAMV3 (ORCPT + 82 others); Thu, 1 Dec 2022 07:21:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230525AbiLAMVZ (ORCPT ); Thu, 1 Dec 2022 07:21:25 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FACDAB029; Thu, 1 Dec 2022 04:21:23 -0800 (PST) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B1ANOfC006098; Thu, 1 Dec 2022 12:21:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=o35YdJaFszQepz90vSPHt6PmoQ0SOBopmc9imxmtMi4=; b=QGD6d4tSFCEEPU7eOuvRDB85ZYZTtpthi1LrnlP9fhsaqDcMSgCarEGrs+FH1mUDP25c WKXWp6mnjfEgy0toM1SS2GON2lKQ+zFGLZHmf6cvG5Qec2fXKbvPhR1g8mEYP8BQHlSq 4CllCTsiQWrZeQ9chG8dB2LAO3ABX8NFhwGgr8b8FlauZsN25z4udiJJmKLqcECZfIA3 JMNsooZrpHcwyl6dkp2FZnNBSatq/e/7/UBoHc7NOOmWD3VMl0ODv3WGvGPiFeFJrWu+ lyT4ERMLamNLVgn5xjwltu4KJbW1eySagiukxL09I9IGOmEqvrD4LP/E+ia43adxNiES Qw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3m6k3qs9nb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 12:21:09 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2B1CL8rB021799 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Dec 2022 12:21:08 GMT Received: from hu-srivasam-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 1 Dec 2022 04:21:02 -0800 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu Subject: [PATCH] remoteproc: elf_loader: Update resource table name check Date: Thu, 1 Dec 2022 17:50:48 +0530 Message-ID: <1669897248-23052-1-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 92nkJW-q8lJX3ix6rnVlv9-0RirJcWu6 X-Proofpoint-ORIG-GUID: 92nkJW-q8lJX3ix6rnVlv9-0RirJcWu6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-01_04,2022-12-01_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 lowpriorityscore=0 mlxscore=0 adultscore=0 spamscore=0 priorityscore=1501 clxscore=1011 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212010088 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update resource table name check with sub string search instead of complete string search. In general Qualcomm binary contains, section header name (e.g. .resource_table), amended with extra string to differentiate with other sections. So far Android adsp binaries are being authenticated using TZ, hence this mismatch hasn't created any problem. In recent developments, ADSP binary is being used in Chrome based platforms, which doesn't have TZ path, hence resource table is required for memory sandboxing. Signed-off-by: Srinivasa Rao Mandadapu --- drivers/remoteproc/remoteproc_elf_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c index 5a412d7..0feb120 100644 --- a/drivers/remoteproc/remoteproc_elf_loader.c +++ b/drivers/remoteproc/remoteproc_elf_loader.c @@ -272,7 +272,7 @@ find_table(struct device *dev, const struct firmware *fw) u64 offset = elf_shdr_get_sh_offset(class, shdr); u32 name = elf_shdr_get_sh_name(class, shdr); - if (strcmp(name_table + name, ".resource_table")) + if (!strstr(name_table + name, ".resource_table")) continue; table = (struct resource_table *)(elf_data + offset); -- 2.7.4