Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753992AbcKRSDJ (ORCPT ); Fri, 18 Nov 2016 13:03:09 -0500 Received: from mail-yb0-f193.google.com ([209.85.213.193]:34740 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752936AbcKRSDF (ORCPT ); Fri, 18 Nov 2016 13:03:05 -0500 From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Fri, 18 Nov 2016 13:02:58 -0500 (EST) X-X-Sender: vince@macbook-air To: Alexander Shishkin cc: Vince Weaver , "linux-kernel@vger.kernel.org" , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , "dvyukov@google.com" Subject: Re: perf: fuzzer KASAN: global-out-of-bounds in match_token In-Reply-To: <877f81f264.fsf@ashishki-desk.ger.corp.intel.com> Message-ID: References: <877f81f264.fsf@ashishki-desk.ger.corp.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) 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: 1449 Lines: 38 On Fri, 18 Nov 2016, Alexander Shishkin wrote: > From 139306c3bcf7abf49c51a8e56131aaae51222594 Mon Sep 17 00:00:00 2001 > From: Alexander Shishkin > Date: Fri, 18 Nov 2016 13:24:55 +0200 > Subject: [PATCH] perf: Fix address filter parser > > The token table passed into match_token() must be null-terminated, which > it currently is not in the perf's address filter string parser, as caught > by Vince's perf_fuzzer and KASAN. It doesn't blow up otherwise because of > the alignment padding of the table to the next element in the .rodata, > which is luck. I can confirm that with this patch applied I no longer get the token-parsing KASAN messages. This is even after I enhanced the perf_fuzzer to generate more realistic address-filters. As an aside, is there any better documentation on what a "proper" address filter looks like? In kernel/events/core.c it says * ACTION RANGE_SPEC * where ACTION is one of the * * "filter": limit the trace to this region * * "start": start tracing from this address * * "stop": stop tracing at this address/region; * RANGE_SPEC is * * for kernel addresses: [/] * * for object files: [/]@ Does each action always get a range? Are the ranges hex? decimal? can they have a leading 0x? Are the sizes hex? decimal? What's the path to object file for? What kind of object file? Vince