Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1832369ybl; Thu, 9 Jan 2020 02:23:53 -0800 (PST) X-Google-Smtp-Source: APXvYqyKq+2RukP7UnsZUqbBE0kmji1G1MAmo8B8UQMoNx3u00c8ygpnMfIGitlDoeIosV2VAKAh X-Received: by 2002:a9d:478:: with SMTP id 111mr7748634otc.359.1578565432919; Thu, 09 Jan 2020 02:23:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578565432; cv=none; d=google.com; s=arc-20160816; b=zbcoI7jLhAVVoL4B8QpbTiKoXcFbvYJ+ab+MKZvhnsqDBKIlFbxN/buLhqZZphQQmj 2GRrcJYmKj7KVTRkhCu2Ieez3mlGYIUUFgMP8y/saA4XcNR4Kj5WRKrHUjSoHmeVzKJG EWiDcvrNoicfN6a9Y0DGKrEv+cJrtLL00vkcBmlUi0jlF7u1bby+QCblewQWGesgaqEm T7BM5VdyqhTHea5S4s19EZnMpef569saTgyykgkeMYCs5ZKhh7Z4IdreqW4lOUw4hE5W 5GrICP+jMRcV/QbjFy95+zhNNhdcpLXMfOJBFaehcBIpe4whCAbFEc2s32F0Ee5mvqcG EIPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=fVDpvx2ytKyvS4CeoPN1dQeLXu8Ffj+uiMB4q7cvY+o=; b=q08U/mOYlgv2CsFd9nZB4Q084dJPB340VkN6x595H3LCE0tsRenlOkPT54XaOdGBdv v2tcooJtnEGOi03i5WjZzTGi9AQvPFKJ3ALXhtOwzY4P9Od91gDavto5lPQTu5yW/Lt/ uUF8j3pPjkqNvDoTnp2XaIbslhLoh9jhPXoyzbG0Oh0VvpKxjrzmiEvo1WlSdkOQZp/1 CBpjL0Zmqa2k6aMrD1Ry8PL/7stLC01bnlFZXMN8WBQqZ2gweT7Wpcvwrjpj7A7fHAaK 4IXFkhPh2JE+OJwP3m+7IUmDI8CqtPmKPVgVrrx2/gVAzfm/FkCI15DnNZVfRL+J0qhK eBGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15si3374989oij.160.2020.01.09.02.23.39; Thu, 09 Jan 2020 02:23:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728654AbgAIIph (ORCPT + 99 others); Thu, 9 Jan 2020 03:45:37 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:49156 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728465AbgAIIph (ORCPT ); Thu, 9 Jan 2020 03:45:37 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id A6659D20FE53C486A031; Thu, 9 Jan 2020 16:45:34 +0800 (CST) Received: from [127.0.0.1] (10.184.195.37) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Thu, 9 Jan 2020 16:45:24 +0800 Subject: Re: [PATCH] sys_personality: Add a optional arch hook arch_check_personality() for common sys_personality() To: Dominik Brodowski CC: , , , , , , , , , , References: <20200109013846.174796-1-bobo.shaobowang@huawei.com> <20200109065424.GA84503@light.dominikbrodowski.net> From: "Wangshaobo (bobo)" Message-ID: Date: Thu, 9 Jan 2020 16:45:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <20200109065424.GA84503@light.dominikbrodowski.net> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.184.195.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for your reply, I wiil send it in version 2 Thanks,             wangshaobo 在 2020/1/9 14:54, Dominik Brodowski 写道: > On Thu, Jan 09, 2020 at 09:38:46AM +0800, Wang ShaoBo wrote: >> currently arm64 use __arm64_sys_arm64_personality() as its default >> syscall. But using a normal hook arch_check_personality() can reject >> personality settings for special case of different archs. > Thanks for your patch! > >> SYSCALL_DEFINE1(personality, unsigned int, personality) >> { >> - unsigned int old = current->personality; >> + int check; >> >> - if (personality != 0xffffffff) >> - set_personality(personality); >> + check = arch_check_personality(personality); >> + if (check) >> + return check; >> >> - return old; >> + return ksys_personality(personality); >> } > Please leave the default check and call to set_personality() > in here and remove the now-unneeded ksys_personality() from > include/linux/syscalls.h > > Thanks, > Dominik > > .