Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp367312yba; Wed, 3 Apr 2019 10:12:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwP/vMpuhxHZK+HRT6zhz2VASGtGsncdF0eY7lBzQSUEG8aZ6MqlT7+RQ5KFRAb+zUM9kKJ X-Received: by 2002:a63:25c4:: with SMTP id l187mr842854pgl.202.1554311532865; Wed, 03 Apr 2019 10:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554311532; cv=none; d=google.com; s=arc-20160816; b=xrJ+65jMtvQ1k4e5aMYclSK+QGJ1pvwZliFrwLQ59yDd+G/7ckZO8Igss5FNAHQuS6 DV66f2FHQFL0WeTkNbB+zRp8ctlL0hOYn3HCbSpbGr/apYIcWh2qAhCoEUPahN+Dg+Ga 8Bm/YEAiDxyFPHbBNkOAuOEUqDN0jbDCNymlpc0ElirV2wC6FV0dJxpRadujuzLtlbC+ xYHSgRqpsTn0scXsIq7eN37WuTh6VIJE2etlire+YotV4Y2zVXCqKnH65lOX5aXli0C8 TKgImrpChkakfNGgZtkMmLYSnfs17Et26FFtvNC3yBK4DJe7oHGtJdo6ErrJzO1nF88Z sySA== 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=0Cq9CBaduQuj7NgUAXJeMrHFaQrt7z/WdHtdJMnSf0w=; b=yUN39dgdCTZi/RmGE16V2oHh/a6iwo8dA5ntLQBuqkf4JDZSJPTpF3jhX/ysZMmGsg znx4ctWHb1B8H5nMVzGI2K7gwH5EoMjE38RBedfGCxpYZf2zS5qIjwFzeCKmQkMLmLlc 1VN+gdmGTBCDYwUnXdC+q3tZ0v+l7znEZ9Se4e1g3EaUw4vzAcFyFD/cq5G/0a9ViiAC euuVURaK5s1RLCudn9OqNI8K/B9nlNuKmFV0Dxp16MEj9tzQeOBJJEgZPqWZPHkPFcGe Y95sHpsmLJWExqJ9hG70mkKFmKLrAPPL2CPb47VXkJYcxA9i884ccCtZw9qPmRMAo3fz z6Ng== 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 d13si14404958pgg.1.2019.04.03.10.11.57; Wed, 03 Apr 2019 10:12:12 -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 S1726847AbfDCRJ0 (ORCPT + 99 others); Wed, 3 Apr 2019 13:09:26 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:33325 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbfDCRJZ (ORCPT ); Wed, 3 Apr 2019 13:09:25 -0400 Received: by mail-lj1-f195.google.com with SMTP id f23so15570959ljc.0 for ; Wed, 03 Apr 2019 10:09:24 -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=0Cq9CBaduQuj7NgUAXJeMrHFaQrt7z/WdHtdJMnSf0w=; b=kosP0Prqtlo/7Z7GBj06ApU8a7kOUDcakamOXAPe+0esGiWfE1ozddpj3IwBAMfj95 Gk8fcTgp03HDvf5BhwzKxq7cYt4DhnB06NrAvmgdcdhtsmeqQGjDIDXscaGTjEXnVpUK KyJWUxav6M9ZzIy5rYotzsHNMfnk18QNdDY1XwDdnDOH2NoMpXZ0JITnqCyM+qHBclSn RRjAiLRY/We/SrTVrxHQzD0jBK8+jfATBQkCuGhxL2Rp8lfW5bymaByfivOxNh9hQrE5 w6u2cn4MzJ1hq4mgz9RYE/rGrdN0tFG78oo83JXKmFG9yuTgz7nMaj5RQu8HhghBaTmi MQiQ== X-Gm-Message-State: APjAAAUNqm+s8oGNTIWh7Ye5nrL/AV3iWKH9sL1ihCE0LyyG70XL6kH8 KSmH1Ar/G/ghQJr42wqTW/tS1QH9NWMtqcOgFPIDyw== X-Received: by 2002:a2e:3c0a:: with SMTP id j10mr509719lja.164.1554311363718; Wed, 03 Apr 2019 10:09:23 -0700 (PDT) MIME-Version: 1.0 References: <20190328130306.25384-1-mcroce@redhat.com> <20190403140203.qq37rgcikvoawb5f@brauner.io> <20190403155108.GI22763@bombadil.infradead.org> In-Reply-To: From: Matteo Croce Date: Wed, 3 Apr 2019 19:08:47 +0200 Message-ID: Subject: Re: [PATCH] kernel/sysctl.c: fix out of bounds access in fs.file-max To: Matthew Wilcox Cc: Christian Brauner , linux-fsdevel@vger.kernel.org, LKML , Luis Chamberlain , Kees Cook , Zev Weiss , Andrew Morton 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 Wed, Apr 3, 2019 at 6:40 PM Matteo Croce wrote: > > On Wed, Apr 3, 2019 at 5:51 PM Matthew Wilcox wrote: > > > > On Wed, Apr 03, 2019 at 05:24:26PM +0200, Matteo Croce wrote: > > > On Wed, Apr 3, 2019 at 4:02 PM Christian Brauner wrote: > > > > Yeah, maybe but it still feels cleaner and more obvious to just add: > > > > > > > > static long long_zero; > > > > > > > > given that most callers actually seem to want an (unsigned) int. > > > > > > > > I don't have a strong opinion though so if others feel that it's just a > > > > waste of space consider it acked. > > > > > > > > > > Well, given that the value is zero, in this expectional case we could > > > avoid duplicating the symbol and save 4 bytes. > > > What the maintainers think? > > > > If we care about saving four bytes, we could just pass the address of > > ZERO_PAGE(0). > > That would work, work too, maybe it's a bit overkill. > int zero is always there and it's static, so enlarging it to long > should be a straightforward fix. > Obviously we can't do it for other numbers, but we can alias it just > for the zero case.. > > Regards, > > -- > Matteo Croce > per aspera ad upstream Anyway, I'm fine with both solutions, as I have other patches in the queue which depends on this fix. Regards, -- Matteo Croce per aspera ad upstream