[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20141120085425.GM7996@ZenIV.linux.org.uk>
Date: Thu, 20 Nov 2014 08:54:25 +0000
From: Al Viro <viro@...IV.linux.org.uk>
To: Dmitry Tarnyagin <dmitry.tarnyagin@...kless.no>
Cc: netdev@...r.kernel.org
Subject: very odd check in caif_seqpkt_sendmsg()
This check is very odd:
if (unlikely(msg->msg_iov->iov_base == NULL))
goto err;
What happens if we get call it with msg_iovlen being 0? verify_iovec()
(or rw_copy_check_uvector(), for that matter) is just fine with that -
sendmsg() purely for msg_control is normal on e.g. AF_UNIX sockets.
And we end with ->msg_iov pointing to iovstack[], with iovstack[0] being
uninitialized. So at the very least your check is going to yield random
results in that case.
What is it supposed to check for? Note that memcpy_fromiovec() won't blow
up on NULL ->iov_base - with zero len it won't even look there and with
non-zero it'll fail with -EFAULT.
Was that intended to be if (unlikely(!len)) fail with EINVAL? Something
entirely different?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists