Messages in this thread | | | Subject | Re: [RFC] globmatch() helper function | From | Steven Rostedt <> | Date | Wed, 17 Dec 2008 11:54:32 -0500 |
| |
On Wed, 2008-12-17 at 17:51 +0100, Andi Kleen wrote: > > OK, lets compromise with WARN_ON_ONCE() ;-) > > I don't think WARN_ON is the right way to handle bad user input. > It implies that when someone typos the result might end up in Arjan's > kerneloops.org database, which is not good.
Since I recommended an internal helper function, we could have:
int globmatch(const char *pat, const char *str) { int ret;
ret = globmatch_internal(pat, str, 0); if (ret < 0) WARN_ON(); return ret; }
int globmatch_user(const char *pat, const char *str) { return globmatch_internal(pat, str, 0); }
This would warn on if a kernel user caused the overflow, and also gives a function that user space input could use, that would not warn on overflow.
-- Steve
| |