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=-7.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 01B17C433E6 for ; Mon, 31 Aug 2020 19:02:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0474207DA for ; Mon, 31 Aug 2020 19:02:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728444AbgHaTCx (ORCPT ); Mon, 31 Aug 2020 15:02:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727993AbgHaTCw (ORCPT ); Mon, 31 Aug 2020 15:02:52 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 603C9C061573; Mon, 31 Aug 2020 12:02:52 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 1F6B212869E83; Mon, 31 Aug 2020 11:46:05 -0700 (PDT) Date: Mon, 31 Aug 2020 12:02:50 -0700 (PDT) Message-Id: <20200831.120250.1316279201672077612.davem@davemloft.net> To: johannes@sipsolutions.net Cc: netdev@vger.kernel.org, kuba@kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, johannes.berg@intel.com, syzbot+353df1490da781637624@syzkaller.appspotmail.com Subject: Re: [PATCH] netlink: policy: correct validation type check From: David Miller In-Reply-To: <20200831202805.8ca5a2fe1ffb.I46f0d5bee0a774517aeec539620895a473dd2299@changeid> References: <000000000000ee7d1a05ae2f2720@google.com> <20200831202805.8ca5a2fe1ffb.I46f0d5bee0a774517aeec539620895a473dd2299@changeid> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 31 Aug 2020 11:46:05 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Johannes Berg Date: Mon, 31 Aug 2020 20:28:05 +0200 > From: Johannes Berg > > In the policy export for binary attributes I erroneously used > a != NLA_VALIDATE_NONE comparison instead of checking for the > two possible values, which meant that if a validation function > pointer ended up aliasing the min/max as negatives, we'd hit > a warning in nla_get_range_unsigned(). > > Fix this to correctly check for only the two types that should > be handled here, i.e. range with or without warn-too-long. > > Reported-by: syzbot+353df1490da781637624@syzkaller.appspotmail.com > Fixes: 8aa26c575fb3 ("netlink: make NLA_BINARY validation more flexible") > Signed-off-by: Johannes Berg Applied, thank you.