Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp289768pxb; Fri, 8 Jan 2021 05:14:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxbQ9rGgaaElos/sk3dsEFCipCJ+50gc0z10Ki1BWSXxV7iEB+RxTCeaeMHOdTvWk3B+Jk X-Received: by 2002:aa7:d485:: with SMTP id b5mr5019111edr.214.1610111663093; Fri, 08 Jan 2021 05:14:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610111663; cv=none; d=google.com; s=arc-20160816; b=aJcr68W6ZKYGcOIBxiEX7Ip1S/lIY1nVhzFA3r35TZacQgqUICUq2RJpYbXwoK94P/ SA9OK3DEyihKRX2HL2hr+09mjFnmeQ55IVCZIIOxFKvSpAWyg0RfFCYq+jWCiu/DLv/T Po9C1PFDhKLPSEuxa5IOFxxNMRQcrUEehvpjQlqrHt716+7hcSvoUDRjxCt2FfRkht0E gkCFGOQes7gaSPBJfwAjMt/tNhywNrE2R+kx8YN4519e5IMItTwbKoZ7e/mSS2zZ4XkF RSmuvmGwMCoQioQvKYjYlgyQjSzrJOzydiDWA1t7lPWOr3/wYBOAaWBE5xtoQd/zR9dz WtRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=xvHCLfau5532o79KqB8nrVItQ9GKcRreL4jTT5niOnc=; b=iwJyMbox0YoTop79n+fpSx2ywOsOHGz/feE1HJLpZfC77w2oly+rwoFZ7nkSDlRpMW /meFEp9jbKtFcRIKKeh7+fhHJmAT2XRVoM4shO4lSGChxVvpbLjlrtYFVOT2+fvdH6JL p3ZyBMdBxWKOE8XeyFLYSHj33Vw7+AHCn2cZoQoAJk/x9YZfU4sStFGrAztaNb4FXwVx 97y28hB0egZ+GlBuu8zwEgn6k6o9fO4NXVVjOoKU5k9HqVtUzKVecUJSdhXfsn3jG7z2 rgdaoxDz7RygDmtLtcSAfVgAoBY0MOUpi1Ri97sTiE//3adBcb1VU4VN7QOv1cLHqiNX Qd3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Jz+i7ZV2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si3645918edy.204.2021.01.08.05.13.56; Fri, 08 Jan 2021 05:14:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Jz+i7ZV2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726705AbhAHNMz (ORCPT + 99 others); Fri, 8 Jan 2021 08:12:55 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:40594 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726059AbhAHNMy (ORCPT ); Fri, 8 Jan 2021 08:12:54 -0500 X-UUID: cecef018bc0d4f02950e23be2bc834bc-20210108 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=xvHCLfau5532o79KqB8nrVItQ9GKcRreL4jTT5niOnc=; b=Jz+i7ZV2mm2YgGDa0kJW9NN08IpryUnl57VegN2qPevH0ssTqmTmRsr5xyXfSZIm7x/APmIBVPSyVXlzazvFFNhIXyU/wbcDlFgk1AqrE5MS/A08sGwhVr9/hob4W+aXREAzNTlJdJK+Ufj95Iartd3c/aXCQHsw3xM+ZD1wnIQ=; X-UUID: cecef018bc0d4f02950e23be2bc834bc-20210108 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 841503156; Fri, 08 Jan 2021 21:12:05 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 8 Jan 2021 21:11:43 +0800 Received: from [172.21.77.33] (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 8 Jan 2021 21:11:43 +0800 Message-ID: <1610111503.17820.1.camel@mtkswgap22> Subject: Re: [PATCH 2/2] scsi: ufs: Protect PM ops and err_handler from user access through sysfs From: Stanley Chu To: Bean Huo CC: Can Guo , , , , , , , , , , , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Bean Huo , Nitin Rawat , Adrian Hunter , "Bart Van Assche" , Satya Tangirala , "open list" Date: Fri, 8 Jan 2021 21:11:43 +0800 In-Reply-To: References: <1609595975-12219-1-git-send-email-cang@codeaurora.org> <1609595975-12219-3-git-send-email-cang@codeaurora.org> <80a15afab8024d0b61d312b57585c9322ac91958.camel@gmail.com> <7d49c1dfc3f648c484076f3c3a7f4e1e@codeaurora.org> <1514403adf486ac8069253c09f45b021bad32e00.camel@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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