From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 49894C4742C for ; Mon, 2 Nov 2020 17:48:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA69E21D91 for ; Mon, 2 Nov 2020 17:48:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aPd+GJ7X" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725927AbgKBRro (ORCPT ); Mon, 2 Nov 2020 12:47:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725805AbgKBRro (ORCPT ); Mon, 2 Nov 2020 12:47:44 -0500 Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8799C061A47 for ; Mon, 2 Nov 2020 09:47:43 -0800 (PST) Received: by mail-oi1-x243.google.com with SMTP id j7so15463781oie.12 for ; Mon, 02 Nov 2020 09:47:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=ta8nke5A5mobw52bQz/6c9ICTuEFY5bZssEx/BCuN+U=; b=aPd+GJ7X7SpgqrcQU40H4fMr+1SBaIGBTLYglypXsKQf3Nx/gTNlZ5SPgt6G7O3ybS 2haR7/p6QYCrANpqnFpaFwUWysuD9yuJdn1q0XoHILq7HKBztKF44nLSFPpL8er3tIyn Poa4Um7y3fL5e8o7IeroI9y1tez+RwdQSjg4Fknq5t9ESSBR2Pjr6Yv2M8K6pE3zlt0s zqPZtuXoZaVmdNFgoAlMbYgc+IPhskrfPvQO+m+SHIvpJtPAXrcOjf6ZTjEOYwDS7wYY rCZqdmNl/QFUhYKXLVnl9o/YptMDUIf4rqjxR/BF7dJQtV8g40W7VmK2BOZ3fyW8vwLs xXxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=ta8nke5A5mobw52bQz/6c9ICTuEFY5bZssEx/BCuN+U=; b=qNBYG4GSea1muVRwWktOb4YzLoCW8ssBs8IvJVd0SDvXTCiYVgPt3d5rRFZCQZ/rUd P/33z6G2hD3k1DSLNMowzGxBcnnakH6dweJE9pv9VzZjmX4gdNkrhpu7kyvkGQt7Clud hIA4voB+swVlMGpideRlay4x3ydTzxExJT7jFQB/ZwRaFGyMpBZUDSa1zT1//hT3mVW+ 94kKemglziNRCFArMtTcq6s6U3XL0f5tU6azs8jCh2RhwA9ZY5EGV3ylM7O/g2TxWRnR lDwovtw0tdVOYppWZq1WQKtLrhGMrep6vyeuwQiB4xePCC7SO8Yt7V3D31dudN58yXKR PNyQ== X-Gm-Message-State: AOAM532eK+2hEhTJciLho9eDfxsKn38AB4N8B9kEXMRn9FCmyd6SIelA jQuID15MpJgpRE4nQh+XfTug+w== X-Google-Smtp-Source: ABdhPJxXvHPb/Z0m00NEXuUGbpnQdMiSETV2s6AftgGLyCuMxVSYXQjN11p6yK5xF1LNSrj3NSX0nA== X-Received: by 2002:aca:b145:: with SMTP id a66mr11230119oif.92.1604339263266; Mon, 02 Nov 2020 09:47:43 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id w70sm748613oiw.29.2020.11.02.09.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 09:47:42 -0800 (PST) Date: Mon, 2 Nov 2020 11:47:40 -0600 From: Bjorn Andersson To: Siddharth Gupta Cc: agross@kernel.org, ohad@wizery.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tsoni@codeaurora.org, psodagud@codeaurora.org, rishabhb@codeaurora.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v6 2/4] remoteproc: coredump: Add minidump functionality Message-ID: <20201102174740.GA223412@builder.lan> References: <1601690757-25726-1-git-send-email-sidgup@codeaurora.org> <1601690757-25726-3-git-send-email-sidgup@codeaurora.org> <20201026210912.GA4611@builder.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Thu 29 Oct 18:54 CDT 2020, Siddharth Gupta wrote: > > On 10/26/2020 2:09 PM, Bjorn Andersson wrote: > > On Fri 02 Oct 21:05 CDT 2020, Siddharth Gupta wrote: [..] > > > diff --git a/drivers/remoteproc/remoteproc_elf_helpers.h b/drivers/remoteproc/remoteproc_elf_helpers.h > > > index 4b6be7b..d83ebca 100644 > > > --- a/drivers/remoteproc/remoteproc_elf_helpers.h > > > +++ b/drivers/remoteproc/remoteproc_elf_helpers.h > > > @@ -11,6 +11,7 @@ > > > #include > > > #include > > > +#define MAX_NAME_LENGTH 16 > > This name is too generic. Why is it 16? > > I will update the name to  MAX_SHDR_NAME_LEN. In our usecase we didn't > expect a length of the section name to exceed > 16 characters (MAX_REGION_NAME_LENGTH defined in qcom_minidump.h in patch > 03/04). It might change later if users > want to increase the size. What would you prefer the max name length for the > section header to be? > If you calculate the size of the region based on the strings I don't see why you need to limit it here - and you shouldn't use a bounded version of strcpy in this case either. I don't think this part of the code should truncate the strings, if we need to sanitize the strings make sure to do that when you populate the list. Thanks, Bjorn From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 00BCEC388F9 for ; Mon, 2 Nov 2020 17:49:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 7E22C21534 for ; Mon, 2 Nov 2020 17:49:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="M8JWDlkN"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aPd+GJ7X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E22C21534 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pjIoXhOGVxUP58jB9FwZLvb9Y0au1RcDTaCNUtlyGws=; b=M8JWDlkNVAT5GUg7328heTLkt UvHXEnNZofCcvGJbDIaByWn9d/2pVWEwJMWw1xNTrJx9lqcgRIRccftzbN4/3wovAOLHPcjabWOiy 3nDZkg9LnWsEBLb5WzlRTZs06yDBo3ubFucTiRGjMHPMM4BdCTs2e8WHAaI5EvS3ybm4fl5cs9D74 WFHFwo7j6BGttP2nGzdIJtVtJhkfpJG8w/LDKR147InCKBVmrkVp5BlX06I6zSfcNSTA9nClMGcOd cAHqLciNEfGx65m14KfhwogcQKlPuqRt74YsJO9Z6Eg6FI8wuGeTXXIXUa7B6oA36UbZcmiuzAFL2 G0AjxwpPQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZdvp-0004VP-Cc; Mon, 02 Nov 2020 17:47:49 +0000 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZdvm-0004U4-Pk for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2020 17:47:47 +0000 Received: by mail-oi1-x241.google.com with SMTP id m143so6159999oig.7 for ; Mon, 02 Nov 2020 09:47:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=ta8nke5A5mobw52bQz/6c9ICTuEFY5bZssEx/BCuN+U=; b=aPd+GJ7X7SpgqrcQU40H4fMr+1SBaIGBTLYglypXsKQf3Nx/gTNlZ5SPgt6G7O3ybS 2haR7/p6QYCrANpqnFpaFwUWysuD9yuJdn1q0XoHILq7HKBztKF44nLSFPpL8er3tIyn Poa4Um7y3fL5e8o7IeroI9y1tez+RwdQSjg4Fknq5t9ESSBR2Pjr6Yv2M8K6pE3zlt0s zqPZtuXoZaVmdNFgoAlMbYgc+IPhskrfPvQO+m+SHIvpJtPAXrcOjf6ZTjEOYwDS7wYY rCZqdmNl/QFUhYKXLVnl9o/YptMDUIf4rqjxR/BF7dJQtV8g40W7VmK2BOZ3fyW8vwLs xXxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=ta8nke5A5mobw52bQz/6c9ICTuEFY5bZssEx/BCuN+U=; b=Gt1bQOoAi1kr8E4g0uHpAhHk6MB41Cuz0P3w+2LAXwflsX3pzwlYK3jO0Aj6wdll4n pituLSlu9t/1vN/0m7Jkad4XpeK+KDrGvrBh5jX5NdFSQLaiIUz1UGr3iSa0qRDz4Z3E kTuxQeUg+6XYpVBbzEShRnHkQ1d6miiBO/EQx7NcIUQqmuObzFflt/PDBa67YOxsyNqy /3xsMN5tJXrIvqUagG7L5iOhBX5hEkzW16mpgKRXU7F47v8pSKUy9wVh9EEAU1zq8KT1 hmhtcxVt8r42GJOz1T9QnWr26QmCZQbzG181Z4Qol14Y5qo5R394xfTvB9WOe/U6Yl+w oGCw== X-Gm-Message-State: AOAM5329bQ7iwa32rDwmqRgPFVK+SWtsm1+X2Tabw7YHxDKNIo54DGCn UgjVj4nW5hcwOfyOlRxQLBVFEQ== X-Google-Smtp-Source: ABdhPJxXvHPb/Z0m00NEXuUGbpnQdMiSETV2s6AftgGLyCuMxVSYXQjN11p6yK5xF1LNSrj3NSX0nA== X-Received: by 2002:aca:b145:: with SMTP id a66mr11230119oif.92.1604339263266; Mon, 02 Nov 2020 09:47:43 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id w70sm748613oiw.29.2020.11.02.09.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 09:47:42 -0800 (PST) Date: Mon, 2 Nov 2020 11:47:40 -0600 From: Bjorn Andersson To: Siddharth Gupta Subject: Re: [PATCH v6 2/4] remoteproc: coredump: Add minidump functionality Message-ID: <20201102174740.GA223412@builder.lan> References: <1601690757-25726-1-git-send-email-sidgup@codeaurora.org> <1601690757-25726-3-git-send-email-sidgup@codeaurora.org> <20201026210912.GA4611@builder.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201102_124746_853828_DAAFB9F9 X-CRM114-Status: GOOD ( 19.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ohad@wizery.com, tsoni@codeaurora.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, agross@kernel.org, rishabhb@codeaurora.org, psodagud@codeaurora.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu 29 Oct 18:54 CDT 2020, Siddharth Gupta wrote: > = > On 10/26/2020 2:09 PM, Bjorn Andersson wrote: > > On Fri 02 Oct 21:05 CDT 2020, Siddharth Gupta wrote: [..] > > > diff --git a/drivers/remoteproc/remoteproc_elf_helpers.h b/drivers/re= moteproc/remoteproc_elf_helpers.h > > > index 4b6be7b..d83ebca 100644 > > > --- a/drivers/remoteproc/remoteproc_elf_helpers.h > > > +++ b/drivers/remoteproc/remoteproc_elf_helpers.h > > > @@ -11,6 +11,7 @@ > > > #include > > > #include > > > +#define MAX_NAME_LENGTH 16 > > This name is too generic. Why is it 16? > = > I will update the name to=A0 MAX_SHDR_NAME_LEN. In our usecase we didn't > expect a length of the section name to exceed > 16 characters (MAX_REGION_NAME_LENGTH defined in qcom_minidump.h in patch > 03/04). It might change later if users > want to increase the size. What would you prefer the max name length for = the > section header to be? > = If you calculate the size of the region based on the strings I don't see why you need to limit it here - and you shouldn't use a bounded version of strcpy in this case either. I don't think this part of the code should truncate the strings, if we need to sanitize the strings make sure to do that when you populate the list. Thanks, Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel