Received: by 10.223.164.202 with SMTP id h10csp3960593wrb; Tue, 28 Nov 2017 21:32:37 -0800 (PST) X-Google-Smtp-Source: AGs4zMbZBXgyFuYT4jjnrlRQanfEQ5Nk+ER2AF7OB7uz8nuXTI/1Dpdvr6kpwH3XgM6PoHjqncRT X-Received: by 10.101.81.11 with SMTP id f11mr1637011pgq.432.1511933557869; Tue, 28 Nov 2017 21:32:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511933557; cv=none; d=google.com; s=arc-20160816; b=GPSHsrFGJgMo7p9c7w7pNS9WZIkkNx3HRWXjTlb4Lzn2n8E64XIAfSojs/YSPdLo0T H5G0BljkXydkXG4Tr7eMUY0D+49Z+4bw62A1pJUf2fO347X1MrVnqdeBuFEr2f5aMTas QI8axi8OcDtsuX1lAY6MGNRROX5ICR9TMZir5+DnNz7BzReD5Qzx+u8DZwQ5tK75nDI+ ectyI4slv7HkZM65ymQswtaJiZPSwMCZdVmXduthkLy8nLovHUzRDi3juotNtJTGjCFy ykcl33OtAuUHZh/gcs0Re/VKDvGFr4OFwSTpDMj/iC/IrZMTP32hLO7Htw18Gq3A/Udo mCRA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=xLagHGnjuIAht9KvBkjJxiTcZIiN6cWU4UpIjeX1gNI=; b=sv4F1qe5UoC+uHdVxGuwzTekjFkhqTg9I1oG9JSaqGpiv7tR+ngMVf9nfGq9wU0EhD D1eZ9LyuVjmVsIPtZAWynElZQD4iBWM4yRya59qGcYwZiH7CAjBvdacWw2cFA5XgbEgp W3IqoDyiEywBGtE6S+onY5LR812THjuaOQAQmLrZbrUWSuLwrVdeFuJimy42uKlC1cFj QKbDDSolDPCxfZLyXTB8I1DdiOP5AAz+nZQly/XFlB/jXf/VkDXDOZRMPl5NcdWRTdXA eMTZcqYwXfB/jE5VytAThF+K2xqdWWtSY/gFS5KsHRQmnmi8w/xVsX0Sq6kjNFVR2dik 1z2Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 8si726061pfj.82.2017.11.28.21.32.27; Tue, 28 Nov 2017 21:32:37 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751005AbdK2Faj (ORCPT + 71 others); Wed, 29 Nov 2017 00:30:39 -0500 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:46461 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbdK2Fai (ORCPT ); Wed, 29 Nov 2017 00:30:38 -0500 Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.52 with ESMTP; 29 Nov 2017 14:30:36 +0900 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Received: from unknown (HELO localhost) (10.177.222.138) by 156.147.1.121 with ESMTP; 29 Nov 2017 14:30:36 +0900 X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Wed, 29 Nov 2017 14:36:37 +0900 From: Joonsoo Kim To: Andi Kleen Cc: Andrew Morton , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Namhyung Kim , Wengang Wang Subject: Re: [PATCH 02/18] vchecker: introduce the valid access checker Message-ID: <20171129053637.GA8125@js1304-P5Q-DELUXE> References: <1511855333-3570-1-git-send-email-iamjoonsoo.kim@lge.com> <1511855333-3570-3-git-send-email-iamjoonsoo.kim@lge.com> <87k1yajinf.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k1yajinf.fsf@linux.intel.com> 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 Tue, Nov 28, 2017 at 11:41:08AM -0800, Andi Kleen wrote: > js1304@gmail.com writes: > > > From: Joonsoo Kim > > Looks useful. Essentially unlimited hardware break points, combined > with slab. Thanks!!! > > Didn't do a full review, but noticed some things below. > > + > > + buf = kmalloc(PAGE_SIZE, GFP_KERNEL); > > + if (!buf) > > + return -ENOMEM; > > + > > + if (copy_from_user(buf, ubuf, cnt)) { > > + kfree(buf); > > + return -EFAULT; > > + } > > + > > + if (isspace(buf[0])) > > + remove = true; > > and that may be uninitialized. I will add 'cnt == 0' check above. > and the space changes the operation? That's a strange syntax. Intention is to clear the all the previous configuration when user input is '\n'. Will fix it by checking '\n' directly. > > > + buf[cnt - 1] = '\0'; > > That's an underflow of one byte if cnt is 0. Will add 'cnt == 0' check above. String parsing part in this patchset will not work properly when the last input character is not '\n'. I will fix it on the next spin. Thanks. From 1585340108321577919@xxx Tue Nov 28 19:42:24 +0000 2017 X-GM-THRID: 1585295599512205164 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread