Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4189773pxv; Tue, 27 Jul 2021 00:40:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyL38FOUPq8abAIqUXZBdizzNCvrM6+beE5TWLqrf77qwI00x4jlLUUA0yfHlLwoV2ZSkg X-Received: by 2002:a17:907:c08:: with SMTP id ga8mr20931115ejc.318.1627371604987; Tue, 27 Jul 2021 00:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627371604; cv=none; d=google.com; s=arc-20160816; b=YkgQMUUFFtuICHvv46l7dzVpFcsxeP+3w+ZYv84CrhrvvhivX5bjzefYCIBkgiaPlq QxK08hfNmk0f7THW2LJRgeJoQNLYUwrKspiRUj+AiGHdEOiVxQiDEMEmGFTvc3ubF6Mu n9mOlofI5OQrjadkUgXcFqX4HZdv1DfKYwKmz/8yux2wGiHdei6yFcX1gpuZCmb9q0/O WXBHozHpoeTdz2oJYALDFIpDzKY90zVH+WdgE9eyzSZ+J78sxvPbfFhRGoT3trUiZW3W zOjftQQCsjkAfOg+gLqtMm/g8Y7feKBrhoY+uPtUJNp56/E+dNuecmaRMhxFQ/01f37f LATQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CgiQRPkDgLjaPWkkjWQpseQ0PaT2bHgPDPuLTNdvcZ8=; b=dZOJvd5ShFgGABonelW/cMTFHRmsnrbbjGOweh+kUj9oRrUTIo6E/rr5m1L0HQz+Jc P6fFMcNdfAwMbMbHMYstRl2unB8NX8r+MKKqCXxGh06l8lVJr/qJx/ifxmzZnTg+qRO/ cWHPwFx2rFJlEgxESIGfezY/mD2PynM7ygy9RF8TeAV92TRonPZDN6RdNHNyiwT3x+so yVGu6fbPd1CZXN/4n+UH5//hGtlQv2jkKnT6qjkP0qXUnk8GjegN9MxpbDe5Fv5E6bzy MwmmWHZBAkNHFp5puNUlaz8amw2s0ET1HnulHmi4+TMquJoB1dAzlPF3ywKNQ9uH8rJU hk8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=uoReRIZU; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si2203913edt.127.2021.07.27.00.39.40; Tue, 27 Jul 2021 00:40:04 -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=@suse.com header.s=susede1 header.b=uoReRIZU; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235656AbhG0HiT (ORCPT + 99 others); Tue, 27 Jul 2021 03:38:19 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:37102 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235518AbhG0HiT (ORCPT ); Tue, 27 Jul 2021 03:38:19 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 8E504200D1; Tue, 27 Jul 2021 07:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1627371498; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CgiQRPkDgLjaPWkkjWQpseQ0PaT2bHgPDPuLTNdvcZ8=; b=uoReRIZUx4hStU4yP+HIwVJqPmCi8Wy9QHFnl2p7YKynQ57E3YIohNFhSwOJgPflH8I6dQ eshxuWXXQp3VmvZTMgMiqdWvs45ugrSCBrNQyOCV58K/CCtdujjdCwLOCQ5MkbeNKQ0Hqy B8JkHsK3USoS3Ws4ZxO3s1gNHZPhYm4= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 5CFA4A3B85; Tue, 27 Jul 2021 07:38:18 +0000 (UTC) Date: Tue, 27 Jul 2021 09:38:17 +0200 From: Michal Hocko To: "Matthew Wilcox (Oracle)" Cc: Al Viro , Qualys Security Advisory , Eric Sandeen , Linus Torvalds , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: Make kvmalloc refuse to allocate more than 2GB Message-ID: References: <20210721184131.2264356-1-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210721184131.2264356-1-willy@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 21-07-21 19:41:31, Matthew Wilcox wrote: > It's generally dangerous to allocate such large quantities of memory > within the kernel owing to our propensity to use 'int' to represent > a length. If somebody really needs it, we can add a kvmalloc_large() > later, but let's default to "You can't allocate that much memory". I do agree that limiting kvmalloc allocation size is a reasonable thing to do but I do not really see why we should remove the check from seq_buf_alloc. Implicitly relying on kvmalloc to workaround a bug that was in seq_buf code seems like a step backwards to me. -- Michal Hocko SUSE Labs