Message ID | 1495742765-1722-1-git-send-email-tuliom@linux.vnet.ibm.com |
---|---|
State | Committed |
Delegated to: | Florian Weimer |
Headers |
Received: (qmail 23845 invoked by alias); 25 May 2017 20:06:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 23835 invoked by uid 89); 25 May 2017 20:06:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com From: "Tulio Magno Quites Machado Filho" <tuliom@linux.vnet.ibm.com> To: libc-alpha@sourceware.org Cc: pc@us.ibm.com, joseph@codesourcery.com Subject: [PATCHv2] Add a way to bypass the PLT when calling getauxval Date: Thu, 25 May 2017 17:06:05 -0300 In-Reply-To: <alpine.DEB.2.20.1705241951001.9182@digraph.polyomino.org.uk> References: <alpine.DEB.2.20.1705241951001.9182@digraph.polyomino.org.uk> X-TM-AS-MML: disable x-cbid: 17052520-0028-0000-0000-000001B86906 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17052520-0029-0000-0000-000014B8D33D Message-Id: <1495742765-1722-1-git-send-email-tuliom@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-25_15:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705250365 |
Commit Message
Tulio Magno Quites Machado Filho
May 25, 2017, 8:06 p.m. UTC
2017-05-25 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> * include/sys/auxv.h (__getauxval): Add a prototype and its libc_hidden_proto. * misc/getauxval.c (__getauxval): Use libc_hidden_def. --- include/sys/auxv.h | 7 +++++++ misc/getauxval.c | 1 + 2 files changed, 8 insertions(+)
Comments
Ping! Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> writes: > 2017-05-25 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> > > * include/sys/auxv.h (__getauxval): Add a prototype and its > libc_hidden_proto. > * misc/getauxval.c (__getauxval): Use libc_hidden_def. > --- > include/sys/auxv.h | 7 +++++++ > misc/getauxval.c | 1 + > 2 files changed, 8 insertions(+) > > diff --git a/include/sys/auxv.h b/include/sys/auxv.h > index dede2c3..d46008e 100644 > --- a/include/sys/auxv.h > +++ b/include/sys/auxv.h > @@ -1 +1,8 @@ > #include <misc/sys/auxv.h> > + > +#ifndef _ISOMAC > + > +extern __typeof(getauxval) __getauxval; > +libc_hidden_proto (__getauxval) > + > +#endif /* !_ISOMAC */ > diff --git a/misc/getauxval.c b/misc/getauxval.c > index c83fbce..14f4298 100644 > --- a/misc/getauxval.c > +++ b/misc/getauxval.c > @@ -43,3 +43,4 @@ __getauxval (unsigned long int type) > } > > weak_alias (__getauxval, getauxval) > +libc_hidden_def (__getauxval) > -- > 2.1.0 >
On Fri, Jun 9, 2017 at 6:13 AM, Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> wrote: > Ping! > > Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> writes: > >> 2017-05-25 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> >> >> * include/sys/auxv.h (__getauxval): Add a prototype and its >> libc_hidden_proto. >> * misc/getauxval.c (__getauxval): Use libc_hidden_def. >> --- >> include/sys/auxv.h | 7 +++++++ >> misc/getauxval.c | 1 + >> 2 files changed, 8 insertions(+) >> >> diff --git a/include/sys/auxv.h b/include/sys/auxv.h >> index dede2c3..d46008e 100644 >> --- a/include/sys/auxv.h >> +++ b/include/sys/auxv.h >> @@ -1 +1,8 @@ >> #include <misc/sys/auxv.h> >> + >> +#ifndef _ISOMAC >> + >> +extern __typeof(getauxval) __getauxval; >> +libc_hidden_proto (__getauxval) >> + >> +#endif /* !_ISOMAC */ >> diff --git a/misc/getauxval.c b/misc/getauxval.c >> index c83fbce..14f4298 100644 >> --- a/misc/getauxval.c >> +++ b/misc/getauxval.c >> @@ -43,3 +43,4 @@ __getauxval (unsigned long int type) >> } >> >> weak_alias (__getauxval, getauxval) >> +libc_hidden_def (__getauxval) >> -- >> 2.1.0 >> Which one is better? https://sourceware.org/ml/libc-alpha/2017-06/msg00332.html
"Tulio Magno Quites Machado Filho" <tuliom@linux.vnet.ibm.com> writes: > +extern __typeof(getauxval) __getauxval; Missing space before paren. > diff --git a/misc/getauxval.c b/misc/getauxval.c > index c83fbce..14f4298 100644 > --- a/misc/getauxval.c > +++ b/misc/getauxval.c > @@ -43,3 +43,4 @@ __getauxval (unsigned long int type) > } > > weak_alias (__getauxval, getauxval) > +libc_hidden_def (__getauxval) Looks good. Thanks, Florian
"H.J. Lu" <hjl.tools@gmail.com> writes: >>> diff --git a/misc/getauxval.c b/misc/getauxval.c >>> index c83fbce..14f4298 100644 >>> --- a/misc/getauxval.c >>> +++ b/misc/getauxval.c >>> @@ -43,3 +43,4 @@ __getauxval (unsigned long int type) >>> } >>> >>> weak_alias (__getauxval, getauxval) >>> +libc_hidden_def (__getauxval) >>> -- >>> 2.1.0 >>> > > Which one is better? > > https://sourceware.org/ml/libc-alpha/2017-06/msg00332.html Tulio's patch is better because getauxval references could lead to namespace violations. Thanks, Florian
Florian Weimer <fweimer@redhat.com> writes: > "Tulio Magno Quites Machado Filho" <tuliom@linux.vnet.ibm.com> writes: > >> +extern __typeof(getauxval) __getauxval; > > Missing space before paren. Fixed locally. >> diff --git a/misc/getauxval.c b/misc/getauxval.c >> index c83fbce..14f4298 100644 >> --- a/misc/getauxval.c >> +++ b/misc/getauxval.c >> @@ -43,3 +43,4 @@ __getauxval (unsigned long int type) >> } >> >> weak_alias (__getauxval, getauxval) >> +libc_hidden_def (__getauxval) > > Looks good. I'll push this patch with the fix. Thanks!
diff --git a/include/sys/auxv.h b/include/sys/auxv.h index dede2c3..d46008e 100644 --- a/include/sys/auxv.h +++ b/include/sys/auxv.h @@ -1 +1,8 @@ #include <misc/sys/auxv.h> + +#ifndef _ISOMAC + +extern __typeof(getauxval) __getauxval; +libc_hidden_proto (__getauxval) + +#endif /* !_ISOMAC */ diff --git a/misc/getauxval.c b/misc/getauxval.c index c83fbce..14f4298 100644 --- a/misc/getauxval.c +++ b/misc/getauxval.c @@ -43,3 +43,4 @@ __getauxval (unsigned long int type) } weak_alias (__getauxval, getauxval) +libc_hidden_def (__getauxval)