Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1671829ybl; Wed, 8 Jan 2020 23:01:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxUW9It1Lm6G1SwclZz815QXNLvDsrmtrTabdLYvprjkylwUY7pB9c4+gMM64IelI3cpsDP X-Received: by 2002:aca:5fc1:: with SMTP id t184mr2193842oib.20.1578553287795; Wed, 08 Jan 2020 23:01:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578553287; cv=none; d=google.com; s=arc-20160816; b=icamO6kAXfnBa9GaRcNxfeJ3xF4ConaS1bwR23ryVqrzc3uCJq/TDt5jq0qK4Ya8Wo TS8hcTNDhen+ogiUTXHoREftS42lx8LYyZWFRd6vm/vgfh4TFIqJY4yLXJbvaEJY8Tkc H3UiU75MGeG4KDRL4dHbPMTRUpX6SPzL2OlY0NrIN782oNn5xfR8UUAmq0aOWprDgPqr pMjHAQUnSwF03t2hZ+OOc03/WpRChklrS2IIJ5uRmFslcSjFK3TohNKOfxP3taBKNPb0 JlRaVWm7DAqKPL+77d2FvXQJT0nfJCkMgSlCKm/6c2DNf9eFuSYLgc+9pIdWP/4SaSqV +VuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Iv8ZiYxpxRMeMJWfZwQRmel2nNmEX9sOSA2rMcBVy7Q=; b=BsXyUI1Q7hV7Xvd3tlrsgZ7jMW61/4h2HYDHUfrIcOa7srwf37GSxo8wmp6E19AnYd xkLYIfHk96oYbeAb04dgmtEw7DR9bElgD/ISJAFDDqfHSB9271zZkGm3eQNwX4mPaZRe ppI1PNAmna0Jz1KEExy/dsSDTPMYma+q4Rt6azaHzZCH62rzJP8YxE+SrT39SVOw+d+T CESG4xwBp7q4UfLJ3ve8cvACWsGusj5C/ydoxbLn+vXMvHc8VgAzMATobJ0IRttFa5MS svaSNLFCmsOx+3oabi/UyK6q7kerUZDdjTT17fc962gOwnFl/QGHzvbLipGBNqILKwnX t8Bg== 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 r15si3414808ota.264.2020.01.08.23.01.14; Wed, 08 Jan 2020 23:01:27 -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 S1728157AbgAIHA3 (ORCPT + 99 others); Thu, 9 Jan 2020 02:00:29 -0500 Received: from isilmar-4.linta.de ([136.243.71.142]:38266 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726541AbgAIHA2 (ORCPT ); Thu, 9 Jan 2020 02:00:28 -0500 X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES Received: from light.dominikbrodowski.net (brodo.linta [10.1.0.102]) by isilmar-4.linta.de (Postfix) with ESMTPSA id 80FC22009CA; Thu, 9 Jan 2020 07:00:26 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id D79A220358; Thu, 9 Jan 2020 07:54:24 +0100 (CET) Date: Thu, 9 Jan 2020 07:54:24 +0100 From: Dominik Brodowski To: Wang ShaoBo Cc: mark.rutland@arm.com, hch@infradead.org, cj.chengjian@huawei.com, huawei.libin@huawei.com, xiexiuqi@huawei.com, yangyingliang@huawei.com, guohanjun@huawei.com, wcohen@redhat.com, linux-kernel@vger.kernel.org, mtk.manpages@gmail.com, wezhang@redhat.com Subject: Re: [PATCH] sys_personality: Add a optional arch hook arch_check_personality() for common sys_personality() Message-ID: <20200109065424.GA84503@light.dominikbrodowski.net> References: <20200109013846.174796-1-bobo.shaobowang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200109013846.174796-1-bobo.shaobowang@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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