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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 B96BBC28D13 for ; Wed, 3 Mar 2021 00:13:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E2B764FC4 for ; Wed, 3 Mar 2021 00:13:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236170AbhCCAG5 (ORCPT ); Tue, 2 Mar 2021 19:06:57 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:13037 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1837869AbhCBI7g (ORCPT ); Tue, 2 Mar 2021 03:59:36 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DqVrg3tMvzMg9X; Tue, 2 Mar 2021 16:38:11 +0800 (CST) Received: from [10.174.178.174] (10.174.178.174) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Tue, 2 Mar 2021 16:40:13 +0800 Subject: Re: [PATCH 4.19 21/57] proc: dont allow async path resolution of /proc/self components To: Greg Kroah-Hartman , CC: , Jens Axboe , Sasha Levin , yangerkun , Cheng Jian References: <20201201084647.751612010@linuxfoundation.org> <20201201084650.205087954@linuxfoundation.org> From: Yang Yingliang Message-ID: Date: Tue, 2 Mar 2021 16:40:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20201201084650.205087954@linuxfoundation.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.178.174] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Hi, On 2020/12/1 16:53, Greg Kroah-Hartman wrote: > From: Jens Axboe > > [ Upstream commit 8d4c3e76e3be11a64df95ddee52e99092d42fc19 ] > > If this is attempted by a kthread, then return -EOPNOTSUPP as we don't > currently support that. Once we can get task_pid_ptr() doing the right > thing, then this can go away again. https://www.spinics.net/lists/io-uring/msg05297.html This patch seems used for io-wq worker which is merged in v5.5-rc1, why we need this in linux-4.19.y ? Thanks, Yang > > Signed-off-by: Jens Axboe > Signed-off-by: Sasha Levin > --- > fs/proc/self.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/fs/proc/self.c b/fs/proc/self.c > index cc6d4253399d1..7922edf70ce1a 100644 > --- a/fs/proc/self.c > +++ b/fs/proc/self.c > @@ -16,6 +16,13 @@ static const char *proc_self_get_link(struct dentry *dentry, > pid_t tgid = task_tgid_nr_ns(current, ns); > char *name; > > + /* > + * Not currently supported. Once we can inherit all of struct pid, > + * we can allow this. > + */ > + if (current->flags & PF_KTHREAD) > + return ERR_PTR(-EOPNOTSUPP); > + > if (!tgid) > return ERR_PTR(-ENOENT); > /* max length of unsigned int in decimal + NULL term */