Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp285536pxk; Thu, 1 Oct 2020 02:16:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIS9wg9DvTs8IOPUlpLur+9uMx4HAJCufU4ZUDhxpwNJUsw33s7X9vYxnKP2qP5pdYcxLu X-Received: by 2002:a17:906:8401:: with SMTP id n1mr6835189ejx.215.1601543800195; Thu, 01 Oct 2020 02:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601543800; cv=none; d=google.com; s=arc-20160816; b=rcfaTEfIG0tMxNlTyGkBSwVhHd+SY6JWUML+BbrY64Z7QVXH9dJ/Uk/fnhPl1EEVUB ooyihfKamnaCu366788qlc2AcH5+TGpi9zzZG95r376ND7Ik2D99WO27oSwWpGpLnMOT WyXao0TFtYlcrbhQtexIbA/ytM97vxs3vWsmWA16Y1HSN6NGHd0TBL0ANs0iqNlssy8b 94YFps/Pex4HJfZijyZtb7KupK0U9yv5v8kd09Fwe9E/hBCxhDxcwi9u/MgYEP528IkM 32ldDeD/TcDeitKRJznsIUVS/rLn5HEkrqV01v79LA/Id+n5HgZmPbeexmWFM27aMrPy JNOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:to:dkim-signature:dkim-signature:from; bh=tYBTMaQHVuVYsYUY0Zvr7F9tikwzDOAPYv+gCxumIkQ=; b=ddMdGbwtaq/N4P2sYUiUm9ciCvXpOWU2ZeXXa+U9uCw9vmHzbdbs0r9k77s7YyYQV5 1fS57aVxOEj6CG4STb7HGAOXtN0qWqo5eh/Ejv9dWmyV7xt8WeQtAO9d7YxyXfxUCzPB IWElHuJnjYWuAcHkHOUCahhwG8j/JYKYpyc5So4awuIG+59ugdb+jjZUXo1f3w7/jxub Afesb4ofD2WBwXnO7C3ZdRp5EhbDbc12Lsx+/7hapQb+8KtV5BvlweEpnaO+Yap7TyFw LT57Z0rC+CKF6mkkdBFYyBcgZZ2RP2dGhDdZZ4rg9W5cOhGWjwJz1Uw+jVBtaLbekosT Cy8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="O/0fuph2"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u18si2111059edo.34.2020.10.01.02.16.17; Thu, 01 Oct 2020 02:16:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="O/0fuph2"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731782AbgJAJND (ORCPT + 99 others); Thu, 1 Oct 2020 05:13:03 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:34530 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731663AbgJAJNC (ORCPT ); Thu, 1 Oct 2020 05:13:02 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1601543580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tYBTMaQHVuVYsYUY0Zvr7F9tikwzDOAPYv+gCxumIkQ=; b=O/0fuph25Ea2RKXzd2OjiZOVQ1tE80qGWulsJ4UkxzyqgqqaBH4WyWqTms364VyGowCon5 xLd+eICWgQSXDzM6fanCgUyfqR1bb/AMufqNYIdG8ecO3PB3JYYzav/8Gto0SN5Um9kBtH U/Afkzj6lgha1T4KmdY/0xNYYTku3Q8HhbSiFndUErxCEwnSutznbFbO6V3hVpl2l/zJkx 4RkA3GMs/S3vmv/U/fc/TCKQk82tFPXBMpghPzhdo+KdDVsnLjeA0MEqJOCa0/zK5toWTU vo9Ud+bdAehLcvOqZbK2lAS9wQ+jWWb5POVrQK8/6YoWF7mXcr0HZl+to3UecA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1601543580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tYBTMaQHVuVYsYUY0Zvr7F9tikwzDOAPYv+gCxumIkQ=; b=LFcyRUxzhcWIgf1CEvwD9FOglI/VZj8UR07zAQeKJRi7uUqtsTyZnTN6kez8t1Y/tX6hGr VpnVTEebncTpbXCw== To: Alexei Starovoitov , Daniel Borkmann , bpf , LKML Subject: Re: mb2q experience and couple issues In-Reply-To: References: Date: Thu, 01 Oct 2020 11:13:00 +0200 Message-ID: <87sgayfgwz.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexei, On Wed, Sep 30 2020 at 11:12, Alexei Starovoitov wrote: > For the last couple years we've been using mb2q tool to normalize patches > and it worked wonderfully. Fun. I thought I'm the only user of it :) > Recently we've hit few bugs: > curl -s https://patchwork.kernel.org/patch/11807443/mbox/ > > /tmp/mbox.i; ~/bin/mb2q --mboxout mbox.o /tmp/mbox.i > Drop Message w/o Message-ID: No subject > No patches found in mbox > > I've tried to debug it, but couldn't figure out what's going on. > The subject and message-id fields are parsed correctly, > but later something happens. > Could you please take a look? The problem is the mbox storage format. The mbox created by curl has a mail body which has a line starting with 'From' in the mail body: From the VAR btf_id, the verifier can also read the address of the ksym's corresponding kernel var from kallsyms and use that to fill dst_reg. The mailbox parser trips over that From and takes it as start of the next message. http://qmail.org/qmail-manual-html/man5/mbox.html Usually mailbox storage escapes a From at the start of a newline with '>': >From the VAR btf_id, the verifier can also read the address of the ksym's corresponding kernel var from kallsyms and use that to fill dst_reg. Yes, it's ugly and I haven't figured out a proper way to deal with that. There are quite some mbox formats out there and they all are incompatible with each other and all of them have different horrors. Let me think about it. > Another issue we've hit was that some mailers split message-id > into few lines like this: > curl -s https://patchwork.kernel.org/patch/11809399/mbox/|grep -2 Message-Id: > Subject: [PATCH bpf-next v4 1/6] bpf: add classid helper only based on skb->sk > Date: Wed, 30 Sep 2020 17:18:15 +0200 > Message-Id: > > X-Mailer: git-send-email 2.21.0 > > That was an easy fix: > - mid = pmsg.msgid.lstrip('<').rstrip('>') > + mid = pmsg.msgid.lstrip('\n').lstrip(' ').lstrip('<').rstrip('>') > > The tglx/quilttools.git doesn't have this fix, so I'm guessing you > haven't seen it yet. Indeed, but it just should be: + mid = pmsg.msgid.strip().lstrip('<').rstrip('>') Thanks, tglx