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: <1328040546.8012.6.camel@joe2Laptop>
Date:	Tue, 31 Jan 2012 12:09:06 -0800
From:	Joe Perches <joe@...ches.com>
To:	Arun Sharma <asharma@...com>
Cc:	Bjorn Helgaas <bhelgaas@...gle.com>, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org, David Miller <davem@...emloft.net>,
	Glauber Costa <glommer@...allels.com>,
	Ingo Molnar <mingo@...e.hu>, christoph.paasch@...ouvain.be
Subject: Re: [PATCH] net: Disambiguate kernel message

On Tue, 2012-01-31 at 11:47 -0800, Arun Sharma wrote:
> On Tue, Jan 31, 2012 at 10:50:57AM -0800, Joe Perches wrote:
> > It might be useful to use a generic routine.
[]
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
[]
> @@ -2014,11 +2014,14 @@ adjudge_to_death:
[]
> +		too_many_orphans = tcp_too_many_orphans(sk, 0);
> +		out_of_socket_memory = tcp_out_of_memory(sk);
> +		tcp_log_oom(too_many_orphans, out_of_socket_memory);
[]
> diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
[]
> @@ -77,10 +78,10 @@ static int tcp_out_of_resources(struct sock *sk, int do_reset)
[]
> +	too_many_orphans = tcp_too_many_orphans(sk, shift);
> +	out_of_socket_memory = tcp_out_of_memory(sk);
> +	tcp_log_oom(too_many_orphans, out_of_socket_memory);
> +	if (too_many_orphans || out_of_socket_memory) {

Perhaps these repeated three lines should be a routine like:

bool tcp_check_oom(struct sock *sk, int shift)
{
	bool tcp_orphans = tcp_too_many_orphans(sk, shift);
	bool tcp_oom = tcp_out_of_memory(sk);

	printks...

	return tcp_orphans || tcp_oom;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ