From patchwork Wed Oct 19 19:34:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jane Chu X-Patchwork-Id: 13012306 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4144C433FE for ; Wed, 19 Oct 2022 19:35:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 329076B0072; Wed, 19 Oct 2022 15:35:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D7406B0073; Wed, 19 Oct 2022 15:35:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 150E16B0074; Wed, 19 Oct 2022 15:35:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 06F036B0072 for ; Wed, 19 Oct 2022 15:35:13 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C81C71610B0 for ; Wed, 19 Oct 2022 19:35:12 +0000 (UTC) X-FDA: 80038702464.10.BEFCF69 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf24.hostedemail.com (Postfix) with ESMTP id 5D1B718003E for ; Wed, 19 Oct 2022 19:35:12 +0000 (UTC) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29JIOUU0012333; Wed, 19 Oct 2022 19:35:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=corp-2022-7-12; bh=q3HrbbuFG1zPzGRziGaR245Xk+RU6lNvHRVrBcCXn0o=; b=Pdy6Zmskqd5E23bAi5fHLYOuiFyBoSCBJlFvjYEzQM5eS0EU3JCWdTN9VMMt5veziZHH 28kpE8nkDdS1KLu2FCREIaH0QgBFl49cUuHzX5Z/Ab+pB82w6qlzbQqK2aHl+kSifkYQ F4zgfiNso3W/X7vim2qiehMtF3AyjVpULtn6i5MVI4k7lwFodGVP+OtpxqgaNa7XK9DT exsJlKDquF/3B9lCcS5FGX0h1OAAkGIQaYNXyDJ+vbOa2D31yVD03mS0UIAJglYu5SbI qIzR7+fHgPgZahtFFkVjVIEUSVS8TvcYb600RwfXKxEB8Ah0oZLZQXRdzs3OZJBdyNSl uA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k9b7spg7p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Oct 2022 19:35:04 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29JHoApI014612; Wed, 19 Oct 2022 19:35:03 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2104.outbound.protection.outlook.com [104.47.58.104]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hu95223-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Oct 2022 19:35:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UjPuph8rpRDtkb6sgAWpd/5ymlI4mrua1OUHmZi8aSlLS31fx8HT4/4XIq6aCt+GaXG6kvGVJakqjVX6/wPBQpq09GfPc44P0KjZxxgszQ44MYxi22T6CR0gZ53BP7THo50HdT+qB8BOjmpC6PDl1972qVWR0AKClv+92iUp6Q598f/ouc3wyJR+Og+HrQufh7kqiYwsGhPeCX+ouKzu7bEB5qhzMmxP2P47EA0EBxFeyLovQOFXGH+x6EQsipcghOKYbAiWvWbsE6Ys0aTRdhhCZhufEdW/MEwurbfXE/vZwZQ1Of4nFK5gmNdbceY7/uYVvnSln5o+uogrrbALQA== 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=q3HrbbuFG1zPzGRziGaR245Xk+RU6lNvHRVrBcCXn0o=; b=mWv/HPjGbFfHhVO0IGa2ElxUs0jqAKWIxsdnEZCa/IGA71wpTpigJQ1HLfCBsjncsowXlsOgZz3LX783yqSjSB6wiZ6qbMh/qmLL5tMr8x33tP+YRPLnn08QNhffy+QsFmHP95n2biBRy4OMyiKGovHVLwMyTbgX5YFJesTEZwl2NnnHfV7K/8LM8hXDmMtKOEVZUub6Au83JNFNBiuFBIB3K+585ZR69AMNDxYKPF9q3V6DUXwt+uE4TaInsra9R5H2NXy8MPQWgZVa0pQjGruXjpaPFC78ZNNFJHkjDeCe3Q7rA5stfzXWsGIBwA+fL9G3KoIbvQNCcEI2DdQsbw== 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=q3HrbbuFG1zPzGRziGaR245Xk+RU6lNvHRVrBcCXn0o=; b=YD9nNgTBPlwUVIx9hJIrHgeKcdRgHtDsoSIHZJ/Hm378vMMc2/EwiheCPevQEGrGWT0/RixW2OIPXCdJAxDnk8JlxgTK7IlvT6asW/0KhLojo+3G8WkGjpkKS/trOXs2FLrCEr/SAIyJvRRvV7WU3CjzuK9snQDwvStlHphM5+c= Received: from SJ0PR10MB4429.namprd10.prod.outlook.com (2603:10b6:a03:2d1::14) by CH0PR10MB5274.namprd10.prod.outlook.com (2603:10b6:610:dc::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30; Wed, 19 Oct 2022 19:35:01 +0000 Received: from SJ0PR10MB4429.namprd10.prod.outlook.com ([fe80::b281:7552:94f5:4606]) by SJ0PR10MB4429.namprd10.prod.outlook.com ([fe80::b281:7552:94f5:4606%7]) with mapi id 15.20.5723.033; Wed, 19 Oct 2022 19:35:00 +0000 From: Jane Chu To: pmladek@suse.com, rostedt@goodmis.org, senozhatsky@chromium.org, andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: wangkefeng.wang@huawei.com, konrad.wilk@oracle.com, haakon.bugge@oracle.com, john.haxby@oracle.com, jane.chu@oracle.com Subject: [PATCH v3 0/1] vsprintf: check non-canonical pointer by kern_addr_valid() Date: Wed, 19 Oct 2022 13:34:30 -0600 Message-Id: <20221019193431.2923462-1-jane.chu@oracle.com> X-Mailer: git-send-email 2.18.4 X-ClientProxiedBy: SA9P223CA0023.NAMP223.PROD.OUTLOOK.COM (2603:10b6:806:26::28) To SJ0PR10MB4429.namprd10.prod.outlook.com (2603:10b6:a03:2d1::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB4429:EE_|CH0PR10MB5274:EE_ X-MS-Office365-Filtering-Correlation-Id: 5cb9cbae-1a8c-4956-77a2-08dab20902ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VlnHlS+l5LcAhiKPSqfIQ0BFBf3V5eNSeBfXB5g2nwHLW6641w60AYs11xshF+Eel2JxXwBGbS02WJOjeMS7RouyFtt3Osz06Vsxy2hdU0H6lXhtS+c9n1ebgwXOALlL61mn8ayFQi+Wc8FGN+ReEWxwZU643nSmcgZqLRAindJpiyCOP0b9KE2ob+zG6L4uuj051QggjCkV1OnK/Aofmw/FpsaCi4pXID/DlDy2cfL843aHIaPcVEm5dOKRKBqpF3u+B2rTkHBX6J8jq7HYYZ2b7RHCjTukoCZjmrEHZ9AG9em8MLHqzqf+kCHl3MHKGlfuQBZ0jDLix9CbkaRAd5qEj7hh71J01DFRy8ItorWMtHo2gIA1E2yqfYgRoV+H0vxjOMLHG4/X00psnD7MVXJx7KJiQTKoKo/YIGIQqjui6jm0/oy09t3ROFvGiqJ0HgnseZw36jvT45SR2Av7CSKJnCLAEIWDS1FJDQHMVlB+5+aM5/hfVIGUuelgmJ/5fdDSHOqnOANVriWxx6MWJzcL1ZH+wTUGuzHtCtbCNleeiBeXuw4M3h49wJQQdVohU9lDwyc9/SU5aVWlqjFu6y2GeGJqCXnn0n4I0IKtTFvmsr3d3mjO+qheAyvJFjxPCAwVC99RNQ28203CUXBjDCli0c4k7WzuLSGEDekynIQmUAzEj7A8EnQm9hKdKKh5+5MslSlWHmQ1HK1VYVJjylQsw1a+CFBwhhHTwfi2BRBFAQugbRChHMbZIZUfQm5apFtNJCp2ek4fCKSyAJj/fQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4429.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(396003)(376002)(366004)(346002)(136003)(39860400002)(451199015)(966005)(38100700002)(478600001)(6486002)(186003)(6506007)(36756003)(4326008)(44832011)(2616005)(4744005)(316002)(66946007)(107886003)(66556008)(8676002)(6666004)(6512007)(5660300002)(66476007)(1076003)(2906002)(8936002)(86362001)(4743002)(52116002)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uplvN3cslnYKaMhjD5+2O+bFbyLZKhkMGfr/zqETUlGszfgmm33IgcNtmgw5Ob1qL/Jt3jrQH7Wn+2BLOcclONxIhOkQ8DL00spJE2mHxpsgiaiYSSsgEaSLpXDE1RAX2CQIfjF80+sx4WajMP1mKVza0VDGqTrN9WipgBRy1BMljcJAmSFN/ljfch+bWbutbBlYIOu68Pvyj3K5gjWQmN6kfOPuEKjVc/t37RLqFjxrnUVkY66C2SdsXmM9yFIE+WkPW0rOAzuR6zqwF6zd+hzlhdykADQS+D7nsWik+NnO4weebbSGMgN6FYuSWCGMn68DXGy/oKtlnhXAD2QAEDL/tYOE+ZayAsx+HBZPUBIbhp7vMR6G4a2saFhl6HQlC2vFM11AXCZJwf1AuVrKMJx7lKU/tdLupoWcPGSUGFxkGuI9TQ09BtNLKGR8lDnFz8908osNJXZzRaoX8TYy4R6htq3Nhp3Np3z8H3fljD2wQvwA1m9ZMx3OKosMEfjcnWDFhHusQxTeOZVTzo5Egitxou3OaXJ9Sl7pIBet6e0ney09kjq3viDxERzV7wBD3u5LquXIrs5e3Qgoqpu8T/CF7Wmgqj91ZcUtDgE5T9BsJMCJsqjLilv/DHM/NtYmfOscN8ZH5+pTsvrFx+V9t1xFiU7rD2KcEtXM4WnAAWRb+3kKgnA/GUu1dZS2g3L/yQvF8zS3sregsitV6GQKfUIS2kSeRs8g1mCfPxZRTxMWLqT7ipneCWKrnXEzZjV4YlSLp9RWag3BRCkHWJfX0bPxri7y6P8IZkkhGENO4ukJ1wT+Sdnm5wehMle4XTtH43q4oQ2TQ4/LtHx7vf+3SZpmjUZSddO1eolwoa3F+lP4hZ1HijE2V9p5bEhZElfzLNKNIOnvIIJhZWs9zQ3fe3K7CiUld3+bhkZrPR8NmIiqYhoPWXPfGDJqVVHP5VxlYYf5XnDyWk6DaDjusG2cN4X9P6Qcfp1S5k3RNtm+Y9MifzeppPajXwXGEPk7BIb4OgLvi24ogh0zzIxD4/e7flgkCCZjIGmZiGUS9x36T/rMGTtzoGJro2Yaiev0K6xWT9vE/uej9rqv4CpmDVkLadKJB+oGQQah7X0uHzd4ooK6MPcXmgglOD2VOXCeT1syVuK/tZpZtCZopBGSn1+Ck5qSGtwGE7SmNbLS1bCl5CSg6K9yJ7NyxvmOUcRFNalJaXzxlbE4mMBPyp8O068Ph1VEG8lKI/AW8tP7pwJjB65YxSiiYYtfPlAtx22YA5VxHEUmcI5lcIXN0HQcc0MTyos+MjGqIjcjMulDkuZjOc1uAVkwxRz+0KBEkv/Ke7ZnisrxyLO68Yht23CjWR/xk3FJUiy62iOGzZ0SAiozlHtW/GycY5MneVoBNFu0jKGYqVbErP3MwEcwB2bKQnVmOfLbGEdp8Ell4N/9G4i+MHsgPHgD/T5KxK3X7A0yWM8CM1AfRL4C6LOx5s2HaF04yP51Ey5LoOLDEUY+JpNe+7/22oiHG6M7Fx4vMOPIyBZLqgI5SDsFNoRveVzOIrniecx37Z5bj2I+uAJy9aC7ccAwbtk+1WW/79a9IrmhhwMVdevJHB+tdJDUa4MJREV7Gg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cb9cbae-1a8c-4956-77a2-08dab20902ee X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4429.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2022 19:35:00.5134 (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: qopetYT5WvdM5v8u3P2XR4SHbu9irmcS/7q4Vi0zou3G0nPFxT85pCgQJ3f2N+qg69BYObtfv82O0WFqqsfmbw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5274 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-19_11,2022-10-19_04,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210190110 X-Proofpoint-GUID: e9OI1zHnF6YtkUk2MBYviomF6lSPs7IL X-Proofpoint-ORIG-GUID: e9OI1zHnF6YtkUk2MBYviomF6lSPs7IL ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666208112; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=q3HrbbuFG1zPzGRziGaR245Xk+RU6lNvHRVrBcCXn0o=; b=7Z5V/tf/Au4Icn0rBjy/GMj02k9dkKPkj4dXC27PLW4I0/V7zbCa8lrxRl2hcNJfM5rsUa QfFRL6XkABmGcOdzauUDZ4Xcfkz+jPdkgvv/cggqJWjdE7gOUBKPFPb6xFw60YIz0JRTci 8CCFfgk9NrDEVIUkBAHAxW+K/r44j5k= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=Pdy6Zmsk; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YD9nNgTB; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=jane.chu@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1666208112; a=rsa-sha256; cv=pass; b=TAF3iUUUk6HIjEPD9nXbNMf1SZWh//CTQGalDOc1RXone6Y/TVx6PZpUDeHQ3LktipCCJF iDS089aQBUBrlIO5gz0gg+S44VaTi/z9EcPDn2LrQ+KXHo9rdeUljN6wxUnrRDORq9i/bd WTNNNYS6wl3kAKIF8l6oXlALuN+U8aw= Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=Pdy6Zmsk; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YD9nNgTB; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf24.hostedemail.com: domain of jane.chu@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=jane.chu@oracle.com; dmarc=pass (policy=none) header.from=oracle.com X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 5D1B718003E X-Stat-Signature: 4u5j1e4gsudc538p5kcubg8hpw1mrtxm X-Rspam-User: X-HE-Tag: 1666208112-963096 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Changes since v2 [1]: - revised commit comment for clarification; - cc linux-mm for expert's review on the kern_addr_valid() usage as suggested by Petr; - cc Kefeng Wang in light of his recent patch [2] [1]: https://lore.kernel.org/lkml/288a7aba-c647-b51f-bdb3-99a62449dbb3@oracle.com/T/ [2]: https://lore.kernel.org/lkml/20221018074014.185687-1-wangkefeng.wang@huawei.com/ Jane Chu (1): vsprintf: protect kernel from panic due to non-canonical pointer dereference lib/vsprintf.c | 3 +++ 1 file changed, 3 insertions(+)