Message ID | 20210312165948.909295-1-eric.dumazet@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 50535249f624d0072cd885bcdce4e4b6fb770160 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: qrtr: fix a kernel-infoleak in qrtr_recvmsg() | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | fail | 1 blamed authors not CCed: bjorn.andersson@linaro.org; 8 maintainers not CCed: cjhuang@codeaurora.org baijiaju1990@gmail.com wenhu.wang@vivo.com loic.poulain@linaro.org miaoqinglang@huawei.com dan.carpenter@oracle.com necip@google.com bjorn.andersson@linaro.org |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 3 this patch: 3 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | warning | WARNING: Possible repeated word: 'Google' |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 3 this patch: 3 |
netdev/header_inline | success | Link |
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Fri, 12 Mar 2021 08:59:48 -0800 you wrote: > From: Eric Dumazet <edumazet@google.com> > > struct sockaddr_qrtr has a 2-byte hole, and qrtr_recvmsg() currently > does not clear it before copying kernel data to user space. > > It might be too late to name the hole since sockaddr_qrtr structure is uapi. > > [...] Here is the summary with links: - [net] net: qrtr: fix a kernel-infoleak in qrtr_recvmsg() https://git.kernel.org/netdev/net/c/50535249f624 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index edb6ac17cecabd94fe392eb4f589dbbbf7bfa2c0..dfc820ee553a0948cc64f25f5b8f9c5d0061cfd4 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -1058,6 +1058,11 @@ static int qrtr_recvmsg(struct socket *sock, struct msghdr *msg, rc = copied; if (addr) { + /* There is an anonymous 2-byte hole after sq_family, + * make sure to clear it. + */ + memset(addr, 0, sizeof(*addr)); + addr->sq_family = AF_QIPCRTR; addr->sq_node = cb->src_node; addr->sq_port = cb->src_port;