Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1142525pxb; Fri, 27 Aug 2021 02:08:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoxHmz+o1iS+ItZwoq0wFLXSytkiC2FYcuwrxm65gkAespQqAuO6kPZu/atTL1vJrC32uc X-Received: by 2002:a05:6e02:6d2:: with SMTP id p18mr5907128ils.44.1630055309243; Fri, 27 Aug 2021 02:08:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1630055309; cv=pass; d=google.com; s=arc-20160816; b=HU4VK/MI2pva+yjGrE4jpUphDw2EAFiCL4U2X6mU2ejuuJyr2uJ4JGBodrPQIj9Y9z 9OGOmpwUYCnnhxpbpfyDDDctbTGbtx/g0I43PyuJSlHDvEhe9xvzAS8dOVXy9NNrdCvs M/UPwI8IAxE7zYRbq/ljROoV4mvnNdker1f+MUi862i+TEVK9RkTO27JfnEuM+rom2tz OmWHxNkjJwTiOMx/DVg09c7nNADUcVCev9iIlOJUxkTf8xJOTqet8WZxLXAxEklTKXMm rQu6GU+rEkxUQc78LQmuDp3r8st3/fMZKo5QkgBG0jvBoymJUnSTUzcSlEQHqZNNeSMw Wpcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature:dkim-signature; bh=1NlA62nxTuhcwvEY2cAfwLS0IHS+WNovlyzXRJv3EJ0=; b=BJ+xcUnyg+spz3mzM2S3MyE0PfOTqbs7zJL+Gccfdapwe6MYi8Sr85L+A6UbOrGuJh bF4FtU6RKziyqOkq5YxNRRTKwBOQUmpVY2mUKhDXaiFaB18RNRV+5/PM9R8ew2SOPAY5 3AaT9adeq0FmU+j//C17fnpckScVKA0OkQk4JFpjKuH0ezxg+E4JESxkP3TVicorUs/S WAR9/YEhkjpgWyP7ZbemOGWSLqs/fjwrbyAw1oxxLUj534tPjwCXeqqEybIEPU54qmxH cyMQ4aDm+3SJ63E15GXjFhKxbqA0ZyQnqxwqeFoOb0G45RT+m4UWCtBtEHed8ni8Ep7S E6oQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b="Zpoa/FaQ"; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=g+F1JjJF; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YXthpoq0; 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 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k32si6086595jav.52.2021.08.27.02.08.17; Fri, 27 Aug 2021 02:08:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b="Zpoa/FaQ"; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=g+F1JjJF; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YXthpoq0; 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 23.128.96.18 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 S232817AbhH0JIW (ORCPT + 99 others); Fri, 27 Aug 2021 05:08:22 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:58740 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232048AbhH0JIU (ORCPT ); Fri, 27 Aug 2021 05:08:20 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17R6Ih0u015020; Fri, 27 Aug 2021 09:07:27 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-2021-07-09; bh=1NlA62nxTuhcwvEY2cAfwLS0IHS+WNovlyzXRJv3EJ0=; b=Zpoa/FaQFKPWVBPrRFspLwgPtv2iKxQY95lzrZIruGP3hazW6ps7utEDDI282loFYJsC 0FzPnmNGhNxFVJcnaxADBef6D51/oCjCXGP5rwu0jbTkIS1ArHGx7AW8JjRcWCTA3eJN lzfSq6WQCRF59lXxVQwg7JjEWM+11O0cEQmczP6rkGa9MKvC1+yU7d+9LP+c05J29l+O SZWvQRZIcPuFCfuotWHrxRuvRXUGhwhVg+pVxrVH7UVlOiX0gdXDu7lWafh2r7ClECSY kH6EVWXjNKsusAeJpxkN0A1fkyMKM/wXibTFliZJMBaDpdCizNAs4dp/EEQgYTH0JP+J kg== 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-2020-01-29; bh=1NlA62nxTuhcwvEY2cAfwLS0IHS+WNovlyzXRJv3EJ0=; b=g+F1JjJF71TP3vGvIgjFF99wucd+RLaohL6da8Cf8W1IiHnMBhK+BE/xMiF0pmcC0zV0 fIR9o0mvQr4WC9j3PmosvsBdq6ubWM7VvKbyk50Tep4mIT7uyWzX4Jvx3f8ydjv5PG1C XQpFk//hMEXdBpbkxmbojihgNLVdFfOYBkbsaMunwpbkBDn/mdRucpnlzIYiSTKjvC38 PIBg10Wm8wUoVw+XRVGetXjw9a5FyKMGga8UtVE227yO5THNhhADiClqA57QntfqEdvg IIGd2QhFM8sOJUfb8DNvrf9fRJNdi/mjN9noYrcHZvdUmbm7tCa3YWTNWcL/25EG2x0J Ng== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3ap4xv3286-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Aug 2021 09:07:27 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 17R8tc04017522; Fri, 27 Aug 2021 09:07:26 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2177.outbound.protection.outlook.com [104.47.57.177]) by userp3020.oracle.com with ESMTP id 3akb91rx9f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Aug 2021 09:07:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZXPKV5lLJ9PHBOdYD7ec21GCC+1F68L9FkGleFS2AwEbUOZnBq0oaSQQVZDxjm/mD2PTXAdSILxwKKs1yA/Su00q7vEKG/4aEGLZ//YIKHJ7f0m9g5mjcKk/21Xdjmh6laE4h3n1V7MwREqC9a/9QbsAGHksw5AkasK/lgynyGne79rsV8kPN+bEbxCuCWJwQcewP0sZsBma9Eb10KvwNU3o07s4Q/K1pmulbuEYT5JsuixxbTD0mHQjMq+sUUxl6A/DIx1sFcaZFAtb6W/pMdM/z64pDD5PC/V39WMoMEkx7BkJDwtiqoxpds2ANMJKBZyT8RyfpyY/rPI+/I5m0w== 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-SenderADCheck; bh=1NlA62nxTuhcwvEY2cAfwLS0IHS+WNovlyzXRJv3EJ0=; b=L8k6XJ16fwJIAfq9cFhQIfCxlSBrN2ec5nppdzgLydgq0KF3+wrzHOPXMX6Sy+CyH+iprcM+BwFJ7eyewWSR0XtuWNPuBs6agdD44VBaAilvsoJSDvxvr4z5axBhi5PQ+GnogYnajKMx9cnl57y0EdXq6teXDJadWAAwxisr775mmsOeZ5o6mGZpiqMF6mD9IxawhcrApLM9550xK1Mh8vmzkYFMswi1gyJpM4MhLqN5JIjpxo1iz84nCJKq7ZxGAG+w/EZ+6Ee4hRdGspNUbU/L+RoebqgIeVdPcoz15w+87QpF91RD/ESwNUAVJgDL0BnAKWyuPKi3xjUjJcCYQQ== 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=1NlA62nxTuhcwvEY2cAfwLS0IHS+WNovlyzXRJv3EJ0=; b=YXthpoq0pCidpfKhlhkKubxMvZi/1Q8wmy+iVPkfKU/dfWQKUwTDZTgD3pi52fVSdxeetVgHQQVrFIsVEM2jfJ9S/eq2e5WojfaWqiLoABLGoPXyLKB8Orj+t4vTWQ0AnWuZm6hG1O88lRtG945JXF1WwOPE+ChQx0+pDh9bXDw= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=oracle.com; Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by CO6PR10MB5569.namprd10.prod.outlook.com (2603:10b6:303:144::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.22; Fri, 27 Aug 2021 09:07:24 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5820:e42b:73d7:4268]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5820:e42b:73d7:4268%7]) with mapi id 15.20.4457.019; Fri, 27 Aug 2021 09:07:24 +0000 Date: Fri, 27 Aug 2021 12:07:06 +0300 From: Dan Carpenter To: Pavel Skripkin Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, gregkh@linuxfoundation.org, straube.linux@gmail.com, fmdefrancesco@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/6] staging: r8188eu: add error handling of rtw_read8 Message-ID: <20210827090706.GA12231@kadam> References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: JNAP275CA0058.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4f::6) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from kadam (62.8.83.99) by JNAP275CA0058.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:4f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.22 via Frontend Transport; Fri, 27 Aug 2021 09:07:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a7686cb-4487-449d-388a-08d9693a155e X-MS-TrafficTypeDiagnostic: CO6PR10MB5569: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 893YXZdZn17aKqSlaVY2aTIvZz7OUaDQ6/RSqYcmYuB1uCTIX3jyN75TeV/8VPy/RWzltLZ5plroVIb9QUOKLr9UqjgyTSrC5EFSpDsUR8+UDwIfcS5VyFOVWN0+6Wp/pkkEmTW8P/dgENpOqaJu0xwpLgdkVMEyBrTH6OyT8K9UP72gsTu6TnlnEdjxVXlVi56baQpKonqGFsHDDp+BIFvN1R7JwkR3Smdfa6g+grDP/u/0ZJ0D+FLpsbA4NX75fBRuU2VN0KRDKYP314tfWHbgoTMEaRrX9rVf0nAT+uHKapBOrwW4hEiWyboCMerX0Y+qyyQMn7mkEX9T9iK36jfzywx+re31ATO87dCflOr46dJBbLsop3Li93AT2OY15a5a5+oOMmPmx6ZQgEIJeB8jkV2ANLybpSODIlGxKTP+JjSetWbT765gfNIEU6WHH46rA5SLfDYpOZB8/qWqrxdUG1zsVgqeUVqK7vPM8InGszbpFhZd4BxHQsQlHhbufHLdEwizS0g26kFpw8nP/R/kNyZGZQkxnKMXUrF/IWm/pSuukEBN4xSIsC04mr40hbMyIPZRH2WC7wjRkobt3lR4FqzipIp7ndRFUpRiCP4Ui3hTy4DYBVakVjkYJJD0kPlweHJWpxTXYVPWbWbXNyJBgLaeAuejyENa3P8QosTWneehluHCTh2vpFgrTVO4No5g7U+WMhbzDcsJbZXvOw== 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:(346002)(39860400002)(376002)(136003)(366004)(396003)(44832011)(4744005)(86362001)(33716001)(186003)(6916009)(38100700002)(478600001)(5660300002)(83380400001)(38350700002)(1076003)(9686003)(33656002)(66946007)(55016002)(66476007)(956004)(6666004)(8676002)(26005)(8936002)(2906002)(52116002)(316002)(4326008)(66556008)(9576002)(6496006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?y1yxvHPMvsCGw5QTmO4LZYYdNNNsfx4PP/VX1NJ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T8brsfiHEdzwdWqfpmw0zp76UnwZJjptsDGjlWFB4/ri0lbQl?= =?us-ascii?Q?AJnGCzfdu8guuAD6N1v75/FE22siZdeagy2kST2OJBpCfbdgCVvNd3kUOPNy?= =?us-ascii?Q?Z31E1Srrza/XDKcPeSpvrpcjufn8EnIv4jGu6AP4kNvFsDIb4MklENYwIvSp?= =?us-ascii?Q?nVzo5B8sYR0/Ww2SHyOjUPEFEi3NJj13eEPbf5GhUUu9rnPIfrOBZFAStNVU?= =?us-ascii?Q?SI6UJ0CLgNS7DOQ1VBL31Jp+ZYyg5MyHpPUl3F0chhT60qCPDIkYKoOlmf64?= =?us-ascii?Q?BnUxj4hrOsZjdHf/SapzpVp2DA7JKavL9gU4uxPYYMBYYjcyaWPexp0i/WuZ?= =?us-ascii?Q?g7udLSTXjdthLoLY83psNjom14OQwglfqBOI1GIk9O9zhpBgmRKHK2tW7fMO?= =?us-ascii?Q?jbpNeUgR715IQeBtBD4y0g1A?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a7686cb-4487-449d-388a-08d9693a155e X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2021 09:07:24.2821 (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: RVrwv11p5qD9vd605oVekMsxyy7mTJv2W69cqNpFU7nYDpMZcOD1mr5NzO82f1hBNNMX/ravRA0dj3Ttdj6eusBgSG1+IUYabSCwXYkw64g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5569 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10088 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108270058 X-Proofpoint-ORIG-GUID: ui6U8y5XmsbmO8eMx42dl9_T798nSgZa X-Proofpoint-GUID: ui6U8y5XmsbmO8eMx42dl9_T798nSgZa Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 24, 2021 at 10:27:27AM +0300, Pavel Skripkin wrote: > @@ -83,7 +83,12 @@ int proc_get_read_reg(char *page, char **start, > > switch (proc_get_read_len) { > case 1: > - len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr)); > + error = rtw_read8(padapter, proc_get_read_addr, (u8 *) &tmp); > + if (error) > + return len; > + > + len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", > + proc_get_read_addr, (u8) tmp); > break; Oh my goodness... :P If you look at what proc_get_read_addr is, it turns out it's a 32bit address which is controlled by the user in proc_set_read_reg(). LOL! Just a giant security hole. My advise is just delete this dead code. No one is using it so how necessary can it be? regards, dan carpenter