Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5628092imm; Mon, 23 Jul 2018 03:14:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeFBijj6Vo5YMikKB0bWl7xmiNwRF8PP3hfoFidy4mvWMDCcTC/CgU9Oo7n6IS4izu/zjes X-Received: by 2002:a17:902:aa46:: with SMTP id c6-v6mr12170915plr.313.1532340857790; Mon, 23 Jul 2018 03:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532340857; cv=none; d=google.com; s=arc-20160816; b=YAj0EteZ2Y7WjCGr47czL2TwRGH4aVz4pOcAONkUUK+tUZSutS7tzRG9rf7EWWb/Uj dcJRy0iDICySxeNd0cb8dPGsYbvvg1Q2/XiZiXjYQmMmUiMnpZM6srWYp0sW6O+2f8sm z6J6vWtKKEL3olpJKP63wU20N7LFZlzGHng5CYJcPln7/GlBWYL5tKPggtD97B8K06fJ 8LE8+Yi3Pph4JpEfpXMU07P54tok9sIvo7C9tNPcUuqUZwqaVO2pav5dcan97it0h29V mlkZqweDnQEmW+GQruQK096acCxlACP+HTQhlgM31rE9+YNWfaLBZSnzvikD0M/eS7yw 2sdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=dCOnOtfpYEZRdzEL4/OuKQ39hYazJI2Du5v4ZoSchsA=; b=H5n3ABftQVKHJrMao1bD2rNPWMegbrCXzKxn8s/Y9wcczGx07TP/ta+FuTMmBk5iQL zvRD3aV0cCPnDkIdOLc5gv0RYpHAnZ9WkV/ePfjd9MtvX0vWCMu96YzNdiZoxrRwSAE/ EQEsbIqIaOFNlBdYvadFi4TpYpZIB9wV1vFzwQCkFjH99/FWxnQccyUaqidek7OQEwVA U51AAATZPLyp0Do6SUlr6h0nIau6e4hx0MjJj7rrMJJNhvNIJj/qNEmJ+jsCQpuhBKOA 4IRejk4IrvdkCm3ogYhVePlGU0KLEM/1zTIFmHoLoxdBUFq+gWz36fL4EkgJPROU4FiD Bawg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 190-v6si8585265pfy.293.2018.07.23.03.14.03; Mon, 23 Jul 2018 03:14:17 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388363AbeGWLNA (ORCPT + 99 others); Mon, 23 Jul 2018 07:13:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:46936 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388071AbeGWLNA (ORCPT ); Mon, 23 Jul 2018 07:13:00 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8C6D2AFCD; Mon, 23 Jul 2018 10:12:31 +0000 (UTC) Date: Mon, 23 Jul 2018 12:12:30 +0200 (CEST) From: Jiri Kosina To: Kamalesh Babulal cc: Josh Poimboeuf , Petr Mladek , Miroslav Benes , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] livepatch: Validate module/old func name length In-Reply-To: <1532080002-10724-1-git-send-email-kamalesh@linux.vnet.ibm.com> Message-ID: References: <1532080002-10724-1-git-send-email-kamalesh@linux.vnet.ibm.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Jul 2018, Kamalesh Babulal wrote: > livepatch module author can pass module name/old function name with more > than the defined character limit. With obj->name length greater than > MODULE_NAME_LEN, the livepatch module gets loaded but waits forever on > the module specified by obj->name to be loaded. It also populates a /sys > directory with an untruncated object name. > > In the case of funcs->old_name length greater then KSYM_NAME_LEN, it > would not match against any of the symbol table entries. Instead loop > through the symbol table comparing them against a nonexisting function, > which can be avoided. > > The same issues apply, to misspelled/incorrect names. At least gatekeep > the modules with over the limit string length, by checking for their > length during livepatch module registration. > > Signed-off-by: Kamalesh Babulal Applied, thanks. -- Jiri Kosina SUSE Labs