lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250417125310.GG2430521@horms.kernel.org>
Date: Thu, 17 Apr 2025 13:53:10 +0100
From: Simon Horman <horms@...nel.org>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v1 net-next 1/7] neighbour: Make neigh_valid_get_req()
 return ndmsg.

On Tue, Apr 15, 2025 at 05:41:24PM -0700, Kuniyuki Iwashima wrote:
> neigh_get() passes 4 local variable pointers to neigh_valid_get_req().
> 
> If it returns a pointer of struct ndmsg, we do not need to pass two
> of them.
> 
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>

...

> @@ -2893,17 +2892,19 @@ static int neigh_valid_get_req(const struct nlmsghdr *nlh,
>  		case NDA_DST:
>  			if (nla_len(tb[i]) != (int)(*tbl)->key_len) {
>  				NL_SET_ERR_MSG(extack, "Invalid network address in neighbor get request");
> -				return -EINVAL;

Hi Iwashima-san,

I think you need the following here:

				err = -EINVAL;

> +				goto err;
>  			}
>  			*dst = nla_data(tb[i]);
>  			break;
>  		default:
>  			NL_SET_ERR_MSG(extack, "Unsupported attribute in neighbor get request");
> -			return -EINVAL;

And here.

Flagged by Smatch as:

  .../neighbour.c:2907 neigh_valid_get_req() warn: passing zero to 'ERR_PTR'

> +			goto err;
>  		}
>  	}
>  
> -	return 0;
> +	return ndm;
> +err:
> +	return ERR_PTR(err);
>  }
>  
>  static inline size_t neigh_nlmsg_size(void)

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ