Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3755880imu; Mon, 28 Jan 2019 10:13:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN6waggXlICc1XI4dixIjV+HQZWxYrffK6rMjjEGuUWc5iOAjMyfa85TexOh7wmeTvBRBHiB X-Received: by 2002:a17:902:4401:: with SMTP id k1mr22917783pld.307.1548699185338; Mon, 28 Jan 2019 10:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548699185; cv=none; d=google.com; s=arc-20160816; b=psNGEOi3TFctC3pHxNNW9vg5QoLvYtX5NA4suJv/CsGxZo8f+vX94i+lrIiKtHezYK Gbprrq1VZVzeva6K4FMXQNSgHeTC9gaYzX6bXmVJtdyctIkeSYicHar35xVVOWjBCTJt 8q35V+Ljm2f/ysejWIy5+ExGiCBIlSqrvgoAltJd0zgGHiizTdthpVdWOHFDCSff1ER7 zT30DyG9aA+PvYWOYK1r+lwifmi7x6G4qsJoq9scr1dq3eXpQnm9VfYcqgCe3zYJF9kf /b+eM4ggcJcQbAy0TL9SOApk2XQ85TpGf++pbO055/MS3dlPQZL5t9LVpt8NhBxGFICs dJgw== 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=Oy2jPIu/a/Vo7qzFlpCDeeWMsi4Ipf7nWsh5hIriZhw=; b=Pm2qW77m32x5s/TdpXpZY0V4485uKk1pnsygOF+sXfvjMMnT1eOxzDtMNlZcPN+wPj s89skfCRjYXTCVKeS/4mrSLobqFBUUJsyQDBx3n/dqe/d0dy/bBJY7XHbEHNYlYmSSnX aw40F05BBqplyMNfw0w4DVdN6xlP2WkuWedUC6ZA0A0otMOLkrdElWCJ046m8edyYOxa f+Bv73t+koam44Y4CtHksJ4Zb+rYTrXYp8XhvdPlDAdcgMm7vPBULKSqJ2Q0z/pncOJj 3hSqVB9ocWoSYjO/ZTJjUQy40p40fezByqdQIVUBk0bYIyRwtjU6m5xMKqu+J4Wy3dUS e69Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TmpVcY6w; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si34107875plo.422.2019.01.28.10.12.50; Mon, 28 Jan 2019 10:13:05 -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=@kernel.org header.s=default header.b=TmpVcY6w; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726982AbfA1SMk (ORCPT + 99 others); Mon, 28 Jan 2019 13:12:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:53764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbfA1SMk (ORCPT ); Mon, 28 Jan 2019 13:12:40 -0500 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41C3A2147A; Mon, 28 Jan 2019 18:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548699159; bh=Oy2jPIu/a/Vo7qzFlpCDeeWMsi4Ipf7nWsh5hIriZhw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TmpVcY6wfhSgzhgR1e5Yl3JKjx0fL6mAo7jgAsOz9BvaAT4wHzWF2lby+H917rEPq N6zhaBr8LtiGUuooBEbRdrMHn5O2fOBLxyiQl9vrrZCvBB3Q+N5eGQL5aiobQffSsO y/5Tt9tLXh9eNcW0hdhpaCG55W+099vf6paCXqrs= Date: Mon, 28 Jan 2019 13:12:38 -0500 From: Sasha Levin To: Miroslav Benes Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Nicholas Mc Guire , Jiri Kosina , live-patching@vger.kernel.org Subject: Re: [PATCH AUTOSEL 4.19 174/258] livepatch: check kzalloc return values Message-ID: <20190128181238.GH3973@sasha-vm> References: <20190128155924.51521-1-sashal@kernel.org> <20190128155924.51521-174-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed 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 Mon, Jan 28, 2019 at 06:28:14PM +0100, Miroslav Benes wrote: >On Mon, 28 Jan 2019, Sasha Levin wrote: > >> From: Nicholas Mc Guire >> >> [ Upstream commit 5f30b2e823484ce6a79f2b59901b6351c15effa6 ] >> >> kzalloc() return should always be checked - notably in example code >> where this may be seen as reference. On failure of allocation in >> livepatch_fix1_dummy_alloc() respectively dummy_alloc() previous >> allocation is freed (thanks to Petr Mladek for >> catching this) and NULL returned. >> >> Signed-off-by: Nicholas Mc Guire >> Fixes: 439e7271dc2b ("livepatch: introduce shadow variable API") >> Acked-by: Joe Lawrence >> Reviewed-by: Petr Mladek >> Acked-by: Miroslav Benes >> Signed-off-by: Jiri Kosina >> Signed-off-by: Sasha Levin > >Hi Sasha, > >I am not sure what stable policy is, but the patch is for samples/ >directory and I do not think it is something which should necessarily go >to stable. It is your call though. The thing with samples/ is that (I'm hopefull that) the code that lives in there is being used as a basis for userspace code and is copy&pasted shamelessly. So on one hand, yes, samples/ isn't exactly critical code, but on the other hand it's also very unlikely to cause a regression, so I've been treating it similarily to tools/testing/. If anyone disagrees I'd be happy to discuss it. -- Thanks, Sasha