On Fri, 15 Feb 2008, Paul Jackson wrote:Sure it is, you can determine if the low MPOL_FLAG_SHIFT bits are a valid mode by masking off the upper bits and testing if the result is >= MPOL_MAX. Well, it's still an implementation detail that needs to be explicitly defined, otherwise we have no way to separate mode from flags when the user passes in their int formal as part of either syscall. And given the recent requirements for a perfectly formed set_mempolicy() or mbind() syscall (as a result of the discussion about allowing non-empty nodemasks with MPOL_DEFAULT), we need to ensure that invalid flags are not being passed. We should make sure to return -EINVAL to a user specifying an invalid flag if, for example, they are using an older kernel that doesn't support what they're asking for. It would be possible to do all of this in both sys_set_mempolicy() and sys_mbind() by masking off the set of possible modes and checking the result for being >= MPOL_MAX: if ((mode & MPOL_MODE_FLAGS) >= MPOL_MAX) return -EINVAL; --
| James Bruce | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Peter Zijlstra | [PATCH 00/23] per device dirty throttling -v8 |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
| Peter Zijlstra | [RFC/PATCH 0/4] CPUSET driven CPU isolation |
git: | |
| Gerrit Renker | [PATCH 18/37] dccp: Support for Mandatory options |
| Rick Jones | Re: Network latency regressions from 2.6.22 to 2.6.29 |
| David Miller | [GIT]: Networking |
| Josip Rodin | bnx2_poll panicking kernel |
