From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261169AbUIDNhF (ORCPT ); Sat, 4 Sep 2004 09:37:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261375AbUIDNhF (ORCPT ); Sat, 4 Sep 2004 09:37:05 -0400 Received: from colin2.muc.de ([193.149.48.15]:41482 "HELO colin2.muc.de") by vger.kernel.org with SMTP id S261169AbUIDNhC (ORCPT ); Sat, 4 Sep 2004 09:37:02 -0400 Date: 4 Sep 2004 15:37:01 +0200 Date: Sat, 4 Sep 2004 15:37:01 +0200 From: Andi Kleen To: Paul Jackson Cc: akpm@osdl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Fix argument checking in sched_setaffinity Message-ID: <20040904133701.GE33964@muc.de> References: <20040831183655.58d784a3.pj@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040831183655.58d784a3.pj@sgi.com> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 31, 2004 at 06:36:55PM -0700, Paul Jackson wrote: > Looks good - thanks, Andi. > > I notice that you didn't bother with the fractional byte that is handled > by 'endmask' in mm/mempolicy.c:get_nodes(). But I really don't give a > hoot - either way is fine by me. It is not needed because this function gets bytes instead of bits. > I've written a couple of code snippets that manage to intuit the size of > the kernel's cpumask dynamically from user space, by probing with > various sched_getaffinity() calls. But since your patch only changes > the errors generated by sched_setaffinity() [that's "set", not "get"], I > will not experience any grief from this subtle change in the kernel's > API. > > Should you lock hotplug before calling get_user_cpu_mask(), since > get_user_cpu_mask() depends on cpu_online_mask()? Good point yes, that is missing. However Linus has already thrown the code out and replaced it with something more broken :-/ -Andi