From: Jakub Kicinski <kuba@kernel.org>
To: Khalid Masum <khalid.masum.92@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Pavel Skripkin <paskripkin@gmail.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Alexei Starovoitov <ast@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Nikolay Aleksandrov <nikolay@nvidia.com>,
syzbot+1fa91bcd05206ff8cbb5@syzkaller.appspotmail.com,
Paolo Abeni <pabeni@redhat.com>,
linux-kernel-mentees@lists.linuxfoundation.org,
"David S . Miller" <davem@davemloft.net>,
Stefano Garzarella <sgarzare@redhat.com>
Subject: Re: [RFC PATCH 1/1] net: kcm: Use sk_psock size for kcm_psock_cache
Date: Wed, 13 Jul 2022 11:16:37 -0700 [thread overview]
Message-ID: <20220713111637.7eca089c@kernel.org> (raw)
In-Reply-To: <20220713063204.6294-2-khalid.masum.92@gmail.com>
On Wed, 13 Jul 2022 12:32:04 +0600 Khalid Masum wrote:
> `struct sock` has a member `sk_user_data`, which got its memory allocated
> in `kcm_attach` by `kcm_psock_cache` with the size of `kcm_psock`. Which
> is not enough when the member is used as `sk_psock` causing out of bound
> read.
>
> Use `sk_psock` size to allocate memory instead for `sk_user_data`.
>
> Reported-by: syzbot+1fa91bcd05206ff8cbb5@syzkaller.appspotmail.com
> Signed-off-by: Khalid Masum <khalid.masum.92@gmail.com>
Odd CC list, it looks like a netdev problem but netdev@ is not copied.
We had an other parson looking at this on netdev. Is this happening
when legit kernel socket gets mixed with BPF sockmap?
Does this fix work?
https://lore.kernel.org/netdev/165030056960.5073.6664402939918720250.stgit@oracle-102.nfsv4.dev/
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
WARNING: multiple messages have this Message-ID (diff)
From: Jakub Kicinski <kuba@kernel.org>
To: Khalid Masum <khalid.masum.92@gmail.com>
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Shuah Khan <skhan@linuxfoundation.org>,
Pavel Skripkin <paskripkin@gmail.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Stefano Garzarella <sgarzare@redhat.com>,
Alexei Starovoitov <ast@kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Nikolay Aleksandrov <nikolay@nvidia.com>,
syzbot+1fa91bcd05206ff8cbb5@syzkaller.appspotmail.com
Subject: Re: [RFC PATCH 1/1] net: kcm: Use sk_psock size for kcm_psock_cache
Date: Wed, 13 Jul 2022 11:16:37 -0700 [thread overview]
Message-ID: <20220713111637.7eca089c@kernel.org> (raw)
In-Reply-To: <20220713063204.6294-2-khalid.masum.92@gmail.com>
On Wed, 13 Jul 2022 12:32:04 +0600 Khalid Masum wrote:
> `struct sock` has a member `sk_user_data`, which got its memory allocated
> in `kcm_attach` by `kcm_psock_cache` with the size of `kcm_psock`. Which
> is not enough when the member is used as `sk_psock` causing out of bound
> read.
>
> Use `sk_psock` size to allocate memory instead for `sk_user_data`.
>
> Reported-by: syzbot+1fa91bcd05206ff8cbb5@syzkaller.appspotmail.com
> Signed-off-by: Khalid Masum <khalid.masum.92@gmail.com>
Odd CC list, it looks like a netdev problem but netdev@ is not copied.
We had an other parson looking at this on netdev. Is this happening
when legit kernel socket gets mixed with BPF sockmap?
Does this fix work?
https://lore.kernel.org/netdev/165030056960.5073.6664402939918720250.stgit@oracle-102.nfsv4.dev/
next prev parent reply other threads:[~2022-07-13 18:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 6:32 [RFC PATCH 0/1] Fix KASAN: slab-out-of-bounds Read in sk_psock_get Khalid Masum
2022-07-13 6:32 ` Khalid Masum
2022-07-13 6:32 ` [RFC PATCH 1/1] net: kcm: Use sk_psock size for kcm_psock_cache Khalid Masum
2022-07-13 6:32 ` Khalid Masum
2022-07-13 6:37 ` Greg KH
2022-07-13 6:37 ` Greg KH
2022-07-13 18:16 ` Jakub Kicinski [this message]
2022-07-13 18:16 ` Jakub Kicinski
2022-07-13 18:25 ` Khalid Masum
2022-07-13 18:25 ` Khalid Masum
-- strict thread matches above, loose matches on Subject: below --
2022-07-13 18:13 [RFC PATCH 0/1][RESEND] Fix KASAN: slab-out-of-bounds Read in sk_psock_get Khalid Masum
2022-07-13 18:13 ` [RFC PATCH 1/1] net: kcm: Use sk_psock size for kcm_psock_cache Khalid Masum
2022-07-13 18:13 ` Khalid Masum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220713111637.7eca089c@kernel.org \
--to=kuba@kernel.org \
--cc=ast@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=khalid.masum.92@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=nikolay@nvidia.com \
--cc=pabeni@redhat.com \
--cc=paskripkin@gmail.com \
--cc=sgarzare@redhat.com \
--cc=syzbot+1fa91bcd05206ff8cbb5@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.