From patchwork Thu Dec 1 12:20:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivasa Rao Mandadapu X-Patchwork-Id: 28350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp233042wrr; Thu, 1 Dec 2022 04:31:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf4jGq3XSr2w3C2NlFaifSieNh3xtwsGv9O9NB0RTFGis66tyl0XG8ERWqrwgCGF8thw8DTP X-Received: by 2002:a17:90a:2b8c:b0:212:f4f1:96ee with SMTP id u12-20020a17090a2b8c00b00212f4f196eemr78149950pjd.72.1669897912486; Thu, 01 Dec 2022 04:31:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669897912; cv=none; d=google.com; s=arc-20160816; b=VaCbfBZ25pHZdK0OKjVRHomLDKrHFrm4YKGgyJv6G0LIyh/lKNJKFR2bmNRCI+RCx1 Slvtb9KCapushnLpUaoPA/ZOoI3atL8eSWgUqnzT6QsZs7+wN/EPJiOSax4kdLYmUSpC gg7qViYTSZ8tNfMB2mogNw3wXwAadosLX0R7BXdKgJ7kHVWU41YV8bRd1fyZxybXzoU0 lRUGOl7G/QuhJb+YKcUSzKVmu5z6R26D3EmIA+97gwec3LU10jkhDgRsSIU3Jcgfae8u YrcAecl1EB297PnqUB5FAA6wWtIIBfNC1sz6h8QsI4YzWuv8++zoZdrZqfgT9LDQSAGi lSjQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a056a00138800b005728c05ef9esi5123683pfg.14.2022.12.01.04.31.39; Thu, 01 Dec 2022 04:31:52 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751014873490696334?= X-GMAIL-MSGID: =?utf-8?q?1751014873490696334?= 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);