public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Daniel Borkmann <dborkman@redhat.com>
Cc: davem@davemloft.net, linux-sctp@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/2] net: sctp: add build check for sctp_sf_eat_sack_6_2/jsctp_sf_eat_sack
Date: Wed, 13 Feb 2013 16:15:53 -0500	[thread overview]
Message-ID: <20130213211553.GA15598@hmsreliant.think-freely.org> (raw)
In-Reply-To: <84afa536e3652ea27a7efb1f6c9f7c4f29c15043.1360752304.git.dborkman@redhat.com>

On Wed, Feb 13, 2013 at 12:03:50PM +0100, Daniel Borkmann wrote:
> In order to avoid any future surprises of kernel panics due to jprobes
> function mismatches (as e.g. fixed in 4cb9d6eaf85ecd: sctp: jsctp_sf_eat_sack:
> fix jprobes function signature mismatch), we should check both function
> types during build and scream loudly if they do not match. __same_type
> resolves to __builtin_types_compatible_p, which is 1 in case both types
> are the same and 0 otherwise, qualifiers are ignored. Tested by myself.
> 
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
> ---
>  net/sctp/probe.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/net/sctp/probe.c b/net/sctp/probe.c
> index 4eaaaf6..261b7b9 100644
> --- a/net/sctp/probe.c
> +++ b/net/sctp/probe.c
> @@ -183,6 +183,13 @@ static __init int sctpprobe_init(void)
>  {
>  	int ret = -ENOMEM;
>  
> +	/* Warning: if the function signature of sctp_sf_eat_sack_6_2,
> +	 * has been changed, you also have to change the signature of
> +	 * jsctp_sf_eat_sack, otherwise you end up right here!
> +	 */
> +	BUILD_BUG_ON(__same_type(sctp_sf_eat_sack_6_2,
> +				 jsctp_sf_eat_sack) == 0);
> +
>  	init_waitqueue_head(&sctpw.wait);
>  	spin_lock_init(&sctpw.lock);
>  	if (kfifo_alloc(&sctpw.fifo, bufsize, GFP_KERNEL))
> -- 
> 1.7.11.7
Acked-by: Neil Horman <nhorman@tuxdriver.com>

      reply	other threads:[~2013-02-13 21:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1360752304.git.dborkman@redhat.com>
2013-02-13 11:03 ` [PATCH net-next 1/2] net: sctp: minor: make jsctp_sf_eat_sack static Daniel Borkmann
2013-02-13 19:04   ` David Miller
2013-02-13 19:06     ` David Miller
2013-02-13 19:14       ` Daniel Borkmann
2013-02-13 21:02   ` Neil Horman
2013-02-13 11:03 ` [PATCH net-next 2/2] net: sctp: add build check for sctp_sf_eat_sack_6_2/jsctp_sf_eat_sack Daniel Borkmann
2013-02-13 21:15   ` Neil Horman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130213211553.GA15598@hmsreliant.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox