Commit 27d1cba2 authored by maximilian attems's avatar maximilian attems Committed by David S. Miller

[AX25]: Kill user triggable printks.

sfuzz can easily trigger any of those.

move the printk message to the corresponding comment: makes the
intention of the code clear and easy to pick up on an scheduled
removal.  as bonus simplify the braces placement.
Signed-off-by: default avatarmaximilian attems <max@stro.at>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0bcceadc
...@@ -1109,21 +1109,19 @@ static int __must_check ax25_connect(struct socket *sock, ...@@ -1109,21 +1109,19 @@ static int __must_check ax25_connect(struct socket *sock,
* some sanity checks. code further down depends on this * some sanity checks. code further down depends on this
*/ */
if (addr_len == sizeof(struct sockaddr_ax25)) { if (addr_len == sizeof(struct sockaddr_ax25))
/* support for this will go away in early 2.5.x */ /* support for this will go away in early 2.5.x
printk(KERN_WARNING "ax25_connect(): %s uses obsolete socket structure\n", * ax25_connect(): uses obsolete socket structure
current->comm); */
} ;
else if (addr_len != sizeof(struct full_sockaddr_ax25)) { else if (addr_len != sizeof(struct full_sockaddr_ax25))
/* support for old structure may go away some time */ /* support for old structure may go away some time
* ax25_connect(): uses old (6 digipeater) socket structure.
*/
if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) || if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) ||
(addr_len > sizeof(struct full_sockaddr_ax25))) { (addr_len > sizeof(struct full_sockaddr_ax25)))
return -EINVAL; return -EINVAL;
}
printk(KERN_WARNING "ax25_connect(): %s uses old (6 digipeater) socket structure.\n",
current->comm);
}
if (fsa->fsa_ax25.sax25_family != AF_AX25) if (fsa->fsa_ax25.sax25_family != AF_AX25)
return -EINVAL; return -EINVAL;
...@@ -1467,21 +1465,20 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1467,21 +1465,20 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock,
goto out; goto out;
} }
if (addr_len == sizeof(struct sockaddr_ax25)) { if (addr_len == sizeof(struct sockaddr_ax25))
printk(KERN_WARNING "ax25_sendmsg(): %s uses obsolete socket structure\n", /* ax25_sendmsg(): uses obsolete socket structure */
current->comm); ;
} else if (addr_len != sizeof(struct full_sockaddr_ax25))
else if (addr_len != sizeof(struct full_sockaddr_ax25)) { /* support for old structure may go away some time
/* support for old structure may go away some time */ * ax25_sendmsg(): uses old (6 digipeater)
* socket structure.
*/
if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) || if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) ||
(addr_len > sizeof(struct full_sockaddr_ax25))) { (addr_len > sizeof(struct full_sockaddr_ax25))) {
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} }
printk(KERN_WARNING "ax25_sendmsg(): %s uses old (6 digipeater) socket structure.\n",
current->comm);
}
if (addr_len > sizeof(struct sockaddr_ax25) && usax->sax25_ndigis != 0) { if (addr_len > sizeof(struct sockaddr_ax25) && usax->sax25_ndigis != 0) {
int ct = 0; int ct = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment