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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 016E4C7EE25 for ; Thu, 8 Jun 2023 11:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236054AbjFHLhA (ORCPT ); Thu, 8 Jun 2023 07:37:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236172AbjFHLg7 (ORCPT ); Thu, 8 Jun 2023 07:36:59 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 959EF1FEB for ; Thu, 8 Jun 2023 04:36:57 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-9788554a8c9so95010266b.2 for ; Thu, 08 Jun 2023 04:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686224216; x=1688816216; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=LQWWI054RvloK7dl2oxvJAk/+Nn8DzlFxz+iqkh3yR8=; b=A7bQLvR+IH8m04PQqGNvmbATQJagZzGJQWyyTxFvmE2dpYiuLLXa5jIMPSwChKNVKl J7yMWr1JCMCEOegoTZux5FzmL37PgR+d2ILEAkyBU+bXVjQFNtTWojv+0pMEQNc0c8r4 V7EZHtf33JLyD0psYknTGlvz4hTH2F8k94mvHSoZiMix4E/rDb7/uJE9UT3RH8ojQwz5 Nqz8xHZ7moDQtbDkonv89wcLll3WeWBuQzuqQb7PR69TAym7cnzsTUyskSSj+H71x/Hv R0PyYHcu/o1kJlycpLW92iL65Py2czUz2AKLLdBMbYF4V/V+WfknJT5AtbsfPcXDKWeB bqnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686224216; x=1688816216; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LQWWI054RvloK7dl2oxvJAk/+Nn8DzlFxz+iqkh3yR8=; b=V1EKidnGm7/WSQRyyJq3w0gRfTCJxKeN5zU3NSis6wUYnqwfhLH3u0yj560XbGxZKk G7dQelllm1uBHNhslzU13dFvdzC8ZUFupEjt6IF6SlsPQ8Zb01CmVBabMrVk1KuOPm1L oGMEL3y2ZU4nDc8qbgUQQLP/UN9SR0mcQA1lAc9QxE2/bjyXFs65iRmgDFcBI1jjr+d3 BbwASG6mX0BO0qTUOCKghRDwc0bwhM3eK3zLSxIDTjLsDqr0N+T2c1YKXIqjdbaViHJN W+qnjoH9/aIETJLYQKEIzJUjX6dWQk/kI7s7+sQ9a9IqQr0Hj7N9XtJXvjzbhk8J2X7r Ttvw== X-Gm-Message-State: AC+VfDyEVcb77T2UklXcJft/80rbynqcjvYbZOYONDsNyQSJ9qFmjoRO j4KNvDJtBCsCCNhExGkouCrzqQ== X-Google-Smtp-Source: ACHHUZ4elyWGDezUPyDiJiGdSkDoQCsi5pS/58U7qjcTQ7drFCO3RsLFxtDosFEJP4SuTQnzLoHfJw== X-Received: by 2002:a17:907:60c9:b0:977:e87c:e633 with SMTP id hv9-20020a17090760c900b00977e87ce633mr11547349ejc.23.1686224216035; Thu, 08 Jun 2023 04:36:56 -0700 (PDT) Received: from [192.168.1.20] ([178.197.219.26]) by smtp.gmail.com with ESMTPSA id gf1-20020a170906e20100b00965b2d3968csm585161ejb.84.2023.06.08.04.36.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jun 2023 04:36:55 -0700 (PDT) Message-ID: <077e08c8-f2f7-2fef-9e2c-bc865bc611a6@linaro.org> Date: Thu, 8 Jun 2023 13:36:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [RESEND PATCH v1 2/2] misc: fastrpc: detect privileged processes based on group ID Content-Language: en-US To: Ekansh Gupta , srinivas.kandagatla@linaro.org, linux-arm-msm@vger.kernel.org Cc: ekangupt@qti.qualcomm.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, fastrpc.upstream@qti.qualcomm.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, devicetree@vger.kernel.org References: <1686155407-20054-1-git-send-email-quic_ekangupt@quicinc.com> <1686155407-20054-3-git-send-email-quic_ekangupt@quicinc.com> <4c27849d-cd34-77ed-7d45-6f366f9fa86a@quicinc.com> From: Krzysztof Kozlowski In-Reply-To: <4c27849d-cd34-77ed-7d45-6f366f9fa86a@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 08/06/2023 12:44, Ekansh Gupta wrote: > > > On 6/8/2023 12:17 AM, Krzysztof Kozlowski wrote: >> On 07/06/2023 18:30, Ekansh Gupta wrote: >>> Get the information on privileged group IDs during rpmsg probing based >>> on DT property. Check if the process requesting an offload to remote >>> subsystem is privileged by comparing it's group ID with privileged >>> group ID. Initialization process attributes are updated for a >>> privileged process which is sent to remote process for resource >>> management. >>> >> >> >> >>> + >>> static const struct file_operations fastrpc_fops = { >>> .open = fastrpc_device_open, >>> .release = fastrpc_device_release, >>> @@ -2277,6 +2396,10 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) >>> if (!data) >>> return -ENOMEM; >>> >>> + err = fastrpc_init_privileged_gids(rdev, "qcom,fastrpc-gids", &data->gidlist); >>> + if (err) >>> + dev_err(rdev, "Privileged gids init failed.\n"); >>> + >> >> What about error paths? No need for cleanup? >> > All the necessary clean-up is added as part of > fastrpc_init_privileged_gids error path. There is no requirement to have Where? How that code is called after fastrpc_device_register() failure? Or after of_platform_populate() failure? Please show me the code flow. > any additional handling in error path other that error log. Also there > is no intention to fail the probe in case gid information is not > properly read. This is not related. I don't talk about fastrpc_init_privileged_gids() failures. Look where did I leave my comment. Review comments are placed in proper places, not in unrelated parts of code. The placement of review comment is important as this is the context of bug in your patch. Best regards, Krzysztof