Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3228382imu; Thu, 29 Nov 2018 18:27:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wbc5QsbAy4DrQOWRMWoeokupwlkfwg3QNf1wXJvxgnrClIQ1QVebI1tJBfDKSjLeTnBEdi X-Received: by 2002:a63:104d:: with SMTP id 13mr3326808pgq.303.1543544874517; Thu, 29 Nov 2018 18:27:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543544874; cv=none; d=google.com; s=arc-20160816; b=eYHP1tcwhFLTSUbBYZdZXSwAG1DD0Jxqz7o/YJazQlRP2nlTXwss70t6pl0heZKzo8 xNymyoizHYjTbMK1IVrOcpk2ICUqzvZvkuVn6A+3L25OdmhNxBANJ1u2FbT6o5Jmww20 WBxnktx1h4hBAKHRzF6c7kSnI1AlteK0G+CoBy6S+lH2yy6H94WyTJxwvIK8WTPB5JGu uvhQ/81eCW9H+Ukv/jixLD9hKCUVBiPpZSoH5Y/M1TQVJDGtKEXv52uQEq2ffDwN3/+m CiSF7tasOw9v196o+G1pZBF3f0+vjrCAVkV1GPP83dmLvySIYH8N10ArLYpxOwe0DVzX J+ig== 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:dkim-signature; bh=+7FHqAtEydKJAtAOErtYI4+AY7Co+y9p0FlLZPqwO7Q=; b=jw0pYilBjMcgv9BHkzfIP5AMgPZh0Bs5Pp/KujwaxZJ++Dw+HsejOj+A+Zdd1f5PXY U2NsK7TigkfhisyQY171Lxqvml4OKkzubuXMDtj9Vx7W5DQYsMfVYyWiQhy7gZs5WuWp +WgNI7kAZKPQuYnCHDCclJ1Bsar/eVr2yw/CsimppBrP+Ydi70DtR+YvPyP0oQw3/+Wi s2e7tkXC8Jf7XjJOzz0xYaPyrg+rJGKa39zPKbSyS5XltB+n1vb2ax2KPQZbX9l6UzLX QASXiGGyMDBYKF36Ko5N51N0Y2Duo0ypJBM7UJSKs/hO6JJURDnl7r5/FKtRaCEcHAGd +OeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=cEwNvFCY; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si3710697pgf.450.2018.11.29.18.27.40; Thu, 29 Nov 2018 18:27:54 -0800 (PST) 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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=cEwNvFCY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727030AbeK3NeT (ORCPT + 99 others); Fri, 30 Nov 2018 08:34:19 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36422 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726549AbeK3NeT (ORCPT ); Fri, 30 Nov 2018 08:34:19 -0500 Received: by mail-pg1-f193.google.com with SMTP id n2so1819156pgm.3 for ; Thu, 29 Nov 2018 18:26:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+7FHqAtEydKJAtAOErtYI4+AY7Co+y9p0FlLZPqwO7Q=; b=cEwNvFCYsU0oej7QnkVWSOSM6/pdl1HLyfETlKqcC8eQKbilp6HJJvD9aWmmcZhBC1 7mUQW0EE93yn7ewQMl+1ZpBGzrNM9OYS8p08KTEUiGf3/zr3rBpt+oFfVUls/4cW1V3n 1GQEktRtZzpMakMQXgtwBNepe/CgiFIjIyoRw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+7FHqAtEydKJAtAOErtYI4+AY7Co+y9p0FlLZPqwO7Q=; b=s8yI/64eN3WkDuGTgJYmsefha8/L4yY9fce5fUhpqS7xbsfTtSTuTmhTdq1dGm3HBf +46Sl/1QC4ijnLC0WqmM5QZw0jyfPR08BqYoq9bR0B5oYfHhMTXXodfB22jOJIFZECgw 8BplUMAd4H5gLW567gkbALcgf6IZRFGSV51oqEdB5hKs9e7YHB7EnZlzsaftb3IQ8KWp 5JoYF43iSu0rj24/kXlBVIzVUhCVc3qtCcaWe6TEi3hTJMqGh14c67pvL1MbC0GuIh8V +Xq/86s20+Cq0CaRdx+KYAgGYVb/oEsXCMuMRLCj8OdsHHWixtGtsurdENHqsbqIRmE1 eGog== X-Gm-Message-State: AA+aEWYE10GgYCXTeWtlvg/06MAib74EPr6w8GU8AxKLs6bPUgJavh4G WSoieod3p6f1aqeiEs0z7HW2p4Pov2Y= X-Received: by 2002:a63:8441:: with SMTP id k62mr3307027pgd.392.1543544799137; Thu, 29 Nov 2018 18:26:39 -0800 (PST) Received: from localhost ([2620:0:1000:1601:3aef:314f:b9ea:889f]) by smtp.gmail.com with ESMTPSA id g2sm4727234pfi.95.2018.11.29.18.26.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Nov 2018 18:26:38 -0800 (PST) Date: Thu, 29 Nov 2018 18:26:37 -0800 From: Joel Fernandes To: Kees Cook Cc: LKML , Anton Vorontsov , Colin Cross , Tony Luck Subject: Re: [PATCH 2/8] pstore: Do not use crash buffer for decompression Message-ID: <20181130022637.GA105443@google.com> References: <20181101235200.28584-1-keescook@chromium.org> <20181101235200.28584-3-keescook@chromium.org> <20181102182454.GB14942@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, Nov 29, 2018 at 02:06:39PM -0800, Kees Cook wrote: > On Tue, Nov 13, 2018 at 11:56 PM Kees Cook wrote: > > On Fri, Nov 2, 2018 at 1:24 PM, Joel Fernandes wrote: > > > On Thu, Nov 01, 2018 at 04:51:54PM -0700, Kees Cook wrote: > > >> + workspace = kmalloc(unzipped_len + record->ecc_notice_size, > > > > > > Should tihs be unzipped_len + record->ecc_notice_size + 1. The extra byte > > > being for the NULL character of the ecc notice? > > > > > > This occurred to me when I saw the + 1 in ram.c. It could be better to just > > > abstract the size as a macro. > > > > Ooh, yes, good catch. I'll get this fixed. > > I spent more time looking at this, and it seems that only the initial > creation of this string needs the +1, since all other operations are > byte-based not NUL-terminated string based. It's a big odd, and I > might try to clean it up differently, but as it stands, this is okay. > (See inode.c which doesn't include the trailing NUL byte.) Ok. Yes it does seem a bit inconsistent but I agree its not an issue for this particular patch. Sorry to waste your time, thanks! - Joel