From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BB8EC4332F for ; Thu, 10 Nov 2022 07:31:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 86F326B0071; Thu, 10 Nov 2022 02:31:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F7C86B0072; Thu, 10 Nov 2022 02:31:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 698046B0074; Thu, 10 Nov 2022 02:31:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 57B3E6B0071 for ; Thu, 10 Nov 2022 02:31:34 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1DCBB1C6FDF for ; Thu, 10 Nov 2022 07:31:34 +0000 (UTC) X-FDA: 80116712508.15.D23B5F9 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf10.hostedemail.com (Postfix) with ESMTP id 6AE40C0004 for ; Thu, 10 Nov 2022 07:31:33 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B7A581F855; Thu, 10 Nov 2022 07:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668065491; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lZ7h6ZsPjDv/SQN5pyK7W6yQucG8Skr2V4pDpGg5OeI=; b=GKIgxrOTRzrzncAUSltnll45CcyEjNPIK706coENS/bd9uHnYcT4tlHCoqcDaIOgZOB7uF HZ7SAbVp6KnQrLg5kktGF4/rguovTK39ySs57X7/wQnCJb2v/3tEkGOqH1Vp9730yj39SJ +pDmKvz7K/ZyEq5DI67QkgJYgP5HtDE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668065491; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lZ7h6ZsPjDv/SQN5pyK7W6yQucG8Skr2V4pDpGg5OeI=; b=IZ/QxcPBzgo2uTJvKY9e4xYF7cquRr1zleCzlNu9N19UAN3Xe6izKDyktN/POBC8JyAE0g qE9eoTEVsC2A95CQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6BD631346E; Thu, 10 Nov 2022 07:31:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id zcl1GdOobGMlIgAAMHmgww (envelope-from ); Thu, 10 Nov 2022 07:31:31 +0000 Message-ID: Date: Thu, 10 Nov 2022 08:31:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: Deprecating and removing SLOB Content-Language: en-US To: Theodore Ts'o , Aaro Koskinen Cc: Linus Torvalds , Paul Cercueil , 42.hyeyoo@gmail.com, akpm@linux-foundation.org, catalin.marinas@arm.com, cl@linux.com, iamjoonsoo.kim@lge.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, penberg@kernel.org, rientjes@google.com, rkovhaev@gmail.com, roman.gushchin@linux.dev, willy@infradead.org, Feng Tang References: <20221109234832.GE307514@darkstar.musicnaut.iki.fi> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668065493; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lZ7h6ZsPjDv/SQN5pyK7W6yQucG8Skr2V4pDpGg5OeI=; b=BFoySUiku1caHokpsKmC8LhXn6fcQGSrfROHbSREGXbXNArmIQ7jR16vZoCJYQ/P6idOQ/ 2hrqIDj/XQzVakhmyYDRZCF0Mou0EbctWv7Oc02fQluJy4aF+fVXk0k13AVL0LujcxSHZW gpP/oRtnH7F6QSqYwg5S/v3mJe0tlsM= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=GKIgxrOT; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="IZ/QxcPB"; spf=pass (imf10.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668065493; a=rsa-sha256; cv=none; b=xx7+Qoqur/MzbIR/sQgRIlmaFNvUooxyLwL0wZsSyLGowRt945dYUpKhiKcUUp0e+mawTL isrFLiksgjDcSY0dDF//FZsNFoIZlMeGwwoKVbnIJa/c41H+ZyP1ntcbSIJyWhyqCmEZvG DCxSkLee2RVpHJcvNfW773lHSEcopwU= X-Rspamd-Queue-Id: 6AE40C0004 Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=GKIgxrOT; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="IZ/QxcPB"; spf=pass (imf10.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspamd-Server: rspam10 X-Rspam-User: X-Stat-Signature: zz57ncrumwwgiqs1bpqyifwueb79xpw6 X-HE-Tag: 1668065493-339253 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 11/10/22 05:40, Theodore Ts'o wrote: > On Thu, Nov 10, 2022 at 01:48:32AM +0200, Aaro Koskinen wrote: >> >> Some of the reported SLOB issues have been actually real driver bugs, >> that go unnoticed when SLUB/SLAB are used (unless perhaps debug stuff >> is enabled). I'm not saying kernel should keep SLOB, but it's good at >> failing early when there is a bug. See e.g. commit 120ee599b5bf ("staging: >> octeon-usb: prevent memory corruption") > > Out of curiosity, are these bugs that would have been found using > KASAN or some of the other kernel sanitizers and/or other debugging > tools we have at our disposal? Hopefully slub_debug redzoning would be able to trigger the bug described in commit 120ee599b5bf above, which is: > octeon-hcd will crash the kernel when SLOB is used. This usually happens > after the 18-byte control transfer when a device descriptor is read. > The DMA engine is always transfering full 32-bit words and if the > transfer is shorter, some random garbage appears after the buffer. > The problem is not visible with SLUB since it rounds up the allocations > to word boundary, and the extra bytes will go undetected. Ah, actually it wouldn't *now* as SLUB would make the allocation fall into kmalloc-32 cache and only add redzone beyond 32 bytes. But with upcoming changes by Feng Tang, this should work. slub_debug would also have a chance of catching buffer overflows by kernel code itself, not DMA, and tell you about it more sooner and gracefully than crashing. KASAN also, even with a higher chance and precision, if it's available for your arch and your device constraints can tolerate its larger overhead. > - Ted > >