Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7185727yba; Thu, 2 May 2019 05:53:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLnU4AB6UJfWyTuNqU0niwFlwgKNWBdNcDCC2vGVSzUzu1OyFeXVplGiyxyHuMJadVcguL X-Received: by 2002:a17:902:a402:: with SMTP id p2mr1897691plq.131.1556801602952; Thu, 02 May 2019 05:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556801602; cv=none; d=google.com; s=arc-20160816; b=r9DeWZTOyV2D+Ven6I/5ggTKeJYP01lK0z4Z838FiDQlQ7Wf1M3NWahTDUpgJ8HU9J L3rczocAocZwmwBueGILjqFB84LInANfXs9D20ZYFt3ldcs/hy1cLKJYfzdhRSv2UEQP IO0bSRszCqWQTdGzMeeXYZdjDDUOhOoMUFFm/mFWJzhrm4I5rNbTZm6p9jTw/9CUCZtJ AZsSjr13AIfy0G5p7THPEHZgZ2ifAdtPTk3dk15BMnHNxtppIXNa5Fl1woRAGSV421x4 MbIrq8IUUwqKgF6xhtge/kV41j+0uUuFFI4MPFWM3KaGfBN0ED9lsmUsFjQstOqlEh0R 6ALA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=XG9EDmbdlwurjZeLf1KulQb0uZzdRZSnXSkSf9wXbzM=; b=A3jdy7mMGyUdujE8s/BGxs0IfrSX3PUIZKGf7wWgbq1b0VySEV+3Cwu5d90GMLHF8a hRkCg/KcmK/S7cupKSN+VysIK+39l4B7fYCnSuS9smP0FPIPcE3m8wNcxf5OU9XvlVtP vs3JZtKg/QwloSVP62EaafW1jMesRirgQhuYqVGjJLcZ3/3JKv/HGiUSOKTzWrQTrpEQ qCpKWQ7jOqBqXJVdY5M3FVkD6qRymDc6iREnyMJrOneWftXe+qISoLLP53A1o+BsChVV xWbIfMGAxEnt5pUsjQBtwYN7Oqt8iwV6RGg1cwwxOWix3tjObyvHRSZzUV5c3ePS0SRy Tvbw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3si16017030plp.47.2019.05.02.05.53.07; Thu, 02 May 2019 05:53:22 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726472AbfEBMwP (ORCPT + 99 others); Thu, 2 May 2019 08:52:15 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:55524 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbfEBMwP (ORCPT ); Thu, 2 May 2019 08:52:15 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hMBC8-0000wr-C6; Thu, 02 May 2019 14:52:12 +0200 Message-ID: Subject: Re: [PATCH net-next 2/3] netlink: set bad attribute also on maxtype check From: Johannes Berg To: Michal Kubecek , "David S. Miller" Cc: "netdev@vger.kernel.org" , David Ahern , "linux-kernel@vger.kernel.org" Date: Thu, 02 May 2019 14:52:10 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-2.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-05-02 at 12:48 +0000, Michal Kubecek wrote: > The check that attribute type is within 0...maxtype range in > __nla_validate_parse() sets only error message but not bad_attr in extack. > Set also bad_attr to tell userspace which attribute failed validation. Good catch, we actually do have an attribute in this case. Reviewed-by: Johannes Berg johannes