Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp534344imm; Fri, 11 May 2018 02:18:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqE9O9unVv9i79qyA8YqQI55vLxTgdN7BEzagOMWCgPvlv1KNP3ikDP89bAJAUXxBa91daY X-Received: by 2002:a17:902:ab98:: with SMTP id f24-v6mr4669343plr.144.1526030303614; Fri, 11 May 2018 02:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526030303; cv=none; d=google.com; s=arc-20160816; b=hC5Vc+xuz7bLTyn5+62pfpENM8Zsr1O4hpPCmO/SN+0K2rWSsoRDny4wMHJownNF2M iK+o0BMpZahd901sIAk2sVZIi5JOiLjFLFjWsB499Mfd1RpqHccbxxpFRBLv0dHWYltu mbptZ48Ao1b+XUlYXmCwkakg6cWDeUuU1tH+VYLDX2TzFkrf440Q8hTLeCIj11awOgVJ moPp/Y0ex3/AjHgIHt09CPtZj/62ssIKYwGTQ8OF3v370LDvhRk5WOnXBTjp64aqM1+v 1qNsdW63J7i7m/U8Lfm001mgKXQkwFsSJOWNRquT03KEkNMxIdoaXJj7Wj03l1pou6Na 94tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=g2P/1ix7SwUVGjgN8KdPBeKNA8GhrwuTuPuubczbGn4=; b=n2T5HN3wF9/DN0ugCgoCLajUX2AnJaGmNu1AU36RaBPVMS9SJX6/D4PFPDDIPz70T3 vIQ+PkWocnQNJOVoWlr5xgNRJXpvttdiaaMoH+yYLK3qP7GNsAfvy2tWSEmnYDWg4mCb YEuq9iIEHFmcQaWPp8T+1slWjhiY/R0t7jfWmVfEOGpQos2LuorQC/cRr0R2GkyBP4gk mkQyfAzlw6iqX8ld4rOJZ+ffmc9YMjyEv0uLBt/z2EoAmAnxQxSCfTTwvC8twypBtghw DYPluP/lxZWxYJZvvEXPOOvsK/Pamnz8B/hhPlu9nDnfqfmK0UIAuCJjC3r86eqP/kD2 B5AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=scgYluQj; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f96-v6si2756927plb.418.2018.05.11.02.18.09; Fri, 11 May 2018 02:18:23 -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=pass header.i=@google.com header.s=20161025 header.b=scgYluQj; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752877AbeEKJRn (ORCPT + 99 others); Fri, 11 May 2018 05:17:43 -0400 Received: from mail-pl0-f52.google.com ([209.85.160.52]:44719 "EHLO mail-pl0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752264AbeEKJRl (ORCPT ); Fri, 11 May 2018 05:17:41 -0400 Received: by mail-pl0-f52.google.com with SMTP id e6-v6so2952609plt.11 for ; Fri, 11 May 2018 02:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=g2P/1ix7SwUVGjgN8KdPBeKNA8GhrwuTuPuubczbGn4=; b=scgYluQjihmFZ6QPlqF0L8HyQpTwNFljfKhLiSyZykPXb6jjss+83pN6OqoUlBWO84 6AZTXLA7w/3m8Gj3fLmPLVQX3MhVHaLoDYdUOgeNeNEy1EoKhQTImDq+hnRLN25iLI1o yLkuyOKphJDM3N64pbI/P0GyKJYRRHgxkOFXy58HtI6QgwWenQVl6pXgOk1IKRNCj+/l Xcph5gBK3yhtjIx9OHhYY7ZnLetwP5uXTV9RNJ7ouWcEMd7F+zfJmWaCEZIEA9ciOawM m1FNcFT0DBTS3S+k/BpcoPQnFmNFwhgSvyS5JFAFPc3PfT6vGpwgBGhsUK3zY02hAnpF E0wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=g2P/1ix7SwUVGjgN8KdPBeKNA8GhrwuTuPuubczbGn4=; b=cBcaimY96gNHx1k7w4ybBYiN1DA5b1ArsDG8/ZhU4axwQS5IijqAP+yu+9DZ0PlQDS IwVXGq7mxmS1LJab2iMCLc8iEjsbTJgm0GmBagx+/5iIsCk5FPjcCTtMhVvdhAinGe8S 82C+RsjF/b6bVfyWWeCpLy7L2A3jkY1IElP1ho21ijwmYpUSOIFTrPYjVfgpCiuTLCgN Ql9Y8g8m+SQzUwkrXXxLpwuPuPd8fTGXERu29yINp+iE5mAeZ/UGXaQ+XSMiHNKEgIcg v76DE4G9XaCl2txgydLKlmQmUOb9YuF/50qSb5O6lVWTEg6mE3Ug2Gc8Jap9RXtGBrz3 +HEA== X-Gm-Message-State: ALKqPwcWItN8Rq6D64cvWRXKTpAtWoa5DTFTwh5aktmxETnaAJxebJjT 3Zzi3PJTSLBpHhVMTbD3SWNLRIDxqfCatAyHCxhqxw== X-Received: by 2002:a17:902:595e:: with SMTP id e30-v6mr4672543plj.233.1526030260957; Fri, 11 May 2018 02:17:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.149.24 with HTTP; Fri, 11 May 2018 02:17:20 -0700 (PDT) In-Reply-To: <20180511062151.GA18160@jagdpanzerIV> References: <201805102350.JJH73950.tVJHQLFSOMOOFF@I-love.SAKURA.ne.jp> <20180511014515.GA895@jagdpanzerIV> <201805110238.w4B2cIGH079602@www262.sakura.ne.jp> <20180511062151.GA18160@jagdpanzerIV> From: Dmitry Vyukov Date: Fri, 11 May 2018 11:17:20 +0200 Message-ID: Subject: Re: printk feature for syzbot? To: Sergey Senozhatsky Cc: Tetsuo Handa , Petr Mladek , Sergey Senozhatsky , syzkaller , Steven Rostedt , Fengguang Wu , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 11, 2018 at 8:21 AM, Sergey Senozhatsky wrote: > On (05/11/18 11:38), Tetsuo Handa wrote: >> > >> > So you basically want to have one more con_msg_format_flags? Do >> > you want to track a context which prints out a messages or the >> > context which "generated" the message? A CPU/task that stores >> > a logbuf entry - vprintk_emit() - is not always the same as the >> > CPU/task that prints it to consoles - console_unlock(). >> > >> >> Well, below is the (partial) patch. > > Hi, > > Tetsuo, I will take a look a bit later, but at glance, there are several > ways to achieve what you are trying to do. The first one is the way you > did it - add additional buffer and make that context tracking info part of > the message body. Another one would be to extend struct printk_log and add > pid/cpu/flag there, which you then can convert into text in msg_print_text(). > So far we talked about extending printk_log. Yet another one could be - add > vsprintf specifiers that would add pid/cpu/flag to the vsprintf-ed message. > You then can re-define pr_fmt, for instance, in the code you want to track > pr_fmt "%zZ" fmt, or somehow force printk to add that "%zZ" to every > message. For syzbot perspective, yes, we can set any necessary additional configs, add cmdline arguments, etc. Manually changing format strings won't work -- bugs are all over the place. From what I see, it seems that interrupts can be nested: https://syzkaller.appspot.com/bug?id=72eddef9cedcf81486adb9dd3e789f0d77505ba5 https://syzkaller.appspot.com/bug?id=66fcf61c65f8aa50bbb862eb2fde27c08909a4ff Will this in_nmi()/in_irq()/in_serving_softirq()/else be enough to untangle output printed by such nested interrupts? For the first link it seems that they both are the same type of interrupt -- apic_timer_interrupt.