Message ID | 1422327262-6344-1-git-send-email-fan.du@intel.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
From: Fan Du <fan.du@intel.com> Date: Tue, 27 Jan 2015 10:54:22 +0800 > @@ -2419,6 +2419,11 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) > const struct xfrm_link *link; > int type, err; > > +#ifdef CONFIG_COMPAT > + if (is_compat_task()) > + return -EPERM; > +#endif > + This seems more like an unsupported operation rather then a permission problem. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
于 2015年01月27日 15:39, David Miller 写道: > From: Fan Du <fan.du@intel.com> > Date: Tue, 27 Jan 2015 10:54:22 +0800 > >> @@ -2419,6 +2419,11 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) >> const struct xfrm_link *link; >> int type, err; >> >> +#ifdef CONFIG_COMPAT >> + if (is_compat_task()) >> + return -EPERM; >> +#endif >> + > > This seems more like an unsupported operation rather then a permission > problem. > how about *ENOTSUPP* ?
From: Fan Du <fengyuleidian0615@gmail.com> Date: Tue, 27 Jan 2015 15:44:36 +0800 > 于 2015年01月27日 15:39, David Miller 写道: >> From: Fan Du <fan.du@intel.com> >> Date: Tue, 27 Jan 2015 10:54:22 +0800 >> >>> @@ -2419,6 +2419,11 @@ static int xfrm_user_rcv_msg(struct sk_buff >>> *skb, struct nlmsghdr *nlh) >>> const struct xfrm_link *link; >>> int type, err; >>> >>> +#ifdef CONFIG_COMPAT >>> + if (is_compat_task()) >>> + return -EPERM; >>> +#endif >>> + >> >> This seems more like an unsupported operation rather then a permission >> problem. >> > how about *ENOTSUPP* ? Unquestionably, that is an improvement over EPERM. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, 27 Jan 2015, David Miller wrote: > From: Fan Du <fengyuleidian0615@gmail.com> > Date: Tue, 27 Jan 2015 15:44:36 +0800 > > > 于 2015年01月27日 15:39, David Miller 写道: > >> From: Fan Du <fan.du@intel.com> > >> Date: Tue, 27 Jan 2015 10:54:22 +0800 > >> > >>> @@ -2419,6 +2419,11 @@ static int xfrm_user_rcv_msg(struct sk_buff > >>> *skb, struct nlmsghdr *nlh) > >>> const struct xfrm_link *link; > >>> int type, err; > >>> > >>> +#ifdef CONFIG_COMPAT > >>> + if (is_compat_task()) > >>> + return -EPERM; > >>> +#endif > >>> + > >> > >> This seems more like an unsupported operation rather then a permission > >> problem. > >> > > how about *ENOTSUPP* ? > > Unquestionably, that is an improvement over EPERM. But it should be EOPNOTSUPP rather than ENOTSUP, right? -Bill -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 8128594..f960bd9 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -2419,6 +2419,11 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) const struct xfrm_link *link; int type, err; +#ifdef CONFIG_COMPAT + if (is_compat_task()) + return -EPERM; +#endif + type = nlh->nlmsg_type; if (type > XFRM_MSG_MAX) return -EINVAL;