From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D839C43334 for ; Wed, 13 Jul 2022 18:16:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A5412408C0; Wed, 13 Jul 2022 18:16:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A5412408C0 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=pf1liw+3 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0xG0Xky_UQc7; Wed, 13 Jul 2022 18:16:46 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 71848404F8; Wed, 13 Jul 2022 18:16:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 71848404F8 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4BADCC0035; Wed, 13 Jul 2022 18:16:46 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id BC4A9C002D for ; Wed, 13 Jul 2022 18:16:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 97516824EF for ; Wed, 13 Jul 2022 18:16:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 97516824EF Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=pf1liw+3 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sSkZSnrzOPHe for ; Wed, 13 Jul 2022 18:16:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9750881AC4 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by smtp1.osuosl.org (Postfix) with ESMTPS id 9750881AC4 for ; Wed, 13 Jul 2022 18:16:43 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C9B77B81DE4; Wed, 13 Jul 2022 18:16:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8812DC34114; Wed, 13 Jul 2022 18:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657736199; bh=C+dEVk+WY2th6pPe+z1y4n1Q4cLvYAUNYfWrDpjUD4w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pf1liw+3Zhvb5IoIJVnWC/juTneqqYs4RSUcjEkpAu/BRnYh1hM2rljLxr39plwoM FkS1uk8zcPKnkRl2Ui/ID9V8OeOBcz5uJYTOf64cyuinuCs0nxWNC5L5lT7BzFC9Og 0/QjjAfZT4YQKkg5m2z9Ciq1365b+3wQPg/kXckyY7FUNsA8CD30KeM+Q+nMmWDkRb IqtFsEShmroJ4hIyv9oC0c9TJINDulw8qcpZTt/T1WM/4nHtVMvpoolTyckC1JyYcq FFlXSCSTPVAKeiIOFJPJnPeFC/0x8pQlV12ozIabI6sGy8Uicq8/31JZfJQfNfpCNA 0ysrpJKcGN2kQ== Date: Wed, 13 Jul 2022 11:16:37 -0700 From: Jakub Kicinski To: Khalid Masum Subject: Re: [RFC PATCH 1/1] net: kcm: Use sk_psock size for kcm_psock_cache Message-ID: <20220713111637.7eca089c@kernel.org> In-Reply-To: <20220713063204.6294-2-khalid.masum.92@gmail.com> References: <20220713063204.6294-1-khalid.masum.92@gmail.com> <20220713063204.6294-2-khalid.masum.92@gmail.com> MIME-Version: 1.0 Cc: Florian Fainelli , Pavel Skripkin , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Alexei Starovoitov , Eric Dumazet , Marc Kleine-Budde , Nikolay Aleksandrov , syzbot+1fa91bcd05206ff8cbb5@syzkaller.appspotmail.com, Paolo Abeni , linux-kernel-mentees@lists.linuxfoundation.org, "David S . Miller" , Stefano Garzarella X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" 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 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