From patchwork Tue Aug 14 20:50:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 10566143 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F6C0157B for ; Tue, 14 Aug 2018 20:50:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F96E2A742 for ; Tue, 14 Aug 2018 20:50:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D2122A795; Tue, 14 Aug 2018 20:50:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27F342A792 for ; Tue, 14 Aug 2018 20:50:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728539AbeHNXjV (ORCPT ); Tue, 14 Aug 2018 19:39:21 -0400 Received: from merlin.infradead.org ([205.233.59.134]:52898 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728156AbeHNXjU (ORCPT ); Tue, 14 Aug 2018 19:39:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:Cc:To:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=rGNG1CjuHbGXkzpdmUlaJHmLofexCp3Sps+R8BVrkJE=; b=QZ4UvE7YnfLDJdON1go8SrWWM+ U3aIoEbTf2BK00ILVzyuCIUbIF7iK3R0NwK5ri+8v0PsGZ8CbNklE4aakZW1G+XexBMvkyYYwUV5+ kAJPz3H82J1AketysMF6/SgJhMB79fy3wAaaekn34QhE/EZtil7+nafZ0/zuq3iyl7d/h5e/kxl+y 4jG8ZuyVWZtj3TD6l2SbSyWlw4fcaxLqXXdErJJn34EcNhXKiB28em4v2F8x26A2gurZcAK5PlhsG L7cwvQYPqlzaPuPuus/uAPoscYfr9AF3qAEyrjzHu2E2rfLJT2YY4PzsJBB1h9bXJ1imcx3hIDmH+ nWbfaSFA==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fpgGj-0007hk-3M; Tue, 14 Aug 2018 20:50:21 +0000 To: linux-kbuild , LKML Cc: Yuexing Wang , Masahiro Yamada From: Randy Dunlap Subject: [PATCH] modpost: check strdup() return value Message-ID: Date: Tue, 14 Aug 2018 13:50:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Randy Dunlap Fix missing error check for function strdup() in scripts/mod/modpost.c. Fixes kernel bugzilla #200319: https://bugzilla.kernel.org/show_bug.cgi?id=200319 Signed-off-by: Randy Dunlap Cc: Yuexing Wang Cc: Masahiro Yamada --- scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-next-20180814.orig/scripts/mod/modpost.c +++ linux-next-20180814/scripts/mod/modpost.c @@ -672,7 +672,7 @@ static void handle_modversions(struct mo if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER) break; if (symname[0] == '.') { - char *munged = strdup(symname); + char *munged = NOFAIL(strdup(symname)); munged[0] = '_'; munged[1] = toupper(munged[1]); symname = munged;