Fix the way RCTL handles rules' rrl_exceeded on credenials change.

Because of what this variable does, it was probably harmless - but
still incorrect.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2016-01-26 11:28:55 +00:00
parent 267e03a45d
commit ed81020097
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=294792

View File

@ -1745,6 +1745,7 @@ rctl_proc_ucred_changed(struct proc *p, struct ucred *newcred)
for (i = 0; i < rulecnt; i++) {
newlink = uma_zalloc(rctl_rule_link_zone, M_WAITOK);
newlink->rrl_rule = NULL;
newlink->rrl_exceeded = 0;
LIST_INSERT_HEAD(&newrules, newlink, rrl_next);
}
@ -1761,6 +1762,7 @@ rctl_proc_ucred_changed(struct proc *p, struct ucred *newcred)
goto goaround;
rctl_rule_acquire(link->rrl_rule);
newlink->rrl_rule = link->rrl_rule;
newlink->rrl_exceeded = link->rrl_exceeded;
newlink = LIST_NEXT(newlink, rrl_next);
rulecnt--;
}
@ -1771,6 +1773,7 @@ rctl_proc_ucred_changed(struct proc *p, struct ucred *newcred)
goto goaround;
rctl_rule_acquire(link->rrl_rule);
newlink->rrl_rule = link->rrl_rule;
newlink->rrl_exceeded = link->rrl_exceeded;
newlink = LIST_NEXT(newlink, rrl_next);
rulecnt--;
}
@ -1780,6 +1783,7 @@ rctl_proc_ucred_changed(struct proc *p, struct ucred *newcred)
goto goaround;
rctl_rule_acquire(link->rrl_rule);
newlink->rrl_rule = link->rrl_rule;
newlink->rrl_exceeded = link->rrl_exceeded;
newlink = LIST_NEXT(newlink, rrl_next);
rulecnt--;
}
@ -1789,6 +1793,7 @@ rctl_proc_ucred_changed(struct proc *p, struct ucred *newcred)
goto goaround;
rctl_rule_acquire(link->rrl_rule);
newlink->rrl_rule = link->rrl_rule;
newlink->rrl_exceeded = link->rrl_exceeded;
newlink = LIST_NEXT(newlink, rrl_next);
rulecnt--;
}