@@ -326,7 +326,8 @@ static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp,
loff_t *ppos)
{
- struct net *net = container_of(ctl->data, struct net, sctp.auth_enable);
+ struct net *net = container_of(ctl->data, struct net,
+ sctp.sctp_hmac_alg);
struct ctl_table tbl;
bool changed = false;
char *none = "none";
@@ -441,8 +442,7 @@ static int proc_sctp_do_auth(struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp,
loff_t *ppos)
{
- struct net *net = container_of(ctl->data, struct net,
- sctp.sctp_hmac_alg);
+ struct net *net = container_of(ctl->data, struct net, sctp.auth_enable);
struct ctl_table tbl;
int new_value, ret;
BugLink: https://bugs.launchpad.net/bugs/2101091 The `member` argument passed to `container_of` has been swapped in both proc_sctp_do_auth() and proc_sctp_do_hmac_alg(), which can lead to a kernel oops or panic. Fix this by passing the right argument to `container_of`, matching the original mainline commits ea62dd1383913b and 15649fd5415e. Fixes: f5d691951ae9 ("sctp: sysctl: auth_enable: avoid using current->nsproxy") Fixes: 7ec30a2d34cc ("sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy") Signed-off-by: Magali Lemes <magali.lemes@canonical.com> --- net/sctp/sysctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)