From patchwork Sat Mar 24 20:23:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 10306407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A20EC600CC for ; Sat, 24 Mar 2018 20:25:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 938E52929C for ; Sat, 24 Mar 2018 20:25:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8623C292A1; Sat, 24 Mar 2018 20:25:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66DEE2929C for ; Sat, 24 Mar 2018 20:25:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752857AbeCXUZT (ORCPT ); Sat, 24 Mar 2018 16:25:19 -0400 Received: from merlin.infradead.org ([205.233.59.134]:54974 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752801AbeCXUZS (ORCPT ); Sat, 24 Mar 2018 16:25:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:Cc:To:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=BO1yjd/JcbCqFO0B5FRe/+5NSmg57FsFRRnvdapEUqI=; b=CKndufTJeHGLV5bbnWDOwLcWU8 xLjiLWlhZCk6m4QJZhALbiWoPLzn0byv3sZiN94ypBbgCSx4rpHfd5nbNOCBa2d/bl74qpwlLCCD6 hC7/ELoaAyIC1iB/2DxwGC/cm6LcsAO9OXBSPON0qET9Ug7I+3keXsYkSso3DlSp310ZCbzdmkDLi XNfE2s7yaAlpLD8BY7SDXIygLvXNMwFt8YfefYhjPUt7UUZjncp2Kl//HVvNxb/CVZxytGTqgh/hT S0hzZT8DqcKf4e/uoGsCWhBckHh+NOTRuTVs+Cjp7m7Ls5tQKizZ8UT6JROKnd83asbRCajJagsS1 7bCxBtEA==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ezpj1-00026U-CL; Sat, 24 Mar 2018 20:25:15 +0000 To: LKML , Andrew Morton , Linus Torvalds Cc: Petru Mihancea , Linux FS Devel From: Randy Dunlap Subject: [PATCH] sysctl: fix sizeof argument to match variable name Message-ID: Date: Sat, 24 Mar 2018 13:23:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Randy Dunlap Fix sizeof argument to be the same as the data variable name. Probably a copy/paste error. Mostly harmless since both variables are unsigned int. Fixes kernel bugzilla #197371: Possible access to unintended variable in "kernel/sysctl.c" line 1339 https://bugzilla.kernel.org/show_bug.cgi?id=197371 Reported-by: Petru Mihancea Signed-off-by: Randy Dunlap --- kernel/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- lnx-416-rc6.orig/kernel/sysctl.c +++ lnx-416-rc6/kernel/sysctl.c @@ -1329,7 +1329,7 @@ static struct ctl_table vm_table[] = { { .procname = "dirtytime_expire_seconds", .data = &dirtytime_expire_interval, - .maxlen = sizeof(dirty_expire_interval), + .maxlen = sizeof(dirtytime_expire_interval), .mode = 0644, .proc_handler = dirtytime_interval_handler, .extra1 = &zero,