Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1261808rdb; Wed, 20 Sep 2023 04:34:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHlT9jnxC2/pnPWDARHLQqgnI6v3l7VxcQkSQOEe9+EEa8WTxmdmbAfeSbxBo3QUAANObg X-Received: by 2002:a05:6808:1b2b:b0:3a7:2524:6d46 with SMTP id bx43-20020a0568081b2b00b003a725246d46mr2285882oib.59.1695209682502; Wed, 20 Sep 2023 04:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695209682; cv=none; d=google.com; s=arc-20160816; b=sVO4DuWJuRpHB7BWqyRMwPNsoteQ0JV+SfZGSjmotk87bHYdbFazaI7BESxueBWZYi LnsXR/fbPcZgxE067JcvFMO8Nkcum6ho3xCGf2Ci86yNcy/7FisOd+H2SokfmovVPtRi 44nqs7VEbTdlpJn4zSeJSkro5KOuI88x2YHdJwMPZ4vzXqrFPk/3aEOVu/w3jRikxP4Z g/DFShfWHf83J+6gD165YFMwuihgshgrLKGLQPoOhF+GMCS8v5RU9+YPTExMSw5j7KXB RsOVcXMTwtHKRmScQTPxhXIoHcGJMkQSqmarJ1TXENfKGYDwWsU/8Z66mgGmT7XAuuZr vong== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=azd3OSNVaZYUZxSZHzup3iAfh6ZGD01OVnHyf0bPG1E=; fh=jYyzgHzpFO7c716UJ7YYQMS3jPYNZFX+FMbns5KF59c=; b=ZqKDr18t4+vLug8vKxYH0eXM5H7DTiIrs2ftJ4uz/dI5RtatXrCXN2nB2IEux0cWSs LnU5g21QOfRZf0stMq1S6a6C0e9F+8uvLOsxzW8P9t4pIOeMlO3nbPlgvszS+QqByVBQ gyRQ+y0fdlUY5TYhZ0CyPGSVQJd0VOQW0ah5U4CphaFdyya4qmW5pFYeANcZwLs9CZyt FyvWisTdFK3BtUic4bY4EyNIFoIkfbUGKAxr/17toTGE7kaLspZRjgaILaL8PGzrQ5Q/ /nlIiYRgiS8vNeqWrhDf0FB/r9yyw2GfHNbHGdhV4p24A5AceL6xuXZhbvEaxMx7SEnW 2lqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id fo24-20020a056a00601800b00690158064aasi11335022pfb.118.2023.09.20.04.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 04:34:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 79A8E80781C5; Wed, 20 Sep 2023 04:03:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234417AbjITLDT convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Sep 2023 07:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232488AbjITLDQ (ORCPT ); Wed, 20 Sep 2023 07:03:16 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99CDB9E for ; Wed, 20 Sep 2023 04:03:10 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-262-EgUX-j8ZPY-PRUixsIQ3Pw-1; Wed, 20 Sep 2023 12:02:56 +0100 X-MC-Unique: EgUX-j8ZPY-PRUixsIQ3Pw-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 20 Sep 2023 12:02:52 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Wed, 20 Sep 2023 12:02:51 +0100 From: David Laight To: 'Peter Zijlstra' , Linus Torvalds CC: Bartosz Golaszewski , Alexey Dobriyan , "linux-kernel@vger.kernel.org" , Linus Walleij , "akpm@linux-foundation.org" Subject: RE: Buggy __free(kfree) usage pattern already in tree Thread-Topic: Buggy __free(kfree) usage pattern already in tree Thread-Index: AQHZ6zB0ngjqcerR/0+SR8HlhTcAlbAji3Fg Date: Wed, 20 Sep 2023 11:02:51 +0000 Message-ID: References: <20230915210851.GA23174@noisy.programming.kicks-ass.net> <20230915213231.GB23174@noisy.programming.kicks-ass.net> <20230915221332.GC23174@noisy.programming.kicks-ass.net> <20230919125752.GA39346@noisy.programming.kicks-ass.net> <20230919125954.GB39346@noisy.programming.kicks-ass.net> <20230919131038.GC39346@noisy.programming.kicks-ass.net> <20230919193516.GA20937@noisy.programming.kicks-ass.net> In-Reply-To: <20230919193516.GA20937@noisy.programming.kicks-ass.net> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 20 Sep 2023 04:03:18 -0700 (PDT) If this stuff is so hard to get right for non-trivial cases perhaps it should all be ripped out? The trivial cases are pretty easy to eve-ball check and static analysis tools do a reasonable job. Maybe I'm 'old-school' but I'd much rather see explicit unlock() and free() than have 'some compiler magic' do it for you. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)