Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5944192imm; Mon, 27 Aug 2018 07:05:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZVzpy4zv3UKMXlaVMi3iAzrTv/MjJPB+0fU0EKHmaPxwP/j463YbvmHsmP/Ykw66Zrh1Fi X-Received: by 2002:a17:902:31a4:: with SMTP id x33-v6mr13262944plb.218.1535378726512; Mon, 27 Aug 2018 07:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535378726; cv=none; d=google.com; s=arc-20160816; b=K2GBeXlT6eIMS1Oa9iVFNZJmTLTqtvuEFIowTEGFKq3n2E40dq34ZUBtSJ/6QxNCjK Y0V4qyX9wKlP45Ns57Uyroyye8F0zWB5p+xLQLudTET0QFeHezPKRrAufEkpR/nytplx k4nqOmEr1QwGZ4aWKvgRItuNE7AByTTNCZ1myi59N7NApsPYvhSLyZGzQFHCiU2Bv61B e8WlUL37bD64ooqcQ6dLjW7XMpsBhJyfdU4kGlQdcasWGxgE8wcn9ZpbFBQufylwNIgE 0wZvvBYpwv12CH2XhlGY2PN57vYNy6fjKVFZqkL/iRl1ARnbZECD012Z5w/cgvjT9Bgl /jrQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=nS07EKH2fdEkO8tfFTup3lj+xv8HQY+ewCQDbWLLvo0=; b=jVRkXmU9eChvwWasKIR5NLgBP02hcmvacusc9uji8UNp4cA9fqxqM49Ipyyg6AJxZm yXBZxp9glEboVnwteh2qOcMWCyalXaqDfXqIitFIWFkz5iidfoe/p/OJpvp2jg2qnmjg tUOqeH0u70E4ZKFvr8s5apvrBIAe5TSSvSzr/jAP7N/p0bOtQ8/SpymPBHQ841b0Ft/t bqAVeOf9rRvOKvcmh7vf87mdXJv5K9Bsh/C3leEJHVMtJyLJ9D/qCMyyCl+yWmM27Ba+ oCRHE8blgJyAGzm5N1NcPtvyDrnMgCBx6KTIY7JZu9jhtHR8Q3mE9kxwvxl8/r8Lizwq AibQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IR38gx+M; 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 j24-v6si11875115pfk.203.2018.08.27.07.05.11; Mon, 27 Aug 2018 07:05:26 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IR38gx+M; 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 S1727573AbeH0RuH (ORCPT + 99 others); Mon, 27 Aug 2018 13:50:07 -0400 Received: from mail-yb0-f196.google.com ([209.85.213.196]:39762 "EHLO mail-yb0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726931AbeH0RuG (ORCPT ); Mon, 27 Aug 2018 13:50:06 -0400 Received: by mail-yb0-f196.google.com with SMTP id c4-v6so6043042ybl.6 for ; Mon, 27 Aug 2018 07:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=nS07EKH2fdEkO8tfFTup3lj+xv8HQY+ewCQDbWLLvo0=; b=IR38gx+My+XvMh8afgCJH7ojxde3bGQOlJAgHUPrCS37jRxC5bD5CDtea79ayEmTkA k9ksoouipVC/RnkpsWbdSbBGa6jfNIsyy6iaLX2uR9MYLLWTBPtj67FcGAfXWa35e1la uCSUIltmyOoJNGAiBIndR3/CwL8eWPG8IRBYxIkSYorZmv4xCygJKWqKYn4nlz7qaZrC XrTIml6NNuVwmVdcjkaKdftJL8mw/UGXviCisx7kD1wBlxl9xf6Uaz5ZNJvkdZrd3Sa+ 2ANAtUQxtA05uRc1f7iMqg2vpToyZsMgRXgLC5FM4L44WAqYH/Fu0UQ2oanvv//HVV2Q MekA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=nS07EKH2fdEkO8tfFTup3lj+xv8HQY+ewCQDbWLLvo0=; b=bhSJ6zN55E2A93mQNfHUqfiHkfOHWDp4uSbDg52YbCFlCnn1xzC338NevfOAMm3oj6 VWvH3ZLdXv3G4aWsP5hiJ9X8+kV+l2aAjUhrW2GHfysVBxiS+MRHP+wQiT6ZAdevWoMY fBVR+RjqNthF1MInxdU2nCDLBz4NAAat5mkJrSY9FQGckMtd5psi6hjnHc5uxcoA69lu eXUjc0LzKJkPLXyRT3A77F7EYyyF3fu1TEcLIzJCWLZ5izaYd24Qv9EIgrrAagkpYrrn R6ik3Sth7WS8dH2HpdsH7FtNRBK4x62i89sgigGqSH3qox0ED7Sv2FzulIHzTpGl9OeT eHAQ== X-Gm-Message-State: APzg51BProsPgZS55OsofHF3LtbR1wYky5WLPybSSOw/k79h9VrqqAJb gnMNPZYnnC3h0PMQIWXCrZo= X-Received: by 2002:a25:586:: with SMTP id 128-v6mr6849944ybf.282.1535378600029; Mon, 27 Aug 2018 07:03:20 -0700 (PDT) Received: from localhost ([2620:10d:c091:200::3:e4dd]) by smtp.gmail.com with ESMTPSA id 63-v6sm6308858ywd.8.2018.08.27.07.03.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 07:03:19 -0700 (PDT) Date: Mon, 27 Aug 2018 07:03:17 -0700 From: Tejun Heo To: Bernd Edlinger Cc: Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" Subject: Re: [PATCHv3] Fix range checks in kernfs_get_target_path Message-ID: <20180827140317.GD3978217@devbig004.ftw2.facebook.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 26, 2018 at 10:55:24AM +0000, Bernd Edlinger wrote: > Ping... > Sorry, I had actually completely forgotten about this one. > > On 07/07/18 19:52, Bernd Edlinger wrote: > > The terminating NUL byte is only there because the buffer is > > allocated with kzalloc(PAGE_SIZE, GFP_KERNEL), but since the > > range-check is off-by-one, and PAGE_SIZE==PATH_MAX, the > > returned string may not be zero-terminated if it is exactly > > PATH_MAX characters long.? Furthermore also the initial loop > > may theoretically exceed PATH_MAX and cause a fault. > > > > Signed-off-by: Bernd Edlinger Acked-by: Tejun Heo Thanks. -- tejun