From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751304AbcGNM76 (ORCPT ); Thu, 14 Jul 2016 08:59:58 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:38734 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751073AbcGNM7x (ORCPT ); Thu, 14 Jul 2016 08:59:53 -0400 Date: Thu, 14 Jul 2016 14:59:49 +0200 From: Ingo Molnar To: Dan Carpenter Cc: Dave Hansen , Timur Tabi , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [patch 1/2] drivers/virt: fix the error handling in ioctl_dtprop() Message-ID: <20160714125949.GB21281@gmail.com> References: <20160714114139.GK18175@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160714114139.GK18175@mwanda> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Dan Carpenter wrote: > If strndup_user() user fails then it returns an error pointer and we > pass that to kfree() which causes an oops. Hm, in addition to this fix wouldn't it be better to not crash if kfree() gets passed an error pointer? Would that have changed the pattern of this particular bug? Thanks, Ingo