diff options
author | David S. Miller <davem@davemloft.net> | 2018-04-07 22:32:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-07 22:32:32 -0400 |
commit | 5ba7d089738e921e781521ccd1afa3cc3f7e72cf (patch) | |
tree | 6ea95ba9649d37dcc89fb209c4dcc5f871c87cca /crypto | |
parent | 609ffd2200b673dc881b5e25552beab1cec78759 (diff) | |
parent | 4854dff384f3d7277b9b647c3697314e717dce85 (diff) | |
download | linux-crypto-5ba7d089738e921e781521ccd1afa3cc3f7e72cf.tar.gz linux-crypto-5ba7d089738e921e781521ccd1afa3cc3f7e72cf.zip |
Merge branch 'net-fix-uninit-values-in-networking-stack'
Eric Dumazet says:
====================
net: fix uninit-values in networking stack
It seems syzbot got new features enabled, and fired some interesting
reports. Oh well.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | crypto/af_alg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/af_alg.c b/crypto/af_alg.c index c49766b0..7846c0c2 100644 --- a/crypto/af_alg.c +++ b/crypto/af_alg.c @@ -158,16 +158,16 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) void *private; int err; - /* If caller uses non-allowed flag, return error. */ - if ((sa->salg_feat & ~allowed) || (sa->salg_mask & ~allowed)) - return -EINVAL; - if (sock->state == SS_CONNECTED) return -EINVAL; if (addr_len < sizeof(*sa)) return -EINVAL; + /* If caller uses non-allowed flag, return error. */ + if ((sa->salg_feat & ~allowed) || (sa->salg_mask & ~allowed)) + return -EINVAL; + sa->salg_type[sizeof(sa->salg_type) - 1] = 0; sa->salg_name[sizeof(sa->salg_name) + addr_len - sizeof(*sa) - 1] = 0; |