Re: [PATCH net] sctp: check policy more carefully when getting pr status

2018-10-29 Thread David Miller
From: Xin Long Date: Mon, 29 Oct 2018 23:13:11 +0800 > When getting pr_assocstatus and pr_streamstatus by sctp_getsockopt, > it doesn't correctly process the case when policy is set with > SCTP_PR_SCTP_ALL | SCTP_PR_SCTP_MASK. It even causes a > slab-out-of-bounds in sctp_getsockopt_pr_streamstat

[PATCH net] sctp: check policy more carefully when getting pr status

2018-10-29 Thread Xin Long
When getting pr_assocstatus and pr_streamstatus by sctp_getsockopt, it doesn't correctly process the case when policy is set with SCTP_PR_SCTP_ALL | SCTP_PR_SCTP_MASK. It even causes a slab-out-of-bounds in sctp_getsockopt_pr_streamstatus(). This patch fixes it by return -EINVAL for this case. Fi