Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp763349rwb; Mon, 26 Sep 2022 05:40:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kO8LXxST7L37r9lBd7MDAV1t40SXDx8TCXLe/02IQpfkvrMcN7/oNfqN3Dd+vgg8l9TOn X-Received: by 2002:a05:6a00:4006:b0:53e:815a:ff71 with SMTP id by6-20020a056a00400600b0053e815aff71mr23443042pfb.4.1664196013082; Mon, 26 Sep 2022 05:40:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664196013; cv=pass; d=google.com; s=arc-20160816; b=LtJlYqKn4prksdenFf3QJl3h+78V+g/dp5sF08ujgBySP+UKhsHbHeGFFfeUsRkGDO 3vAwDjL0PEr7ctOYFLcyPBZNejelp8yHDbziQtOqln30qUeCINGQP0rPaJhOm2CN0Y6P LQEw5R/HWRzNcy6b+sD2rnFGB2n4706LmZZNyERzzbEA4c0ZIIj6vL64J33oD9uWaDDB yHFqfrz8wjcJnPDUDq+pfsYyGk/N2XUs2A69rPgbyRloGNuOQOK/C0YMs65QVUE0rkpU dCllM62KJ4AqzR9scn6dXAtbLjMVPd49n86olMmbHHFATX/ew4kBk6AxpA2M14Y+IbnA X1xA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=CxU2AnEsYLXVnDv+qL/aH/xo+fOZf4+Hc2Gs3NPeYK4=; b=K9wJioYiYjsXdww1PW7CxygzrXQcRIJvE2g9Q5C2+yHBj8i0hVVFFP2pukaC3t9fud 6atIytMkLpNCSFh+GIjDXw8nwsF3f/Ay0jntuf044dkaSWbj7gPyNaqWURg2lDaFnRLq QyofilPaxSRWdJPkoyUXRFRbQwgNJifU+U9q6mBwFHK9lKut9IgPw9xlasrqBHtfKrbM 9w8q47ozxiTCLJYCY/Gsnw2M7teDUXZF4rvTJ9IM+XRe7e5JHpaimevwlAJaiXfV136P HnM8IF0Tk0S7vomP7jZAA5nkYF350Vj3bhEcZaTvVKzpcJMi/gedFPYCcAQC4UMgKtbB 6K1g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=v7FlCDv4; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=SzBbPeoV; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id np9-20020a17090b4c4900b001f31f339134si12215532pjb.152.2022.09.26.05.40.00; Mon, 26 Sep 2022 05:40:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=v7FlCDv4; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=SzBbPeoV; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235729AbiIZKba (ORCPT + 99 others); Mon, 26 Sep 2022 06:31:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235800AbiIZK3M (ORCPT ); Mon, 26 Sep 2022 06:29:12 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BFC039B9E; Mon, 26 Sep 2022 03:19:16 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28Q8k5tt030467; Mon, 26 Sep 2022 10:18:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2022-7-12; bh=CxU2AnEsYLXVnDv+qL/aH/xo+fOZf4+Hc2Gs3NPeYK4=; b=v7FlCDv4ISMUL/3lkmc4jwb6uHrt9nw/GYITd6H/oZJVXIilM96nf9sC7vip9Jb1WZ6g szjeehZ6GWLcKqpHCsqnnjXzoYU0gUCasKeLCu+pLMYtwpb2Lngd+Vai8ayCjr5To99Z //QR51Rwju7HyDCJ7XjeKof/kuNL2A4A9oYnNCu1Beoikm9sSovoZAM7G5US8lBqVX4o zG094WXcLffxlV3iIncrXepfdEe0yo0k9RwhGOC2A42EwpXrrdxSE3QFm+3rItQSUzfh OBKgXJ2x3Sq/ukLJ9jc6kiR3DyyDvwiPGQyyK9ONk9z6QzcQBRKhrN5dbaqBWsGOnhTy Ig== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssubb65d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Sep 2022 10:18:45 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28Q96VaF002639; Mon, 26 Sep 2022 10:18:44 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprt338v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Sep 2022 10:18:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qu4Ju++H4EUXPpSGcXSKjteCF/m6/c3uqdj7BHsBISdVAAXg/uB7s3sGWuCUfUJaIGvNWHIeADaMiqRdBCOP5lyia7EjuPww84SddBHbVMLx07a1Cp+vY3bPOgyww5pO+dYoRg6yPqvjWD6LkGuil4NHPK5jnlV35/c8CeufvawGlXFS7rSPV3zQqQUDOiwqWL/NqQ37UjGusb1bzK5kG0GDqgMU/7rsyv4M2p64x4/swxu1IZoDrRy0yY9aMB/+KdJjIoyVNCSNMrwsncORgzxhmuRTl9ljL1ap/VUyoV3WOHY3SYsW9W+mxVAjhiUutbW9EjEPJfj7LKwG70840g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CxU2AnEsYLXVnDv+qL/aH/xo+fOZf4+Hc2Gs3NPeYK4=; b=BDLxGQmIod4xJX96B5v431bR18tcKV1KY9w0D1nZsPfWtcmZvhxWo+kxBlUPTmuXU3dlzH/Isi9vYmuyNVDmQl7GoLQRA2Yui6jM15foENxNC7HHp42lRH2tRtvXVS7iRDM+/hLCpb+uWUVBbuQSkrINRtO2At0OgNCn8HG1mJyUUlveDb5JAxatv4HT1gDCs0tt4kHJsJnYzf1v00M0/yb7UMkkdTCQXsQ66H/QHwbQSvXHa5ZfIe4lHTVtCexUw26uFvfFUh39I7+gcEieY407IpGB9VMAC0SU5iDjYoo5srDeVyAQoXjLmoH8krQAbMUTQJUSv9yTzHnShsSbTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CxU2AnEsYLXVnDv+qL/aH/xo+fOZf4+Hc2Gs3NPeYK4=; b=SzBbPeoVrsNI3qAhC7llYPP4cx5c9wDVgfOjGKwZdoS2FNlf9KyYm4IGh2j6roRf6c9YGvQVijqfa0/dZ1BhGqoh75fWZzCHFEOU09Qu52GMSb8/yxNU2iOyGKzgdg/2yT10agZULB1D7OXVAy/crlqwegs64bcp6XZWQchLL9U= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by PH0PR10MB5794.namprd10.prod.outlook.com (2603:10b6:510:f4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Mon, 26 Sep 2022 10:18:41 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::a493:38d9:86ee:73d6]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::a493:38d9:86ee:73d6%6]) with mapi id 15.20.5654.025; Mon, 26 Sep 2022 10:18:41 +0000 Date: Mon, 26 Sep 2022 13:18:25 +0300 From: Dan Carpenter To: Jamal Hadi Salim Cc: syzbot , davem@davemloft.net, edumazet@google.com, jiri@resnulli.us, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, syzkaller-bugs@googlegroups.com, xiyou.wangcong@gmail.com Subject: Re: [syzbot] WARNING in u32_change Message-ID: References: <000000000000a96c0b05e97f0444@google.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: JNAP275CA0015.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4c::20) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2365:EE_|PH0PR10MB5794:EE_ X-MS-Office365-Filtering-Correlation-Id: b5241d76-a948-405b-84f0-08da9fa87c49 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +9UkdO3/r01YXAA30TcGUip7bw8GTqpWvOK9oE9THuK+BnSwGw9T0RLWQMV5F5+vwJgMueguLkfzSCUW3v4T9hbLEmhgUJc22wwh/tZcmJgqumNLNZT4W243UA+IRvVBbnnfGmagytqufL74DrVlTaNfDhfyegExuOVVdwaTs7gAoIt0bIFCBxTpinQyJLswY85+HQeDk1lBj6z+6UXYCZQHBwiroEXA4KI5+MCloXsyX60sIjGB/mmgnh4HIw10TG1twCDHNlvTRPlnXKLd5dzj6bBFTdYIIISp/X5PHdj/6bmfTCaqdd+kmJiTwJaOAyA1JfoybLJA3nyuQnVSoiODznDKhUVjkAmpwkBNHnRRbyTSjEiQs/8PgCXwg10R7bteGoV+RWThpW2Ed+gEc2Wbogg1eYSLJOLY1ui8K/uTHPJMi0IUvVFa3uqZv3SPvhIslots5ZNo0arVkB3nhgSna+bAjS9xLgfA6A7DnsDdZVWTcxTPFRM2hUGcpQonWxmRHpJIO+yRy7MpUfO8fGLelaxqspiuaRVtx+8FVGGC6kCs2e5Cw/aHuPMj7VORMWHQDNDoqCz9j/1AbqaBr4BdYfDJVVw+fFgrZupRZxFFxxUwXETnqY9RUBfAHX4Bpqh8Q4b8j+azIztv8VBYUhKbHJM++GYTRlW0Q1cVLdSlCp/deJnLtl7w88+oNQO3QvQYgx8hC+vkhrAQsmBk8g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(7916004)(366004)(396003)(376002)(346002)(136003)(39860400002)(451199015)(6916009)(316002)(6486002)(478600001)(83380400001)(66476007)(66946007)(66556008)(8676002)(4326008)(41300700001)(6666004)(6506007)(5660300002)(9686003)(53546011)(44832011)(7416002)(6512007)(26005)(2906002)(8936002)(186003)(38100700002)(33716001)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?V8SvV0DxzuWQ/Qux3/Hks0AsVpv2Wew64nqtJy6aYe2qkFZt1YiLFViLuUyg?= =?us-ascii?Q?AqdaRKWvNRBrR+jqiUtrRb09WpYB5xAMHEN8ApjZFKqQYgKO5h1EsBLwyUqN?= =?us-ascii?Q?Fo/A1muxTzgXAAVlH/J0HWCmm+ramUcSE7gO6osAzQr/6RV/vs7W9ZZd4+og?= =?us-ascii?Q?pr2chYIECGcOX9cVa18ycnQ0KS04hz73gO8qjKViN1w+iWlwBTxCFbEDDqNj?= =?us-ascii?Q?e2Xk4YpbUk+FCjQ1ITvyEl4xar8AZOq2kfqDSy3Q5LdF7y/XF6XhKDq3/9e1?= =?us-ascii?Q?8GkFdIe2dNaRRclBDWHkIOzGU0ggJlBIpmZpjgoY+jmL+q0aoGB+hv44x0tJ?= =?us-ascii?Q?hvWa6vsoX6ZyW1FusV11jlMKAv5u8VVvyuKFyOL/EFYXbuSGdNcmolaBv+tE?= =?us-ascii?Q?zkCOqMSkOPVh1GBMifPiKOVKeBwboXO2Pktyo2oozCXLtlhnIm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RNux+yVDAbHr/Ec60O9GfWa6UyhvyX4rT?= =?us-ascii?Q?Uv0wNUtwC/6nYBQrFuXUkdGd8PZ62UiG16oLi9X0JHpBGYQEoDxLTmfSD0Hb?= =?us-ascii?Q?bFVamIGuVRhG9PDWqK91tad7NkD4IkSWTHYZwvsGWYqzOFCasC5rkZDMHJwf?= =?us-ascii?Q?DgkHohjaBm/VTNzq30oY1ipujwpDclihIjyDZdYIaCDCZfqqfpcqmLDp74s4?= =?us-ascii?Q?c5tLJHrtAiEjwtXQMcrC3EpBuGeGmuuRWJ5xJWOg?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5241d76-a948-405b-84f0-08da9fa87c49 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2022 10:18:41.7517 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2s1q2M2mCKM3aqyHAMH6HAM7dxWoIYkf7nKq1EO9HYlEp8haBpDZ8RoaGRc0I5ns5Fz/dmLgToz9KMo77wJPDtRM0pm+ABPmXFLgon7NKZY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5794 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-26_08,2022-09-22_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209260065 X-Proofpoint-GUID: xk1oJwikq05gZxPzuAxQ1BfSftH7NBlE X-Proofpoint-ORIG-GUID: xk1oJwikq05gZxPzuAxQ1BfSftH7NBlE X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 25, 2022 at 12:14:44PM -0400, Jamal Hadi Salim wrote: > On Sun, Sep 25, 2022 at 11:38 AM Jamal Hadi Salim wrote: > > > > Is there a way to tell the boat "looking into it?" > > > I guess I have to swim across to it to get the message;-> > > I couldnt see the warning message but it is obvious by inspection that > the memcpy is broken. We should add more test coverage. > This should fix it. Will send a formal patch later: > > diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c > index 4d27300c2..591cbbf27 100644 > --- a/net/sched/cls_u32.c > +++ b/net/sched/cls_u32.c > @@ -1019,7 +1019,7 @@ static int u32_change(struct net *net, struct > sk_buff *in_skb, > } > > s = nla_data(tb[TCA_U32_SEL]); > - sel_size = struct_size(s, keys, s->nkeys); > + sel_size = struct_size(s, keys, s->nkeys) + sizeof(n->sel); Smatch will soon start complaining about these. Can we instead do: sel_size = size_add(struct_size(s, keys, s->nkeys), sizeof(n->sel)); Probably eventually Smatch will be able to detect some times when struct_size() is used for readability and not for safety so maybe it won't warn... regards, dan carpenter