From: Florent Fourcot <florent.fourcot@enst-bretagne.fr>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>,
netdev@vger.kernel.org
Subject: Re: [PATCH RFC] ipv6: enable IPV6_FLOWLABEL_MGR for getsockopt
Date: Mon, 04 Nov 2013 18:09:01 +0100 [thread overview]
Message-ID: <5277D4AD.10308@enst-bretagne.fr> (raw)
In-Reply-To: <20131104000425.GB8832@order.stressinduktion.org>
> We should take ip6_fl_lock here, otherwise expires extraction races with
> the garbage collector (which can update it). There seem to be some other
> unsafe places, e.g. fl6_renew.
>
I will fix it, and for fl6_renew too.
>> + freq->flr_label = sfl->fl->label;
>> + freq->flr_dst = sfl->fl->dst;
>> + freq->flr_share = sfl->fl->share;
>> + freq->flr_expires = (sfl->fl->expires - jiffies) / HZ;
>> + freq->flr_linger = sfl->fl->linger / HZ;
>> +
>> + rcu_read_unlock_bh();
>> + return 0;
>> + }
>> + }
>> + rcu_read_unlock_bh();
>> +
>> + return 0;
>
> Maybe return -EINVAL for not found?
>
I don't like -EINVAL for this case, since the user can not know if there
are no label or if the request has bad parameters. Could -ENOMSG be OK?
>> + case IPV6_FLOWLABEL_MGR:
>> + {
>> + struct in6_flowlabel_req freq;
>> +
>
> Can you think about other actions one might do with this getsockopt? Maybe
> we should copy_from_user freq and check if action specifies a GET
> request. So a further extension to this API won't break users which did
> pass uninitialized memory to this getsockopt.
>
Very good idea.
Regards,
--
Florent.
next prev parent reply other threads:[~2013-11-04 17:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-02 16:58 [PATCH RFC] ipv6: enable IPV6_FLOWLABEL_MGR for getsockopt Florent Fourcot
2013-11-04 0:04 ` Hannes Frederic Sowa
2013-11-04 17:09 ` Florent Fourcot [this message]
2013-11-04 17:46 ` Hannes Frederic Sowa
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=5277D4AD.10308@enst-bretagne.fr \
--to=florent.fourcot@enst-bretagne.fr \
--cc=hannes@stressinduktion.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