From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADF84C433E0 for ; Fri, 1 Jan 2021 09:54:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 73B0C207AD for ; Fri, 1 Jan 2021 09:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726515AbhAAJxL convert rfc822-to-8bit (ORCPT ); Fri, 1 Jan 2021 04:53:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:53520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726462AbhAAJxK (ORCPT ); Fri, 1 Jan 2021 04:53:10 -0500 Received: by mail.kernel.org (Postfix) with ESMTPS id 60F25221E9 for ; Fri, 1 Jan 2021 09:52:30 +0000 (UTC) From: bugzilla-daemon@bugzilla.kernel.org To: linux-usb@vger.kernel.org Subject: [Bug 209407] skb_over_panic in cdc_mbim_tx_fixup Date: Fri, 01 Jan 2021 09:52:30 +0000 X-Bugzilla-Reason: None X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: AssignedTo drivers_usb@kernel-bugs.kernel.org X-Bugzilla-Product: Drivers X-Bugzilla-Component: USB X-Bugzilla-Version: 2.5 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jks@iki.fi X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: drivers_usb@kernel-bugs.kernel.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Bugzilla-URL: https://bugzilla.kernel.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org https://bugzilla.kernel.org/show_bug.cgi?id=209407 --- Comment #7 from Jouni Seppänen (jks@iki.fi) --- It looks like the code is calling memset with 0xFFFFFFFE, i.e. negative 2. I added a check in the "If collected data size is less or equal ctx->min_tx_pkt" block: if (!(dev->driver_info->flags & FLAG_SEND_ZLP) && skb_out->len > ctx->min_tx_pkt) { if (ctx->tx_curr_size < skb_out->len) { pr_err("ctx->tx_curr_size = %x < skb_out->len = %x", ctx->tx_curr_size, skb_out->len); BUG(); } padding_count = ctx->tx_curr_size - skb_out->len; And after rerunning my test case, I see: [ 683.677876] ctx->tx_curr_size = 4000 < skb_out->len = 4002 [ 683.677953] ------------[ cut here ]------------ [ 683.683590] kernel BUG at drivers/net/usb/cdc_ncm.c:1414! So ctx->tx_curr_size is 0x4000 but skb_out->len is two larger. -- You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.