Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2960058pxb; Mon, 6 Sep 2021 09:05:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw5j3rGo0fr9KCQgaIT6PkhsNFymaRWZ3hhHmNpfS0nvek/CHb0Frsvz0dQrLk0z73/Ath X-Received: by 2002:a17:907:8693:: with SMTP id qa19mr14724020ejc.95.1630944353632; Mon, 06 Sep 2021 09:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630944353; cv=none; d=google.com; s=arc-20160816; b=IzOsknIW3GKHYV30d4P/6mDhMN7ZpMBPhO37ajTP/UZ+coauDxakIpGc2ikN5KZITc 3NVtJ7xaXLIzjdvDW/NlBKinWf+8aeISudaJkiqDF5qldh8Ru3U2J2yJIA+CBkNqyC9N HRsmeJe2bJ/YOnsf30/aXN8Ahqbp4ZTixQ5BR9ow0fRf7meH2TSyWY3sPOnDXoqn7gIw 0KYugFWYdPVTTlushdaWVbppKX7fTIrIoOtowdXGG4fYNw4i7qeq4zSULsjhUWCg94/Y whJmg8u7Gm6YJph9cTHKSqLqOV89aBsy3XfFCesIEHKJPNioOUu746ZSPDlmniD7F+Xv dnRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=WA0T8g4ouXG1LIzB7SdJu92X9vqf6WP1W0r6Gck/Zf4=; b=JlhLCZjh+nNwOcYU34RrIEnf0GTce8WKYnLJpDhOaViCaL1Fi+ReKNPpog6Ti0OJiZ hi5+E/EZeE/WXGYUXHoYXMymKGX3Rcn/4lZxGTJEQHwl0ZVm1zq5u4t2sK9t7i0bs4Ig jNLBoat5ZalswjYt9hON0G1lSQCvfr/ntr2Ys//+bliV4cPoEhwzpr71M19V+vcAiUXX w+0hEUNxi3J6U6qM1KqYMRwTz7NN8Bci0ZN85SEk0FC06kq1EmgexRJNqluLRuV11AHN LrSxbE1qQ6PztOmDW46T14eD1dVFCkv8yEpXaxamCXmSEgMKtGW2FnSYRmbKH27apcXm 8RmA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si7714760ejo.166.2021.09.06.09.05.24; Mon, 06 Sep 2021 09:05:53 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243774AbhIFQEo (ORCPT + 99 others); Mon, 6 Sep 2021 12:04:44 -0400 Received: from smtp13.smtpout.orange.fr ([80.12.242.135]:32278 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243596AbhIFQEn (ORCPT ); Mon, 6 Sep 2021 12:04:43 -0400 Received: from localhost.localdomain ([114.149.34.46]) by mwinf5d79 with ME id qg3U2500Z0zjR6y03g3b31; Mon, 06 Sep 2021 18:03:37 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: bWFpbGhvbC52aW5jZW50QHdhbmFkb28uZnI= X-ME-Date: Mon, 06 Sep 2021 18:03:37 +0200 X-ME-IP: 114.149.34.46 From: Vincent Mailhol To: Marc Kleine-Budde , linux-can@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Mailhol Subject: [PATCH v3 0/2] prevent incoherent can configuration in case of early return in the CAN netlink interface Date: Tue, 7 Sep 2021 01:03:08 +0900 Message-Id: <20210906160310.54831-1-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series of two patch prevents, once for all, can_priv to be in an inconsistent state in case of an early return in can_changelink() due to invalid parameters. * Changelog * v2 -> v3: - Allocate the temporary struct can_priv on the heap instead of declaring it as static. - Split the patch into two to make it easier to backport to LTS kernels and add the "Fixes" tag. v1 -> v2: - Change the prototype of can_calc_tdco() so that the changes are applied to the temporary priv instead of netdev_priv(dev). Vincent Mailhol (2): can: netlink: prevent incoherent can configuration in case of early return can: bittiming: change can_calc_tdco()'s prototype to not directly modify priv drivers/net/can/dev/bittiming.c | 8 ++------ drivers/net/can/dev/netlink.c | 34 ++++++++++++++++++--------------- include/linux/can/bittiming.h | 7 +++++-- 3 files changed, 26 insertions(+), 23 deletions(-) -- 2.32.0