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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A09E7CCA47C for ; Wed, 8 Jun 2022 02:22:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234306AbiFHCWC (ORCPT ); Tue, 7 Jun 2022 22:22:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444727AbiFHCLR (ORCPT ); Tue, 7 Jun 2022 22:11:17 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE90E254441 for ; Tue, 7 Jun 2022 12:18:24 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id k5-20020a17090a404500b001e8875e6242so5513134pjg.5 for ; Tue, 07 Jun 2022 12:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0EImpbXnAApSc8BvVL56qbdQpeRig2mR5AXQClUMyjc=; b=D+sDw6OfB5boDSeDNM9bqFr0F+tvRj6Ohj2Z1YTWNs+0xdYLLaOMK5kJXF2k+FXvoN S1Jx/D6ktM3EJjcmR6k7X2cXEptshfJtA4Ojr3XNwEKFX52bC4dCEHTSLs803Od905Qd +7X+bRiPsgncXxvXODceVFz4G8VDzZDv6yt5U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0EImpbXnAApSc8BvVL56qbdQpeRig2mR5AXQClUMyjc=; b=EvYE+aSovY4SvTLrh/9juYR1fzOne4YvUUmTweG9cMHpcyKoigxXmYl+KzxUwOImGO /L3HyNG/YF7em/7vOLvq6kixNsNYzUaabzPCuwKOOUB+DnTiv0C++Qy5xJgGaeSOi8mX EYQAmHdm4wmSUZdUH3oKxAzg8ChePhfsMsD4qEteO2K8XD62AuVgZllnBuVNWBhTLBpw uViCZU5S5QQP+peqr7NQbz8jFidNvDiSEOodenbTAK8YwCDWAjhJNS20DU3POy07NR3B TFexyy0fPLJIn7YI4WFbHUHcdWxRcUtRlIZlJRw6h8O/Qh1OJ6Ol04RFqiAPsJSoJ66I 00BQ== X-Gm-Message-State: AOAM532/zPeHpZHXg7s+VWPBntVU/EIDukG8WBJ7vDDi712w3t+j0PhR Kf0M1oYbCym5+eo4fZeX/IrxpQ== X-Google-Smtp-Source: ABdhPJyBmgCZaEYkm6poadEXRpVAz2i5/BGDgN9MhkPQ/Q6rYJplJtUTI/mP0HwnvEwNnezRL45GYQ== X-Received: by 2002:a17:903:240c:b0:153:c452:f282 with SMTP id e12-20020a170903240c00b00153c452f282mr29733430plo.88.1654629502873; Tue, 07 Jun 2022 12:18:22 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q3-20020a056a0002a300b0051be16492basm9177167pfs.195.2022.06.07.12.18.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 12:18:22 -0700 (PDT) Date: Tue, 7 Jun 2022 12:18:21 -0700 From: Kees Cook To: "GONG, Ruiqi" Cc: Casey Schaufler , James Morris , "Serge E . Hallyn" , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Wang Weiyang , Xiu Jianfeng Subject: Re: [RESEND PATCH] smack: Replace kzalloc + strncpy with kstrndup Message-ID: <202206071218.D281DE50@keescook> References: <20220607093649.928131-1-gongruiqi1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220607093649.928131-1-gongruiqi1@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 07, 2022 at 05:36:49PM +0800, GONG, Ruiqi wrote: > Simplify the code by using kstrndup instead of kzalloc and strncpy in > smk_parse_smack(), which meanwhile remove strncpy as [1] suggests. > > [1]: https://github.com/KSPP/linux/issues/90 > > Signed-off-by: GONG, Ruiqi Reviewed-by: Kees Cook -- Kees Cook