Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15041805rwd; Sun, 25 Jun 2023 09:02:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48pxQMCO65VyQAEsb2LUJNU7hUsUTwJ00803Nb02qNT905tTKRaPW/so7P0Aqd6FDU8kO1 X-Received: by 2002:a05:6870:b781:b0:1b0:20c2:2c81 with SMTP id ed1-20020a056870b78100b001b020c22c81mr1854188oab.41.1687708956614; Sun, 25 Jun 2023 09:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687708956; cv=none; d=google.com; s=arc-20160816; b=Mv/w30sWqqPek+DAsxKBBfGLnzoos6S8VQOflWFdOptR6VYWFE/qh8qTuZPyO5ysaQ Z50alwYePpYtp+rVirbiaQJbNxlLe2gxbl9IYHafURemwTzTnyvJMah/pgZJ+OfRP11H tbrPKpZjAhgigiFtKjndKXxPOY27+SXa2Yyh7jPQk/67ACIpz62FfrGcUPRdsrQO0vbH DYrICPcllZLJgqk2scPCmggobggFB+NhFNcMeP8Ev6Zn61kcp+HOpwdGRzDOIm49jWnK YYcSmugo1dNcmnz/vNh1NA2JS19DWSQkOx1Uu6H/NwRxpLmHelA9U0HwXNYFMX1f62SO iWlA== 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=qTbzsSA7kqB8qK5K24vQBr3xVW0NCbOaXCUiNepZUww=; fh=aQvV0lHKo9RmuUXtTZU/k4Z1MJaMt1Zyx/ZipMlVDsM=; b=Dp3HH6Ouh5M1PST5fzh4m7eliupHoOyQ3MKs4DTYDjErfWAUrYOo+Pa2L59bvHkM2+ fdZ7O81kLYt6+F9Coy2pZ9BRf7cRbuzucd1Q7e8SkeDMOC6hPMBJn+lx7dWIF7kVCYJh pIxUVwQVRylQK9kDvAdW6eGaCT4GWMInbZxp/7bbPJW6hZrdQOu5jqweFNMhHiuo6nMo Bvo26sRZA4SNNqF2V4nomER2kR33nLGS5qrEMCFFbab0TGZIFWH1yGIOwLsrJIoyVwuO TI8y+/zJHdygHk7P9tlGyHQ7cqg+mjY2mwkg3OiG/fn3oI1bB/pn7PDMofe20yCIKO4s nKVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y185-20020a638ac2000000b00553851380b9si3239270pgd.352.2023.06.25.09.02.23; Sun, 25 Jun 2023 09:02:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbjFYPio convert rfc822-to-8bit (ORCPT + 99 others); Sun, 25 Jun 2023 11:38:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbjFYPin (ORCPT ); Sun, 25 Jun 2023 11:38:43 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E04FA9 for ; Sun, 25 Jun 2023 08:38:41 -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-87-XSl-NMxtPv-iW-HovudoLw-1; Sun, 25 Jun 2023 16:38:39 +0100 X-MC-Unique: XSl-NMxtPv-iW-HovudoLw-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; Sun, 25 Jun 2023 16:38:37 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Sun, 25 Jun 2023 16:38:37 +0100 From: David Laight To: 'Rishabh Bhatnagar' , "gregkh@linuxfoundation.org" , "pc@cjr.nz" CC: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-cifs@vger.kernel.org" , Aurelien Aptel , Steve French Subject: RE: [PATCH 5.4 2/5] cifs: Get rid of kstrdup_const()'d paths Thread-Topic: [PATCH 5.4 2/5] cifs: Get rid of kstrdup_const()'d paths Thread-Index: AQHZphqs3PWAi6dww0Cq1jX8x+xzU6+bqdcQ Date: Sun, 25 Jun 2023 15:38:37 +0000 Message-ID: <043b05d64bca40509bab7dd8e368e4e5@AcuMS.aculab.com> References: <20230623213406.5596-1-risbhat@amazon.com> <20230623213406.5596-3-risbhat@amazon.com> In-Reply-To: <20230623213406.5596-3-risbhat@amazon.com> 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=-2.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Rishabh Bhatnagar > Sent: 23 June 2023 22:34 > From: "Paulo Alcantara (SUSE)" > > commit 199c6bdfb04b71d88a7765e08285885fbca60df4 upstream. > > The DFS cache API is mostly used with heap allocated strings. > ... > - ce->path = kstrdup_const(path, GFP_KERNEL); > + ce->path = kstrndup(path, strlen(path), GFP_KERNEL); That is entirely brain-dead. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)