Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6554820ybi; Wed, 29 May 2019 09:27:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNjLnFaN0hA6A3JdUSiInEExtSm9Nh78f3X5zU1KKSBg2+rr6kX13dBZmbooCNyQIHojir X-Received: by 2002:a17:902:b696:: with SMTP id c22mr12614206pls.119.1559147227191; Wed, 29 May 2019 09:27:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559147227; cv=none; d=google.com; s=arc-20160816; b=hir2LAQ83zvVg/yKCq/0ElLMYIkqwTo7CL9yDbv0kbKIcn7eqQuIQ8y2vlHG3H2ZaA 3oDmpSFSKDi+pgkWb7uTi8qTaZ+CtTgCRP5O9y7zy/tdKFg5V7DP7GnegAFOMF2psOv3 o0ldo9kR2xxLUl++WRbegc5i+qkKtltl/k0D4o8Q0VwZK8cjuOie7V0vOm5hajLLeDW9 rhvx6uL0MDJRNq1hTcc/XOw0W15wrJDLyluKRgx2eLgXZyfRKD+HABubJ1OcAaeRCJ+b vE/o0FO2Png/NoWuEZj6kf/JIj/yDcgT2WwFA/ybWIY8zBTXIhI4XPmG1SOx0DhCIWOy 3E4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vpCltnTpBBzrvMPQM2zJC6hyMjOFBNBiZffn1VFJGxk=; b=X68YLeLzb0yAQgZyPrQzUUxFvvPgklq/5+eyZmzuPGDT2uVQAIwqipsE+hWlGFX47o yZDIvGwevCtPB4/axbo4Y80bc3y/R2Vw6JTou9psqOGIRaKZ0kxLdw2h691lLahFsWA6 /Sh09QYQxJ9FWemX65K+ttPIC3bGaDQ6Bx/OIoz13/lx4EB0zuQmVIZRosk3UdkIF41U 86N7xJXcVka7j9iYHivfvjVktgDgCcRjPnGW4JhyRcHNVQYLlrMgKbnKG/qtD/QofCgU H4lj23npSFWoyBBGiAuKHhV3OiPT117k1GFayhgpKPcepggXm2/nTdtZIi6GJReiLWtN Wc4g== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si16384plh.398.2019.05.29.09.26.50; Wed, 29 May 2019 09:27:07 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727055AbfE2QZg (ORCPT + 99 others); Wed, 29 May 2019 12:25:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:60150 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726062AbfE2QZf (ORCPT ); Wed, 29 May 2019 12:25:35 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 206D5ADEA; Wed, 29 May 2019 16:25:34 +0000 (UTC) Date: Wed, 29 May 2019 18:25:32 +0200 From: Michal Hocko To: Dianzhang Chen Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/slab_common.c: fix possible spectre-v1 in kmalloc_slab() Message-ID: <20190529162532.GG18589@dhcp22.suse.cz> References: <1559133448-31779-1-git-send-email-dianzhangchen0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1559133448-31779-1-git-send-email-dianzhangchen0@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 29-05-19 20:37:28, Dianzhang Chen wrote: [...] > @@ -1056,6 +1057,7 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags) > if (!size) > return ZERO_SIZE_PTR; > > + size = array_index_nospec(size, 193); > index = size_index[size_index_elem(size)]; What is this 193 magic number? -- Michal Hocko SUSE Labs