Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854Ab3IWO4d (ORCPT ); Mon, 23 Sep 2013 10:56:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32403 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751947Ab3IWO4c (ORCPT ); Mon, 23 Sep 2013 10:56:32 -0400 From: Jeff Moyer To: Vaughan Cao Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] block: register_blkdev doesn't check name against NULL References: <1378809614-17490-1-git-send-email-vaughan.cao@oracle.com> <1378866250-22679-1-git-send-email-vaughan.cao@oracle.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Mon, 23 Sep 2013 10:56:27 -0400 In-Reply-To: <1378866250-22679-1-git-send-email-vaughan.cao@oracle.com> (Vaughan Cao's message of "Wed, 11 Sep 2013 10:24:10 +0800") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 887 Lines: 22 Vaughan Cao writes: > register_blkdev(0, NULL) can result kernel Oops by copying from NULL > in strlcpy(). Fix it by checking NULL pointer at the beginning and > WARN when encountered in unregister_blkdev. Uhh, so yeah, this is an exported function, so I could see maybe wanting to do the argument checking. But honestly, if your driver can't even get this right, is there any hope of it actually working? This seems like a pointless patch to me, but ultimately it's up to Jens. Cheers, Jeff p.s. the kerneldoc tells you what to put there: * @name: the name of the new block device as a zero terminated string -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/