Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp76182yba; Wed, 3 Apr 2019 04:56:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzt2/tBT+o8Msx4xbPGoHqV2BmIKEUr88R5/Hi0gGK2wGu1kgUX42NZMBzLgnLewiSJ/T75 X-Received: by 2002:a62:6842:: with SMTP id d63mr13628768pfc.9.1554292615199; Wed, 03 Apr 2019 04:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554292615; cv=none; d=google.com; s=arc-20160816; b=bfjVxmJpSF/NWzCNOUQ4zSNjSz8Ruv2NBew3PIH9Ito349m/ywdKD273EcV60NTn+q TvsA/Owr6TzduT/+GhYdJM0SD8VkDf2+DXbkAZ5UoZIKoMOgVxSdUCiuCXudDXQ+vFM2 Dhnq8swvzP46KtqK6gD3haaXX1dfuInGT9Cx7GJPMVNJJWFcqVKUdng76Ju85jokRina pug4Nb3PPI+CruUV8pKt48Xf1HaovqlExanxqdzvMaJS2qt8dQfq84BuEU9hDk8WseY1 wDLcfTi1uSRvjR3bepKRvWXRQKPRYAWZ0pCWXLEMetQM664y4a86qHJKNP9pB1JU0by9 TwDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=JWiKYRBDLV0ovE0cTsbFPkeIiPj6XX2qtpqdYWsJSA8=; b=A0PrHNn39H0lThh5Q1a4B6GYFRnOGfui4X55hmciM8Z3lB/AS+yOuAex9xLP7zbu4c NxSG4dzbZGP+hXFPjbcVWEbYd8Yxk5dZOLEXxiW40cNaYmC2ocCOubWcQjxq3xqUxoCK HcH5Xn47n8WPHECC/FXAZWJu84PgtodZXtY9elGagtQvn6AEnowEn3mkW5f9alUrpXT5 BLZvkXtD1OwUlqj2Y2FiPMY4tIZFfC/2f11iPeAwVQF9pTTJJF28/Prsq7PT3z9xL0j6 IEH6qvqnjqo5uhBmPAw/or7l1nMtqEWF7JILxHI8sQJoCBEeKurKNmUkRlNTIUhVBgLF qJtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n15si14019888pgg.308.2019.04.03.04.56.40; Wed, 03 Apr 2019 04:56:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726404AbfDCLze (ORCPT + 99 others); Wed, 3 Apr 2019 07:55:34 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:39139 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725941AbfDCLze (ORCPT ); Wed, 3 Apr 2019 07:55:34 -0400 Received: by mail-lf1-f67.google.com with SMTP id m13so11482533lfb.6 for ; Wed, 03 Apr 2019 04:55:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JWiKYRBDLV0ovE0cTsbFPkeIiPj6XX2qtpqdYWsJSA8=; b=XgKzKBLZmaDyjEErDTTaKXuE5sPBRZQczjVMgjpTqewUMNPbzW/3aOZrs/mCA8dYUb wyabgg9W3u4zEDBOsocUklEGqSc9QbBGRr8KCSQDFlTUrjDaWdiOI6WOIEYWYooLE82I 2Fh0F0yPZ8oQxUkDAwcLxzo5F7W9Z+rgWRddMA4lvNhZQNUrn8mvMwItXaWhiih/oiPq z0bugMKI7O0n33nLtlyhqNZJ/NwRKQNY+iIAOetIs+to/tSWNtekdyxfflZ8s7uwC93V bT34rWRVKk1ulfmHfzGXN/IS80VIwZCWZAUD+DF2DSUY1OlazZ+z4tygCQr0+ovHjGSm rc0g== X-Gm-Message-State: APjAAAUqLgzNWz/kTbX3yLrtXj6ZBAbmHj2yLlMGTj0rLW984O+zUj8E 8mu7yBhGXEJqv7394TDnWpd9booLnRuMFMXVRkwgOg== X-Received: by 2002:ac2:4563:: with SMTP id k3mr38429432lfm.101.1554292532802; Wed, 03 Apr 2019 04:55:32 -0700 (PDT) MIME-Version: 1.0 References: <20190328130306.25384-1-mcroce@redhat.com> In-Reply-To: <20190328130306.25384-1-mcroce@redhat.com> From: Matteo Croce Date: Wed, 3 Apr 2019 13:54:56 +0200 Message-ID: Subject: Re: [PATCH] kernel/sysctl.c: fix out of bounds access in fs.file-max To: linux-fsdevel@vger.kernel.org Cc: LKML , Luis Chamberlain , Kees Cook , Christian Brauner , Matthew Wilcox , Zev Weiss Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 28, 2019 at 2:03 PM Matteo Croce wrote: > > fs.file-max sysctl uses proc_doulongvec_minmax() as proc handler, which > accesses *extra1 and *extra2 as unsigned long, but commit 32a5ad9c2285 > ("sysctl: handle overflow for file-max") assigns &zero, which is an int, > to extra1, generating the following KASAN report. > Fix this by changing 'zero' to long, which does not need to be duplicated > like 'one' and 'one_ul' for two data types. Hi, Anyone looked at this patch? Does my fix looks sane? Regards, -- Matteo Croce per aspera ad upstream